Gui: Allow long press timeout for Clarify Selection to be configurable

This commit is contained in:
tetektoza
2025-09-05 02:05:52 +02:00
parent c67d9c529c
commit d3ce061d5e

View File

@@ -234,7 +234,6 @@ class Gui::ViewerEventFilter : public QObject
public:
ViewerEventFilter() : longPressTimer(new QTimer(this)) {
longPressTimer->setSingleShot(true);
longPressTimer->setInterval(1000); // after 1s of LMB press on viewport it gets toggled
connect(longPressTimer, &QTimer::timeout, [this]() {
if (currentViewer) {
triggerClarifySelection();
@@ -300,6 +299,11 @@ public:
if (mouseEvent->button() == Qt::LeftButton) {
currentViewer = static_cast<View3DInventorViewer*>(obj);
pressPosition = mouseEvent->pos();
int longPressTimeout = App::GetApplication()
.GetParameterGroupByPath("User parameter:BaseApp/Preferences/View")
->GetInt("LongPressTimeout", 1000);
longPressTimer->setInterval(longPressTimeout);
longPressTimer->start();
}
}