Results 1 to 5 of 5

Thread: QEventLoop not closing

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default QEventLoop not closing

    Hi,

    I have an EventLoop defined like this

    void MyWindow()

    m_Loop = new QEventLoop() -- class parameter
    --do stuff
    --connect keyPressed - quit(m_loop)
    m_loop.exec() --In order to wait a keyPressed and close the window


    ... If we wait a lot of time in order to press the key, an energy-saver begins its execution, we have connected a QTimer (120 seconds) to a slot called EnergySaver()

    Inside the slot we do:

    m_loop.exit() -- In order to end and close the window because of energy-saver.

    The problem is that this exit() is executing a lot of instructions after it was called.

    Why?

    Thanks in advance

    K

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

    Default Re: QEventLoop not closing

    We have no idea what the rest of your program does after the m_loop.exec() call returns. Calling exit() on the QEventLoop has nothing to do with closing windows or applications.

Similar Threads

  1. QEventLoop in QApplication
    By Qiieha in forum Qt Programming
    Replies: 1
    Last Post: 22nd May 2012, 19:08
  2. QThread and QEventLoop - Idle Processing
    By kloffy in forum Newbie
    Replies: 14
    Last Post: 28th April 2011, 11:41
  3. QTest and QEventLoop inside a library
    By MementoMori in forum Qt Programming
    Replies: 1
    Last Post: 22nd February 2011, 15:38
  4. How to use QEventLoop?
    By MorrisLiang in forum Newbie
    Replies: 3
    Last Post: 13th May 2010, 16:23
  5. qprocess or qeventloop
    By knishaq in forum Qt Programming
    Replies: 1
    Last Post: 20th December 2009, 10:14

Tags for this Thread

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.