mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 14:08:37 +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
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QMouseEvent>
|
||||
|
||||
constexpr auto qstr = QString::fromStdString;
|
||||
|
||||
|
|
@ -188,8 +189,11 @@ void breakpoint_list::HandleBreakpointRequest(u32 loc, bool only_add)
|
|||
|
||||
void breakpoint_list::OnBreakpointListDoubleClicked()
|
||||
{
|
||||
const u32 address = currentItem()->data(Qt::UserRole).value<u32>();
|
||||
Q_EMIT RequestShowAddress(address);
|
||||
if (QListWidgetItem* item = currentItem())
|
||||
{
|
||||
const u32 address = item->data(Qt::UserRole).value<u32>();
|
||||
Q_EMIT RequestShowAddress(address);
|
||||
}
|
||||
}
|
||||
|
||||
void breakpoint_list::OnBreakpointListRightClicked(const QPoint &pos)
|
||||
|
|
@ -231,3 +235,18 @@ void breakpoint_list::OnBreakpointListDelete()
|
|||
m_context_menu->close();
|
||||
}
|
||||
}
|
||||
|
||||
void breakpoint_list::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;
|
||||
}
|
||||
|
||||
QListWidget::mouseDoubleClickEvent(ev);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue