Bug: MapQuickView / SceneQuickView mousePressedAndHeld always sends Qt::LeftButton even if Qt::RightButton is held

90
1
Jump to solution
2 weeks ago
Labels (3)
radimbachb
New Contributor III

When connecting to a MapQuickView / SceneQuickView mousePressedAndHeld signal the QMouseEvent's button() property is always Qt::LeftButton, even though the held down button might be a different one.

This code

QObject::connect(view, &MapQuickView::mousePressed, this, [](const auto& mouseEvent) {
	qDebug() << "mousePressed:" << mouseEvent.button();
});
QObject::connect(view, &MapQuickView::mouseReleased, this, [](const auto& mouseEvent) {
	qDebug() << "mouseReleased:" << mouseEvent.button();
});
QObject::connect(view, &MapQuickView::mousePressedAndHeld, this, [](const auto& mouseEvent) {
	qDebug() << "mousePressedAndHeld:" << mouseEvent.button();
});

prints the following lines when clicking Qt::RightButton and Qt::MiddleButton

mousePressed: Qt::RightButton
mousePressedAndHeld: Qt::LeftButton
mouseReleased: Qt::RightButton
mousePressed: Qt::MiddleButton
mousePressedAndHeld: Qt::LeftButton
mouseReleased: Qt::MiddleButton

So no matter which button is actually pressed and held, the event always only contains the Qt::LeftButton.

We are using the 200.4 release of ArcGIS Maps SDK for Qt.

This looks like a bug to me, or are we misunderstanding mousePressedAndHeld? With this implementation we won't be able to differentiate between different buttons being pressed and held.

0 Kudos
1 Solution

Accepted Solutions
bnoble0110
Esri Contributor

Hello @radimbachb

You're right, this is a bug. We've logged an issue for this, thanks for pointing it out. 

View solution in original post

0 Kudos
1 Reply
bnoble0110
Esri Contributor

Hello @radimbachb

You're right, this is a bug. We've logged an issue for this, thanks for pointing it out. 

0 Kudos