diff options
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r-- | src/widgets/widgets/qcombobox.cpp | 6 | ||||
-rw-r--r-- | src/widgets/widgets/qdialogbuttonbox.cpp | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 90dfbe1633..1259c236e4 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -56,7 +56,9 @@ #include <qevent.h> #include <qlayout.h> #include <qscrollbar.h> +#if QT_CONFIG(treeview) #include <qtreeview.h> +#endif #include <qheaderview.h> #include <qmath.h> #include <qmetaobject.h> @@ -2619,7 +2621,7 @@ void QComboBox::showPopup() int count = 0; QStack<QModelIndex> toCheck; toCheck.push(view()->rootIndex()); -#ifndef QT_NO_TREEVIEW +#if QT_CONFIG(treeview) QTreeView *treeView = qobject_cast<QTreeView*>(view()); if (treeView && treeView->header() && !treeView->header()->isHidden()) listHeight += treeView->header()->height(); @@ -2631,7 +2633,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 diff --git a/src/widgets/widgets/qdialogbuttonbox.cpp b/src/widgets/widgets/qdialogbuttonbox.cpp index ad16acb96c..788ec67fb2 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<QDialogButtonBox::ButtonRole>(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; } |