Results 1 to 3 of 3

Thread: QComboBox problem (donno wat to do!)

  1. #1
    Join Date
    Jul 2011
    Posts
    3
    Thanks
    1
    Qt products
    Platforms
    Windows

    Default QComboBox problem (donno wat to do!)

    i am using python2.7 and pyqt4. i built a gui using designer . it has a qcombobox and i am able to populate the list but donno how to catch the signal when it is activated(when an item is selected from the list in qcombobox)



    QtCore.QObject.connect(self.ui.qcombobox, QtCore.SIGNAL("activated()"),????????)
    Last edited by bishop; 15th July 2011 at 09:45.

  2. #2
    Join Date
    May 2011
    Posts
    239
    Thanks
    4
    Thanked 35 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: QComboBox problem (donno wat to do!)

    Check out http://techbase.kde.org/Development/...nals_and_slots

    Now, from the combobox documentation you'll see that the activated signal send an int parameter. You need to connect the signal to a method that can handle a number as parameter:
    Qt Code:
    1. def rowselected(rownumber)
    2. print "Row " + rownumber + " selected"
    3.  
    4. QObject.connect(qcombobox, SIGNAL("activated(int)"), rowselected)
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to mvuori for this useful post:

    bishop (17th July 2011)

  4. #3
    Join Date
    Jul 2011
    Posts
    3
    Thanks
    1
    Qt products
    Platforms
    Windows

    Default Re: QComboBox problem (donno wat to do!)

    hey thanks for the help was able to get it working . i am facing with one more problem please help me out. details posted in this thread. http://www.qtcentre.org/threads/4320...T-and-PySerial

Similar Threads

  1. QComboBox Problem
    By UnforgiveNX in forum Qt Programming
    Replies: 0
    Last Post: 18th November 2010, 16:50
  2. QComboBox problem
    By SteveH in forum Newbie
    Replies: 2
    Last Post: 2nd March 2009, 22:20
  3. QComboBox problem
    By ^NyAw^ in forum Qt Programming
    Replies: 4
    Last Post: 31st March 2008, 12:43
  4. Problem while using QComboBox
    By merry in forum Qt Programming
    Replies: 6
    Last Post: 20th December 2007, 11:22
  5. Problem with QComboBox
    By jogeshwarakundi in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 8th December 2007, 14:21

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.