Results 1 to 2 of 2

Thread: events interacting with signals/slots

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2006
    Location
    Narvik, NORWAY
    Posts
    9
    Thanks
    1
    Qt products
    Qt3
    Platforms
    Windows

    Red face events interacting with signals/slots

    A simple excample:

    A QlineEdit's lostFocus()-signal is connected to a slot in my class, who inherits QWidget.
    The QLineEdit resides inside the same class.

    While debugging my system, I experience that the slot is executed 3 times when the lineEdit looses focus. I would expect it to be called only ones.

    I wonder if this has something to do with Qt's eventhandling? If so, how does this work?

    I hope somebody can explaine this to me.

  2. #2
    Join Date
    Mar 2006
    Posts
    14
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: events interacting with signals/slots

    Hi,

    I am no expert, but had a similar problem once or twice. The problem could be that you have multiple QLineEdits with the same name in your .ui files. For some reason, when multiple widgets exist with the same name, the slots are called multiple times. At least, that was the case at my place. My solve was to name all widgets unique in Qt.

    Best Regards,
    Beluvius

Similar Threads

  1. QStackerWidget and mouse events
    By high_flyer in forum Qt Programming
    Replies: 3
    Last Post: 25th April 2006, 19:25
  2. Discard user input events in QEventLoop.
    By Ben.Hines in forum Qt Programming
    Replies: 2
    Last Post: 17th April 2006, 20:49
  3. how to detect key pad events???
    By mahe2310 in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 13th April 2006, 04:40
  4. Delays in processing events
    By Caius Aérobus in forum Qt Programming
    Replies: 6
    Last Post: 7th April 2006, 12:42
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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
  •  
Qt is a trademark of The Qt Company.