Results 1 to 2 of 2

Thread: Expanded QComboBox Prevents QPushButton Clicks

  1. #1
    Join Date
    Aug 2016
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Expanded QComboBox Prevents QPushButton Clicks

    Hello,

    When using a touchscreen, leaving a QComboBox expanded and then clicking on a QPushButton leaves the button depressed and prevents the clicked() signal from being emitted from the button. pressed() works as documented but released() only takes effect when some other user input is performed. I was able to replicate this behavior using only automated clicks, no touchscreen required. The attached file is a small project with a "Run" button that goes through the steps that should cause the issue. Going through the same steps with a mouse produces the expected effects.

    I've noticed that splitting the automated mouse press from the mouse release doesn't change the behavior but placing a QApplication::processEvents() call between the press and release (see code snippet) causes the pushbutton to correctly emit clicks() but I have no idea why this is the case. It's possible to go through the application and change the connections using clicked() to pressed() but this would leave the buttons depressed and I'd like to know if you have any input on why this is happening.

    Produced on Qt 5.5.1, Windows 7 and 10

    Thanks,
    Sean

    Qt Code:
    1. {
    2. INPUT input;
    3. input.type = INPUT_MOUSE;
    4. input.mi.mouseData = 0;
    5. input.mi.dx = point.x() * ( 65536.0 / GetSystemMetrics( SM_CXSCREEN ) );
    6. input.mi.dy = point.y() * ( 65536.0 / GetSystemMetrics( SM_CYSCREEN ) );
    7. input.mi.dwFlags = MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE | MOUSEEVENTF_LEFTDOWN ;
    8. input.mi.mouseData = 0;
    9. input.mi.time = 0;
    10. SendInput( 1, &input, sizeof( input ) );
    11. }
    12.  
    13. QApplication::processEvents();
    14.  
    15. {
    16. INPUT input;
    17. input.type = INPUT_MOUSE;
    18. input.mi.mouseData = 0;
    19. input.mi.dx = point.x() * ( 65536.0 / GetSystemMetrics( SM_CXSCREEN ) );
    20. input.mi.dy = point.y() * ( 65536.0 / GetSystemMetrics( SM_CYSCREEN ) );
    21. input.mi.dwFlags = MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE | MOUSEEVENTF_LEFTUP;
    22. input.mi.mouseData = 0;
    23. input.mi.time = 0;
    24. SendInput( 1, &input, sizeof( input ) );
    25. }
    To copy to clipboard, switch view to plain text mode 

    ButtonBork.zip
    Last edited by sean8051; 29th August 2016 at 19:18.

  2. #2
    Join Date
    Aug 2016
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Expanded QComboBox Prevents QPushButton Clicks

    It looks like this is a known problem in Qt with Windows currently without a fix.

    https://bugreports.qt.io/browse/QTBU...box%20touch%22

    Sean

Similar Threads

  1. QComboBox prevents screensaver while opened
    By joelafrite in forum Qt Programming
    Replies: 0
    Last Post: 17th July 2013, 15:03
  2. Customize QPushButton and QComboBox
    By fruzzo in forum Qt Programming
    Replies: 1
    Last Post: 8th June 2012, 22:20
  3. QPushButton,Several unclicked clicks too many
    By thefatladysingsopera in forum Newbie
    Replies: 6
    Last Post: 16th August 2011, 10:51
  4. Replies: 2
    Last Post: 20th December 2010, 18:51
  5. QComboBox that stays expanded
    By jma in forum Qt Programming
    Replies: 2
    Last Post: 21st January 2009, 08:50

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.