Results 1 to 16 of 16

Thread: Timer to find out if app id idle not working as expected

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2014
    Posts
    136
    Thanks
    72
    Qt products
    Qt3 Qt4 PyQt3 PyQt4
    Platforms
    MacOS X Windows

    Default Re: Timer to find out if app id idle not working as expected

    I tried this in main.cpp of my app:

    Qt Code:
    1. Application app(argc, argv);
    2.  
    3. IdleTimer *timer = IdleTimer::instance(&app,5);
    4. app.installEventFilter(timer);
    To copy to clipboard, switch view to plain text mode 

    Still same result. The debug message always comes 20 seconds after the app launches, no mater what I do, like clicking or moving the mouse.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Timer to find out if app id idle not working as expected

    Does the eventFilter method get called?

    Cheers,
    _

  3. #3
    Join Date
    May 2014
    Posts
    136
    Thanks
    72
    Qt products
    Qt3 Qt4 PyQt3 PyQt4
    Platforms
    MacOS X Windows

    Default Re: Timer to find out if app id idle not working as expected

    Yes, that's the problem, it does! If I put a simple qDebug in the event filter if conditional, it prints out all the time when I move my mouse or click anything! I cannot understand how it just fails to clear the timer!

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Timer to find out if app id idle not working as expected

    Weird.
    Have you tried stop/start?

    Cheers,
    _

Similar Threads

  1. MVC - canFetchMore() is not working as expected
    By prasad_N in forum Qt Programming
    Replies: 6
    Last Post: 13th October 2015, 11:41
  2. QDir not working as expected
    By BettaUseYoNikes in forum Qt Programming
    Replies: 2
    Last Post: 24th August 2011, 16:55
  3. Replies: 2
    Last Post: 22nd December 2010, 10:37
  4. keyPressevent not working with timer.
    By T1001 in forum Newbie
    Replies: 5
    Last Post: 9th December 2010, 04:55
  5. QTableView not working as expected.
    By junxuan in forum Qt Programming
    Replies: 7
    Last Post: 30th July 2009, 08:17

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
  •  
Qt is a trademark of The Qt Company.