Results 1 to 4 of 4

Thread: Recursive call detected

  1. #1
    Join Date
    May 2009
    Posts
    7
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Recursive call detected

    Hello.

    I am using a main thread (GUI Thread) and multiple other threads for communication. The communication threads emit signals to the main thread. In the slots for those signals I open message boxes by using QDialog::exec(). Everything works alright if there is no open message. But if there is already an open message in the main GUI thread which has also been opened by using QDialog::exec() I get a Qt warning telling me that I am having a recursive call. But this is exactly what I want to do. Is there any other way than exec() to block the main thread in order to force my users to answer a certain dialog message?

    Kind regards,
    Sebastian

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Recursive call detected

    Are you sure you want to execute a loop that is already being executed? Maybe you want to execute some other loop?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    May 2009
    Posts
    7
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Recursive call detected

    Hello,

    yes that is what I want to do. This is like a stacked message box in the main UI thread. Any other ideas how to realize that?

    Kind regards,
    Sebastian

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Recursive call detected

    Quote Originally Posted by SebastianBecker View Post
    This is like a stacked message box in the main UI thread.
    Can you stack a message box over the same message box? Because I can only stack two message boxes one over the other... I don't see the point of executing a loop that is already being executed. It's like you wanted to show() a widget, then show() it again and then if you called hide() you would want it to still be visible (because show() was called twice)... It doesn't work that way. Call exec() once and don't call it again until the dialog exits the loop - you can't make a dialog modal to itself.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QSqlQuery and seek() - doesn't work on first call.
    By amicitas in forum Qt Programming
    Replies: 1
    Last Post: 2nd October 2008, 17:25
  2. what if qthread call same slot at the same time?
    By zl2k in forum Qt Programming
    Replies: 2
    Last Post: 11th September 2008, 09:58
  3. QDialog::exec : Recursive call detected.
    By node_ex in forum Qt Programming
    Replies: 4
    Last Post: 29th June 2008, 17:50
  4. Replies: 1
    Last Post: 28th May 2008, 16:52
  5. QTimer or recursive calls for simulation?
    By Morea in forum Qt Programming
    Replies: 3
    Last Post: 12th May 2006, 00:19

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.