mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-19 13:25:14 +00:00
Qt: ignore double clicks unless they are left clicks
This commit is contained in:
parent
e56164f1e3
commit
fbebdc09b7
16 changed files with 152 additions and 11 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#include <QRegularExpressionValidator>
|
||||
#include <QInputDialog>
|
||||
#include <QKeyEvent>
|
||||
#include <QMouseEvent>
|
||||
#include <QEvent>
|
||||
#include <QScreen>
|
||||
#include <QHeaderView>
|
||||
|
|
@ -496,3 +497,18 @@ bool user_manager_dialog::eventFilter(QObject *object, QEvent *event)
|
|||
|
||||
return QDialog::eventFilter(object, event);
|
||||
}
|
||||
|
||||
void user_manager_dialog::mouseDoubleClickEvent(QMouseEvent* ev)
|
||||
{
|
||||
if (!ev) return;
|
||||
|
||||
// Qt's itemDoubleClicked signal doesn't distinguish between mouse buttons and there is no simple way to get the pressed button.
|
||||
// So we have to ignore this event when another button is pressed.
|
||||
if (ev->button() != Qt::LeftButton)
|
||||
{
|
||||
ev->ignore();
|
||||
return;
|
||||
}
|
||||
|
||||
QDialog::mouseDoubleClickEvent(ev);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue