Results 1 to 2 of 2

Thread: Modal dialog in QMainWindow's event() function

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2006
    Posts
    7
    Thanks
    1
    Thanked 2 Times in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Modal dialog in QMainWindow's event() function

    Hi,

    My problem is: the CPU runs high (~60 %) when I display a modal dialog inside QMainWindow's event() function.

    I don't reimplement event() but it gets called as a result of cross-thread signal/slot.
    Essentially, my application takes requests from the network, then modifies the GUI accordingly. The application queues the requests in a separate thread. As each request is dequeued a signal is sent and the application processes the request. The signal/slot connection looks like the following:

    connect
    (
    thread,
    thread_request_ready_signal,
    gui_thread_app,
    gui_thread_app_request_processing_slot
    )

    CPU usage is fine until one of the request needs to pop up a modal dialog, say, to report an error in processing the request. This is where the CPU usage leaps to ~60% from a normal <5%. I think this is because the event() function is prevented from proceeding until the user clears the modal dialog.

    Would someone please explain and tell me how to fix this problem? Or, in general, if a worker thread needs to report an error in a modal dialog how should it do that? For my application, a modeless dialog approach is not desirable.

    Thanks

    EDIT: "...until one of the request needs to pop up a modal dialog..." should read "...until the request processing slot needs to pop up a modal dialog..."
    Last edited by tanminh; 21st June 2007 at 22:37. Reason: Clarification

Similar Threads

  1. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  2. use qpsql
    By raphaelf in forum Installation and Deployment
    Replies: 34
    Last Post: 22nd August 2006, 12:52
  3. dialog box
    By Bahar in forum Qt Programming
    Replies: 3
    Last Post: 31st January 2006, 14:52

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.