Results 1 to 2 of 2

Thread: QObject::connect (fast)

  1. #1
    Join Date
    Aug 2007
    Posts
    275
    Thanks
    28
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default QObject::connect (fast)

    I have a widget (QlineEdits) thats is used to update a string member of my struct, the trigger is the editingFinished() signal from the QLineEdit.

    from the snippet below

    Qt Code:
    1. myclass::updateString(void) // connected to the editingFinished()
    2. {
    3. myStruct.name /* which is a QString*/ = myLineEdit->text();
    4. }
    5.  
    6. myclass::saveToFile(void)
    7. {
    8. finalStruct = myStruct;
    9.  
    10. save(finalStruct); // found that my finalStruct has the old data of myStruct
    11. }
    To copy to clipboard, switch view to plain text mode 

    I run in debugging mode and found that updateString was performed after saveToFile, that is when i type in line edit then pressed save . My hunch is that the updateString connection was qued or delayed somehow, Now my question is how can i make a connection givine a the highest priority?

    baray98

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QObject::connect (fast)

    Quoting Signals and Slots:
    If several slots are connected to one signal, the slots will be executed one after the other, in an arbitrary order, when the signal is emitted.
    You shouldn't rely on the order.
    J-P Nurmi

Similar Threads

  1. Replies: 6
    Last Post: 21st September 2007, 13:51
  2. Are fast reg exps too much to ask?
    By fullmetalcoder in forum Qt Programming
    Replies: 10
    Last Post: 15th June 2007, 21:02
  3. QObject::connect says "no such signal"
    By MistaPain in forum Qt Programming
    Replies: 3
    Last Post: 31st October 2006, 05:40
  4. QStringList in QObject::connect
    By DPinLV in forum Qt Programming
    Replies: 6
    Last Post: 6th September 2006, 17:01

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.