From 773178900f39febb0509cb4170bc091c9f91d3b3 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Sun, 9 Jul 2017 16:55:03 +0200 Subject: Convert features.treeview to QT_[REQUIRE_]CONFIG Change-Id: I4a036a0410615ac563b17f7715c47acccb8abfca Reviewed-by: Oswald Buddenhagen --- src/widgets/widgets/qcombobox.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 84d81fa089..6a8167b5e5 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -56,7 +56,9 @@ #include #include #include +#if QT_CONFIG(treeview) #include +#endif #include #include #include @@ -2602,7 +2604,7 @@ void QComboBox::showPopup() int count = 0; QStack toCheck; toCheck.push(view()->rootIndex()); -#ifndef QT_NO_TREEVIEW +#if QT_CONFIG(treeview) QTreeView *treeView = qobject_cast(view()); if (treeView && treeView->header() && !treeView->header()->isHidden()) listHeight += treeView->header()->height(); @@ -2614,7 +2616,7 @@ void QComboBox::showPopup() if (!idx.isValid()) continue; listHeight += view()->visualRect(idx).height(); -#ifndef QT_NO_TREEVIEW +#if QT_CONFIG(treeview) if (d->model->hasChildren(idx) && treeView && treeView->isExpanded(idx)) toCheck.push(idx); #endif -- cgit v1.2.3 From 184d80f5a0d6764745ab77487620eb41679226f0 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Wed, 21 Jun 2017 10:49:59 +0200 Subject: QDialogButtonBox: Don't overwrite shortcut with standardButtonShortcut MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit de63bbd2f806b0219a60775017899cedb121581f introduced a new QPlatformTheme::standardButtonShortcut which would then unconditionally overwrite the QPushButton shortcut, even when empty, breaking activating mnemonics potentially included in the button's text. Task-number: QTBUG-61197 Change-Id: I2a5a460a820a5ab4054eb44f349066aaeca1436f Reviewed-by: Marco Martin Reviewed-by: Alexander Volkov Reviewed-by: Tor Arne Vestbø --- src/widgets/widgets/qdialogbuttonbox.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qdialogbuttonbox.cpp b/src/widgets/widgets/qdialogbuttonbox.cpp index a3e55114bb..90cb17da59 100644 --- a/src/widgets/widgets/qdialogbuttonbox.cpp +++ b/src/widgets/widgets/qdialogbuttonbox.cpp @@ -411,7 +411,9 @@ QPushButton *QDialogButtonBoxPrivate::createButton(QDialogButtonBox::StandardBut else addButton(button, static_cast(role), doLayout); #if QT_CONFIG(shortcut) - button->setShortcut(QGuiApplicationPrivate::platformTheme()->standardButtonShortcut(sbutton)); + const QKeySequence standardShortcut = QGuiApplicationPrivate::platformTheme()->standardButtonShortcut(sbutton); + if (!standardShortcut.isEmpty()) + button->setShortcut(standardShortcut); #endif return button; } -- cgit v1.2.3