Results 1 to 2 of 2

Thread: My SDI application freezes when it is inactive ...why ?

  1. #1
    Join Date
    Jan 2006
    Posts
    162
    Thanks
    9
    Qt products
    Qt3
    Platforms
    Windows

    Default My SDI application freezes when it is inactive ...why ?

    Hi everybody !

    I have a SDI application which plays a movie. When the main window is not active, the movie is paused and resumed when the main window is active again.

    This is not the good behaviour because the movie should not be paused when the SDI application is inactive.

    Here are some more details ... The QApplication object has a QMainWindow object which has a QWidget objet as its central widget. In the paintEvent function of the QWidget object I use another object to get the bitmpa to display. I can see that the paintEvent function is not called when my application is not active. None of my widgets have a focus policy (the default focus policy value is used ... QWidget::NoFocus). The Qt version I use is 3.02.

    I hope someone could give me some clues to find out my problem.

    thanks in advance.
    Last edited by yellowmat; 5th September 2006 at 17:25. Reason: Telling precisely the Qt version used

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

    Default Re: My SDI application freezes when it is inactive ...why ?

    Paint event won't be called because the window doesn't need to be refreshed. You can use a QTimer object to trigger QWidget::update() in regular intervals of time. Better yet, connect it to a custom slot, fetch the "next frame" there and call QWidget::update() from there. The paint event shouldn't contain any routines not connected with painting, because you never know when it will be called.

Similar Threads

  1. Replies: 3
    Last Post: 8th December 2006, 19:51
  2. Gnome makes application crash
    By regix in forum Qt Programming
    Replies: 35
    Last Post: 18th August 2006, 20:44
  3. How to install my own application in QUnitTest
    By Artschi in forum Qt Programming
    Replies: 3
    Last Post: 18th July 2006, 17:05
  4. Replies: 3
    Last Post: 31st March 2006, 19:38
  5. Replies: 0
    Last Post: 21st February 2006, 17:30

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.