summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r--src/widgets/widgets/qcombobox.cpp14
-rw-r--r--src/widgets/widgets/qlabel.cpp1
-rw-r--r--src/widgets/widgets/qmainwindow.cpp2
-rw-r--r--src/widgets/widgets/qmdisubwindow_p.h2
-rw-r--r--src/widgets/widgets/qmenu.h4
-rw-r--r--src/widgets/widgets/qsizegrip.cpp5
-rw-r--r--src/widgets/widgets/qtoolbar.h4
7 files changed, 18 insertions, 14 deletions
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index 52e7962109..4358e568bf 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -170,18 +170,18 @@ QStyleOptionMenuItem QComboMenuDelegate::getStyleOption(const QStyleOptionViewIt
menuOption.menuRect = option.rect;
menuOption.rect = option.rect;
- // Make sure fonts set on the combo box also overrides the font for the popup menu.
- if (mCombo->testAttribute(Qt::WA_SetFont)
+ // Make sure fonts set on the model or on the combo box, in
+ // that order, also override the font for the popup menu.
+ QVariant fontRoleData = index.data(Qt::FontRole);
+ if (fontRoleData.isValid()) {
+ menuOption.font = fontRoleData.value<QFont>();
+ } else if (mCombo->testAttribute(Qt::WA_SetFont)
|| mCombo->testAttribute(Qt::WA_MacSmallSize)
|| mCombo->testAttribute(Qt::WA_MacMiniSize)
|| mCombo->font() != qt_app_fonts_hash()->value("QComboBox", QFont())) {
menuOption.font = mCombo->font();
} else {
- QVariant fontRoleData = index.data(Qt::FontRole);
- if (fontRoleData.isValid())
- menuOption.font = fontRoleData.value<QFont>();
- else
- menuOption.font = qt_app_fonts_hash()->value("QComboMenuItem", mCombo->font());
+ menuOption.font = qt_app_fonts_hash()->value("QComboMenuItem", mCombo->font());
}
menuOption.fontMetrics = QFontMetrics(menuOption.font);
diff --git a/src/widgets/widgets/qlabel.cpp b/src/widgets/widgets/qlabel.cpp
index 76713d9880..fa0cff45c9 100644
--- a/src/widgets/widgets/qlabel.cpp
+++ b/src/widgets/widgets/qlabel.cpp
@@ -583,6 +583,7 @@ QSize QLabelPrivate::sizeForWidth(int w) const
#ifndef QT_NO_MOVIE
} else if (movie && !movie->currentPixmap().isNull()) {
br = movie->currentPixmap().rect();
+ br.setSize(br.size() / movie->currentPixmap().devicePixelRatio());
#endif
} else if (isTextLabel) {
int align = QStyle::visualAlignment(textDirection(), QFlag(this->align));
diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp
index e32e379198..abfdfbea9b 100644
--- a/src/widgets/widgets/qmainwindow.cpp
+++ b/src/widgets/widgets/qmainwindow.cpp
@@ -326,7 +326,7 @@ void QMainWindowPrivate::init()
direction.
Two dock widgets may also be stacked on top of each other. A
- QTabBar is then used to select which of the widgets that should be
+ QTabBar is then used to select which of the widgets should be
displayed.
We give an example of how to create and add dock widgets to a
diff --git a/src/widgets/widgets/qmdisubwindow_p.h b/src/widgets/widgets/qmdisubwindow_p.h
index 46a8e99d0a..650d3b0bfb 100644
--- a/src/widgets/widgets/qmdisubwindow_p.h
+++ b/src/widgets/widgets/qmdisubwindow_p.h
@@ -211,7 +211,7 @@ public:
Qt::FocusReason focusInReason;
OperationInfoMap operationMap;
QPointer<QMenu> systemMenu;
-#ifndef QT_NO_ACTIONS
+#ifndef QT_NO_ACTION
QPointer<QAction> actions[NumWindowStateActions];
#endif
QMdiSubWindow::SubWindowOptions options;
diff --git a/src/widgets/widgets/qmenu.h b/src/widgets/widgets/qmenu.h
index bcbd0a95c4..5d218ac1ba 100644
--- a/src/widgets/widgets/qmenu.h
+++ b/src/widgets/widgets/qmenu.h
@@ -98,7 +98,7 @@ public:
#else
// addAction(QString): Connect to a QObject slot / functor or function pointer (with context)
template<class Obj, typename Func1>
- inline typename QtPrivate::QEnableIf<!QtPrivate::is_same<const char*, Func1>::value
+ inline typename QtPrivate::QEnableIf<!std::is_same<const char*, Func1>::value
&& QtPrivate::IsPointerToTypeDerivedFromQObject<Obj*>::Value, QAction *>::Type
addAction(const QString &text, const Obj *object, Func1 slot, const QKeySequence &shortcut = 0)
{
@@ -126,7 +126,7 @@ public:
}
// addAction(QIcon, QString): Connect to a QObject slot / functor or function pointer (with context)
template<class Obj, typename Func1>
- inline typename QtPrivate::QEnableIf<!QtPrivate::is_same<const char*, Func1>::value
+ inline typename QtPrivate::QEnableIf<!std::is_same<const char*, Func1>::value
&& QtPrivate::IsPointerToTypeDerivedFromQObject<Obj*>::Value, QAction *>::Type
addAction(const QIcon &actionIcon, const QString &text, const Obj *object, Func1 slot, const QKeySequence &shortcut = 0)
{
diff --git a/src/widgets/widgets/qsizegrip.cpp b/src/widgets/widgets/qsizegrip.cpp
index 5150601366..82857c8805 100644
--- a/src/widgets/widgets/qsizegrip.cpp
+++ b/src/widgets/widgets/qsizegrip.cpp
@@ -184,9 +184,12 @@ Qt::Corner QSizeGripPrivate::corner() const
Put this widget anywhere in a widget tree and the user can use it
to resize the top-level window or any widget with the Qt::SubWindow
flag set. Generally, this should be in the lower right-hand corner.
+
Note that QStatusBar already uses this widget, so if you have a
status bar (e.g., you are using QMainWindow), then you don't need
- to use this widget explicitly.
+ to use this widget explicitly. The same goes for QDialog, for which
+ you can just call \l {QDialog::setSizeGripEnabled()}
+ {QDialog::setSizeGripEnabled()}.
On some platforms the size grip automatically hides itself when the
window is shown full screen or maximised.
diff --git a/src/widgets/widgets/qtoolbar.h b/src/widgets/widgets/qtoolbar.h
index d361513bbf..0ea4d4afeb 100644
--- a/src/widgets/widgets/qtoolbar.h
+++ b/src/widgets/widgets/qtoolbar.h
@@ -116,7 +116,7 @@ public:
#else
// addAction(QString): Connect to a QObject slot / functor or function pointer (with context)
template<class Obj, typename Func1>
- inline typename QtPrivate::QEnableIf<!QtPrivate::is_same<const char*, Func1>::value
+ inline typename QtPrivate::QEnableIf<!std::is_same<const char*, Func1>::value
&& QtPrivate::IsPointerToTypeDerivedFromQObject<Obj*>::Value, QAction *>::Type
addAction(const QString &text, const Obj *object, Func1 slot)
{
@@ -134,7 +134,7 @@ public:
}
// addAction(QString): Connect to a QObject slot / functor or function pointer (with context)
template<class Obj, typename Func1>
- inline typename QtPrivate::QEnableIf<!QtPrivate::is_same<const char*, Func1>::value
+ inline typename QtPrivate::QEnableIf<!std::is_same<const char*, Func1>::value
&& QtPrivate::IsPointerToTypeDerivedFromQObject<Obj*>::Value, QAction *>::Type
addAction(const QIcon &actionIcon, const QString &text, const Obj *object, Func1 slot)
{