Results 1 to 2 of 2

Thread: MouseButtonRelease only works once on Linux

  1. #1
    Join Date
    Dec 2019
    Posts
    7
    Thanks
    1
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default MouseButtonRelease only works once on Linux

    Hi,

    I have an event Filter for a comboBox. The issue I'm having is when I use mouseButtonRelease and select the drop down arrow, it only catches the signal if there is no data in the combo box. This is true only on Linux/MAC Linux. Once data is loaded the signal is not caught. On windows it works just fine.

    If I use MouseButtonPress then it always works but the dropdown bounces back up after I release the mouse button to make a selection. This is why I prefer to use MouseButtonRelease unless there is a better alternative.

    Any ideas?

    //Assign event filter to the comboBox
    ui->ipStringValueComboBox->installEventFilter(this);


    Further down:
    bool MainWindow::eventFilter(QObject *object, QEvent *event)
    {

    if(event->type() == QEvent::MouseButtonRelease)
    {
    if(object == ui->ipStringValueComboBox)
    IPComboBoxClicked();

    return true;
    }
    else
    return false;

    }

    void MainWindow::IPComboBoxClicked()
    {
    //do some stuff
    ui->ipStringValueComboBox->showPopup();

    }

    Thanks again.

  2. #2
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    860
    Thanks
    69
    Thanked 57 Times in 55 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: MouseButtonRelease only works once on Linux

    Hi,

    It will be easier to connect one of the QComboBox signals available to a slot.
    Òscar Llarch i Galán

Similar Threads

  1. Replies: 2
    Last Post: 18th November 2015, 14:57
  2. don't works on linux ?
    By 21did21 in forum Qwt
    Replies: 5
    Last Post: 5th September 2011, 10:28
  3. Works well on Windows but fails on Linux
    By utkuaydin in forum Qt Programming
    Replies: 3
    Last Post: 11th January 2010, 14:22
  4. Replies: 1
    Last Post: 4th November 2009, 23:14
  5. QPalette works differently on windows and linux
    By babu198649 in forum Newbie
    Replies: 3
    Last Post: 6th March 2008, 08:27

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.