Results 1 to 2 of 2

Thread: QComboBox event

  1. #1
    Join Date
    Jan 2011
    Posts
    23
    Qt products
    Platforms
    Windows

    Question QComboBox event

    Hi,

    I have created QCombox in UI and converted it in .py using Pyuic4. Now in my main py file i have imported this UI.py file and written an event for QCombox as follows

    name of QCombox is shotCB

    def on_shotCB_activated(self):
    print "A";

    but when i tried to run my py file, though i selected item once A got printed twice.

    again i tried

    def on_shotCB_currentIndexChanged(self):
    print "A";

    but this event also gave me same results i.e. printed A twice

    Can anybody tell me where i am going wrong?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,668
    Thanks
    13
    Thanked 1,595 Times in 1,523 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QComboBox event

    The slot has been connected twice: possibly once by your code explicitly and once by the automatic connection mechanism triggered by the on_widget_signal() naming.

Similar Threads

  1. QComboBox menu mouse press event
    By San_Cou in forum Qt Programming
    Replies: 0
    Last Post: 30th January 2013, 17:18
  2. Qt/MFC Event Loop - stop MFC receiving event?
    By Kaylx in forum Qt Programming
    Replies: 1
    Last Post: 26th April 2012, 18:57
  3. Replies: 10
    Last Post: 15th January 2010, 14:35
  4. Replies: 0
    Last Post: 23rd October 2008, 12:43
  5. no MouseButtonRelease event for QComboBox
    By Beluvius in forum Qt Programming
    Replies: 5
    Last Post: 31st March 2006, 12:58

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.