Results 1 to 2 of 2

Thread: Why QTouchEvent events start working only if I hide and show window?

  1. #1
    Join Date
    Apr 2011
    Location
    Montreal, Canada
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Why QTouchEvent events start working only if I hide and show window?

    Hello,

    Maybe someone can tell me why I don't receive any QTouchEvent events in my application until I hide my widgets and show them again.

    My top widget is a tab widget. I handle the QTouchEvent in the first tab only.

    I have several widgets in the first tab and I create all the widgets at startup. I also set the WA_AcceptTouchEvents recursively to all my widgets in the first tab.

    Immediately after startup, I cant get any events in my QTouchEvent handler. But if a go in the second tab and come back in the first tab, I start getting the QTouchEvent as expected and everything works.

    It seems that hiding and showing the widgets is triggering something that makes my QTouchEvent flowing as expected.

    I also made another experiment with a single shot timer. In the timout event handler I hide the widgets and show them. The QTouchEvent events start working after the timer (I no longer need to switch tab).

    Any idea why I observe these issues? Thanks in advance...

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Why QTouchEvent events start working only if I hide and show window?

    Did you overload the touchEevent handler, or did you install eventFilter?
    If with eventFilter() where do you set it?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Replies: 22
    Last Post: 26th November 2015, 20:27
  2. MAC: Getting Dock widget show/hide events
    By jay in forum Qt Programming
    Replies: 3
    Last Post: 31st May 2010, 08:07
  3. how to show an app if it manually hide
    By jthacker in forum Qt Programming
    Replies: 1
    Last Post: 26th March 2010, 13:02
  4. how to show and hide frames?
    By rambo83 in forum Qt Programming
    Replies: 2
    Last Post: 6th January 2010, 09:53
  5. How to hide mainwindow at program start up
    By palmer in forum Qt Programming
    Replies: 4
    Last Post: 13th September 2008, 14:35

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.