<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Le 28/07/11 20:22, Tony Peña a écrit :
    <blockquote
cite="mid:CALBaCdvXNScbpRrqAY5pKgr6VZ7nbxr0ZFpg_Peb0P1GV3FPOg@mail.gmail.com"
      type="cite">Hi. 
      <div><br>
      </div>
      <div>I have some data into DB and i want to populate that into
        Combobox and get some errors</div>
      <div><br>
      </div>
      <div>
        <div>       for countries in cursor.execute("SELECT Country FROM
          iata_icao_codes;"):</div>
        <div>            self.connect(self.ui.country_list.addItem(0,
          str(countries)))</div>
        <div><br>
        </div>
        <div>error:</div>
        <div><br>
        </div>
        <div>
          <div>TypeError: arguments did not match any overloaded call:</div>
          <div>QComboBox.addItem(QString, QVariant userData=QVariant()):
            argument 1 has unexpected type 'int'</div>
          <div>QComboBox.addItem(QIcon, QString, QVariant
            userData=QVariant()): argument 1 has unexpected type 'int'</div>
        </div>
        <div><br>
        </div>
        <div>i Try with this form:</div>
        <div><br>
        </div>
        <div>
          <meta http-equiv="content-type" content="text/html;
            charset=UTF-8">
          <div>
                   for countries in cursor.execute("SELECT Country FROM
            iata_icao_codes;"):</div>
          <div>           
            self.connect(self.ui.country_list.insertItems(0, countries))</div>
        </div>
        <div><br>
        </div>
        <div>
          <div>TypeError: arguments did not match any overloaded call:</div>
          <div>QObject.connect(QObject, SIGNAL(), QObject, SLOT(),
            Qt.ConnectionType=Qt.AutoConnection): argument 1 has
            unexpected type 'NoneType'</div>
          <div>QObject.connect(QObject, SIGNAL(), callable,
            Qt.ConnectionType=Qt.AutoConnection): argument 1 has
            unexpected type 'NoneType'</div>
          <div>QObject.connect(QObject, SIGNAL(), SLOT(),
            Qt.ConnectionType=Qt.AutoConnection): argument 1 has
            unexpected type 'NoneType'</div>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>any idea?</div>
        <div><br>
        </div>
        <div>thanxs by the way</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 moz-do-not-send="true"
              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>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
PyQt mailing list    <a class="moz-txt-link-abbreviated" href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a>
<a class="moz-txt-link-freetext" href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a></pre>
    </blockquote>
    The return of addItem, insertItem and other is always None<br>
    <br>
    ...<br>
    >>> cb = QtGui.QComboBox()<br>
    >>> print cb.insertItem(0, "Item")<br>
    None<br>
    >>> print cb.addItem("Item")<br>
    None<br>
    >>><br>
    <br>
    Why are you using 'connect' ?<br>
    <br>
    <br>
    <div>
             for countries in cursor.execute("SELECT Country FROM
      iata_icao_codes;"):</div>
    <div>            self.ui.country_list.insertItems(0, countries)</div>
    <br>
    No ?<br>
    <div class="moz-signature">-- <br>
      Vincent V.V.<br>
      <a href="https://launchpad.net/oqapy">Oqapy</a> . <a
        href="https://launchpad.net/qarte+7">Qarte+7</a> . <a
        href="https://launchpad.net/paqager">PaQager</a></div>
  </body>
</html>