forked from qt-creator/qt-creator
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 <thomas.hartmann@qt.io> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -298,6 +298,10 @@ void ItemLibraryAssetImportDialog::createTab(const QString &tabLabel, int option
|
|||||||
QJsonValue optValue = optObj.value("value");
|
QJsonValue optValue = optObj.value("value");
|
||||||
QJsonArray conditions = optObj.value("conditions").toArray();
|
QJsonArray conditions = optObj.value("conditions").toArray();
|
||||||
|
|
||||||
|
auto *optLabel = new QLabel(optionsAreaContents);
|
||||||
|
optLabel->setText(optName);
|
||||||
|
optLabel->setToolTip(optDesc);
|
||||||
|
|
||||||
QWidget *optControl = nullptr;
|
QWidget *optControl = nullptr;
|
||||||
if (optType == "Boolean") {
|
if (optType == "Boolean") {
|
||||||
auto *optCheck = new QCheckBox(optionsAreaContents);
|
auto *optCheck = new QCheckBox(optionsAreaContents);
|
||||||
@@ -346,15 +350,11 @@ void ItemLibraryAssetImportDialog::createTab(const QString &tabLabel, int option
|
|||||||
qWarning() << __FUNCTION__ << "Unsupported option type:" << optType;
|
qWarning() << __FUNCTION__ << "Unsupported option type:" << optType;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
optControl->setToolTip(optDesc);
|
||||||
|
|
||||||
if (!conditions.isEmpty())
|
if (!conditions.isEmpty())
|
||||||
conditionMap.insert(optKey, conditions);
|
conditionMap.insert(optKey, conditions);
|
||||||
|
|
||||||
auto *optLabel = new QLabel(optionsAreaContents);
|
|
||||||
optLabel->setText(optName);
|
|
||||||
optLabel->setToolTip(optDesc);
|
|
||||||
optControl->setToolTip(optDesc);
|
|
||||||
|
|
||||||
const QString &groupName = optionToGroupMap.value(optKey);
|
const QString &groupName = optionToGroupMap.value(optKey);
|
||||||
if (!groupName.isEmpty() && groupIndexMap.contains(groupName))
|
if (!groupName.isEmpty() && groupIndexMap.contains(groupName))
|
||||||
widgets[groupIndexMap[groupName]].append({optLabel, optControl});
|
widgets[groupIndexMap[groupName]].append({optLabel, optControl});
|
||||||
|
Reference in New Issue
Block a user