From 94ce6853c1a279622daf22455bfd2a8637fdd94b Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 22 Oct 2019 14:10:04 +0300 Subject: [PATCH] Fix widget order in import dialog so spinboxes can receive mouse focus The label needs to be created before the spinbox or the label will block the spinbox mouse events, as the tail end of the labels overlaps the non-checkbox control column to avoid unnecessary cutoff of the labels that do not have any non-checkbox controls. Change-Id: If7a7fd671b0dbb3f4c1ab5570217455e4978765e Reviewed-by: Thomas Hartmann Reviewed-by: Mahmoud Badri --- .../itemlibrary/itemlibraryassetimportdialog.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimportdialog.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimportdialog.cpp index bfdbfe5c224..d7f84fddd10 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimportdialog.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimportdialog.cpp @@ -298,6 +298,10 @@ void ItemLibraryAssetImportDialog::createTab(const QString &tabLabel, int option QJsonValue optValue = optObj.value("value"); QJsonArray conditions = optObj.value("conditions").toArray(); + auto *optLabel = new QLabel(optionsAreaContents); + optLabel->setText(optName); + optLabel->setToolTip(optDesc); + QWidget *optControl = nullptr; if (optType == "Boolean") { auto *optCheck = new QCheckBox(optionsAreaContents); @@ -346,15 +350,11 @@ void ItemLibraryAssetImportDialog::createTab(const QString &tabLabel, int option qWarning() << __FUNCTION__ << "Unsupported option type:" << optType; continue; } + optControl->setToolTip(optDesc); if (!conditions.isEmpty()) conditionMap.insert(optKey, conditions); - auto *optLabel = new QLabel(optionsAreaContents); - optLabel->setText(optName); - optLabel->setToolTip(optDesc); - optControl->setToolTip(optDesc); - const QString &groupName = optionToGroupMap.value(optKey); if (!groupName.isEmpty() && groupIndexMap.contains(groupName)) widgets[groupIndexMap[groupName]].append({optLabel, optControl});