ok nothing yet<div>i refresh the code again here with QLabel now.. :|</div><div><br></div><div><div><div>            airlineCodePath = './airlines/%s.gif' % code_airline</div><div>            try:</div><div>                if os.path.exists(airlineCodePath) is True:</div>

<div>                    airline = QtGui.QLabel()</div><div>                    Pixmap = QtGui.QPixmap(airlineCodePath)</div><div>                    airline.fileName = airlineCodePath</div><div>                    col_airline = QtGui.QLabel.setPixmap(Pixmap)</div>

<div>                    self.ui.PILOT_FullList.setItem(startrow, 0, col_airline)</div><div>                else:</div><div>                    code_airline = '-'</div><div>                    col_airline = QtGui.QTableWidgetItem(code_airline, 0)</div>

<div>                    self.ui.PILOT_FullList.setItem(startrow, 0, col_airline)   </div><div>            except:</div><div>                pass         </div></div><div><br></div><div>someone can made simple table 1x1 with a simple .gif, .png or .jpg example???</div>

<div><br></div><div>regards</div><br><div class="gmail_quote">2011/8/4 Tony Peña <span dir="ltr"><<a href="http://emperor.cu">emperor.cu</a>@<a href="http://gmail.com">gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Ohh.. about errors.. ok it is for try excep pass.. sorry for that..<div>and yes i have use Qlabel with Pixmap in other QWIdgetTab</div><div>and works.. i try it with QLabel again</div><div><br></div><div>thanxs<div><div>
</div>
<div class="h5"><br><br><div class="gmail_quote">
2011/8/4 Vincent Vande Vyvre <span dir="ltr"><<a href="mailto:vincent.vandevyvre@swing.be" target="_blank">vincent.vandevyvre@swing.be</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<u></u>

  
    
  
  <div text="#000000" bgcolor="#ffffff">
    Le 04/08/11 18:06, Tony Peña a écrit :
    <blockquote type="cite"><div><div></div><div>Hi i trying set logoimage into cell of QtableWidget
      <div><br>
      </div>
      <div>all code runs ok but can't see the image in the table</div>
      <div><br>
      </div>
      <div>i try with .gif and .png files</div>
      <div><br>
      </div>
      <div>any idea?</div>
      <div><br>
      </div>
      <div>heres the code:</div>
      <div><br>
      </div>
      <div>./airlines/ (many logosfiles in ABC.gif and ABC.png)</div>
      <div>if exist show up ifnot just say the code of aircraft</div>
      <div><br>
      </div>
      <div>
        <div>            code_airline = row[0][:3]</div>
        <div>            airlineCodePath = './airlines/%s.png' %
          code_airline</div>
        <div>            try:</div>
        <div>                if os.path.exists(airlineCodePath) is True:</div>
        <div>                    image =
          QtGui.QIcon(QtGui.QPixmap(airlineCodePath))</div>
        <div>                    airline = QtGui.QTableWidgetItem(image)</div>
        <div>                    airline.setIcon(image)</div>
        <div>                    col_airline =
          QtGui.QTableWidgetItem(airline, 0)</div>
        <div>                    self.ui.PILOT_FullList.Seti(startrow,
          1, code_airline)    </div>
        <div>                else:</div>
        <div>                    code_airline = '-'</div>
        <div>                    col_airline =
          QtGui.QTableWidgetItem(code_airline, 0)</div>
        <div>                   
          self.ui.PILOT_FullList.setItem(startrow, 0, col_airline)   </div>
        <div>            except:</div>
        <div>                pass         </div>
        <div><br>
        </div>
        thanxs any way by all</div>
      <div><br>
      </div>
      <div><br>
        -- <br>
        <font color="#888888"><font color="#888888">Antonio Pe</font><span><font color="#888888">ñ</font></span><font color="#888888">a</font><span></span><br>
          <font color="#888888">Secure email with PGP 0x8B021001
            available at <a href="http://pgp.mit.edu" target="_blank">http://pgp.mit.edu</a><br>
          </font></font><font color="#888888">
          <font color="#888888">Fingerprint: 74E6 2974 B090 366D CE71 
            7BB2 6476 FA09 8B02 1001</font></font><br>
      </div>
      </div></div><pre><fieldset></fieldset>
_______________________________________________
PyQt mailing list    <a href="mailto:PyQt@riverbankcomputing.com" target="_blank">PyQt@riverbankcomputing.com</a>
<a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a></pre>
    </blockquote>
    Hi,<br>
    <br>
    Your construction is not exact<br>
    <br>
            icon = QtGui.QIcon(QtGui.QPixmap("image_path"))<br>
            item = QtGui.QTableWidgetItem(icon, "")        # Second
    argument (required !) is text<br>
            self.tableWidget.setItem(0, 0, item)<br>
    <br>
    Normaly you should have errors but with your "try: except: pass" ...<br><font color="#888888">
    <br>
    <div>-- <br>
      Vincent V.V.<br>
      <a href="https://launchpad.net/oqapy" target="_blank">Oqapy</a> . <a href="https://launchpad.net/qarte+7" target="_blank">Qarte+7</a> . <a href="https://launchpad.net/paqager" target="_blank">PaQager</a></div>
  </font></div>


<br>_______________________________________________<br>
PyQt mailing list    <a href="mailto:PyQt@riverbankcomputing.com" target="_blank">PyQt@riverbankcomputing.com</a><br>
<a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br></blockquote></div><br><br clear="all"><br>-- <br><font color="#888888"><font color="#888888">Antonio Pe</font><span><font color="#888888">ñ</font></span><font color="#888888">a</font><span></span><br>


<font color="#888888">Secure email with PGP 0x8B021001 available at <a href="http://pgp.mit.edu" target="_blank">http://pgp.mit.edu</a><br></font></font><font color="#888888">
<font color="#888888">Fingerprint: 74E6 2974 B090 366D CE71  7BB2 6476 FA09 8B02 1001</font></font><br>
</div></div></div>
</blockquote></div><br><br clear="all"><br>-- <br><font color="#888888"><font color="#888888">Antonio Pe</font><span><font color="#888888">ñ</font></span><font color="#888888">a</font><span></span><br><font color="#888888">Secure email with PGP 0x8B021001 available at <a href="http://pgp.mit.edu" target="_blank">http://pgp.mit.edu</a><br>

</font></font><font color="#888888">
<font color="#888888">Fingerprint: 74E6 2974 B090 366D CE71  7BB2 6476 FA09 8B02 1001</font></font><br>
</div>