summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/dialogs/qcolordialog.h1
-rw-r--r--src/widgets/dialogs/qdialog.cpp36
-rw-r--r--src/widgets/dialogs/qdialog.h1
-rw-r--r--src/widgets/dialogs/qdialog_p.h4
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp8
-rw-r--r--src/widgets/dialogs/qfiledialog.h1
-rw-r--r--src/widgets/dialogs/qfiledialog_p.h20
-rw-r--r--src/widgets/dialogs/qfontdialog.h3
-rw-r--r--src/widgets/dialogs/qfontdialog_p.h2
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp2
-rw-r--r--src/widgets/dialogs/qwizard_win.cpp2
-rw-r--r--src/widgets/itemviews/qheaderview.cpp29
-rw-r--r--src/widgets/itemviews/qheaderview.h4
-rw-r--r--src/widgets/itemviews/qitemdelegate.cpp3
-rw-r--r--src/widgets/itemviews/qstyleditemdelegate.cpp3
-rw-r--r--src/widgets/kernel/kernel.pri2
-rw-r--r--src/widgets/kernel/qapplication.cpp23
-rw-r--r--src/widgets/kernel/qapplication_p.h12
-rw-r--r--src/widgets/kernel/qapplication_qpa.cpp73
-rw-r--r--src/widgets/kernel/qicon.cpp28
-rw-r--r--src/widgets/kernel/qiconloader.cpp4
-rw-r--r--src/widgets/kernel/qplatformmenu.h (renamed from src/widgets/kernel/qplatformmenu_qpa.h)0
-rw-r--r--src/widgets/kernel/qplatformmenu_qpa.cpp2
-rw-r--r--src/widgets/kernel/qwhatsthis.cpp2
-rw-r--r--src/widgets/kernel/qwidget.cpp28
-rw-r--r--src/widgets/kernel/qwidget_p.h3
-rw-r--r--src/widgets/kernel/qwidget_qpa.cpp80
-rw-r--r--src/widgets/kernel/qwidgetwindow_qpa.cpp21
-rw-r--r--src/widgets/styles/qcommonstyle.cpp2
-rw-r--r--src/widgets/styles/qgtkstyle_p.h2
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm2
-rw-r--r--src/widgets/styles/qstylefactory.cpp17
-rw-r--r--src/widgets/styles/qwindowsvistastyle.cpp2
-rw-r--r--src/widgets/styles/qwindowsxpstyle.cpp4
-rw-r--r--src/widgets/util/qsystemtrayicon_win.cpp2
-rw-r--r--src/widgets/util/qsystemtrayicon_x11.cpp2
-rw-r--r--src/widgets/widgets/qcalendarwidget.cpp4
-rw-r--r--src/widgets/widgets/qcombobox.cpp2
-rw-r--r--src/widgets/widgets/qmenu.cpp4
-rw-r--r--src/widgets/widgets/qmenu_p.h2
-rw-r--r--src/widgets/widgets/qmenubar.cpp2
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol.cpp2
42 files changed, 242 insertions, 204 deletions
diff --git a/src/widgets/dialogs/qcolordialog.h b/src/widgets/dialogs/qcolordialog.h
index 1daead3879..9e8e56e927 100644
--- a/src/widgets/dialogs/qcolordialog.h
+++ b/src/widgets/dialogs/qcolordialog.h
@@ -124,7 +124,6 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_newColorTypedIn(QRgb rgb))
Q_PRIVATE_SLOT(d_func(), void _q_newCustom(int, int))
Q_PRIVATE_SLOT(d_func(), void _q_newStandard(int, int))
- Q_PRIVATE_SLOT(d_func(), void _q_platformRunNativeAppModalPanel())
friend class QColorShower;
};
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp
index 9410a9b62b..dbe5da8ed4 100644
--- a/src/widgets/dialogs/qdialog.cpp
+++ b/src/widgets/dialogs/qdialog.cpp
@@ -52,10 +52,10 @@
#include "qwhatsthis.h"
#include "qmenu.h"
#include "qcursor.h"
-#include "qplatformtheme_qpa.h"
+#include <qpa/qplatformtheme.h>
#include "private/qdialog_p.h"
#include "private/qguiapplication_p.h"
-#include "qplatformtheme_qpa.h"
+#include <qpa/qplatformtheme.h>
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
@@ -88,8 +88,6 @@ QPlatformDialogHelper *QDialogPrivate::platformHelper() const
if (m_platformHelper) {
QObject::connect(m_platformHelper, SIGNAL(accept()), dialog, SLOT(accept()));
QObject::connect(m_platformHelper, SIGNAL(reject()), dialog, SLOT(reject()));
- QObject::connect(m_platformHelper, SIGNAL(launchNativeAppModalPanel()),
- dialog, SLOT(_q_platformRunNativeAppModalPanel()));
ncThis->initHelper(m_platformHelper);
}
}
@@ -118,13 +116,6 @@ bool QDialogPrivate::setNativeDialogVisible(bool visible)
return nativeDialogInUse;
}
-void QDialogPrivate::_q_platformRunNativeAppModalPanel()
-{
- if (nativeDialogInUse)
- platformHelper()->_q_platformRunNativeAppModalPanel();
-}
-
-
QVariant QDialogPrivate::styleHint(QPlatformDialogHelper::StyleHint hint) const
{
if (const QPlatformDialogHelper *helper = platformHelper())
@@ -132,6 +123,14 @@ QVariant QDialogPrivate::styleHint(QPlatformDialogHelper::StyleHint hint) const
return QPlatformDialogHelper::defaultStyleHint(hint);
}
+void QDialogPrivate::deleteNativeDialog()
+{
+ if (QPlatformDialogHelper *helper = platformHelper()) {
+ helper->deleteNativeDialog_sys();
+ nativeDialogInUse = false;
+ }
+}
+
/*!
\class QDialog
\brief The QDialog class is the base class of dialog windows.
@@ -328,6 +327,7 @@ QDialog::QDialog(QDialogPrivate &dd, QWidget *parent, Qt::WindowFlags f)
QDialog::~QDialog()
{
+ Q_D(QDialog);
QT_TRY {
// Need to hide() here, as our (to-be) overridden hide()
// will not be called in ~QWidget.
@@ -335,6 +335,7 @@ QDialog::~QDialog()
} QT_CATCH(...) {
// we're in the destructor - just swallow the exception
}
+ d->deleteNativeDialog();
}
/*!
@@ -525,13 +526,14 @@ int QDialog::exec()
}
show();
- if (d->nativeDialogInUse)
- d->platformHelper()->platformNativeDialogModalHelp();
-
- QEventLoop eventLoop;
- d->eventLoop = &eventLoop;
QPointer<QDialog> guard = this;
- (void) eventLoop.exec(QEventLoop::DialogExec);
+ if (d->nativeDialogInUse) {
+ d->platformHelper()->exec_sys();
+ } else {
+ QEventLoop eventLoop;
+ d->eventLoop = &eventLoop;
+ (void) eventLoop.exec(QEventLoop::DialogExec);
+ }
if (guard.isNull())
return QDialog::Rejected;
d->eventLoop = 0;
diff --git a/src/widgets/dialogs/qdialog.h b/src/widgets/dialogs/qdialog.h
index f20ff46d41..29a5a724d5 100644
--- a/src/widgets/dialogs/qdialog.h
+++ b/src/widgets/dialogs/qdialog.h
@@ -117,7 +117,6 @@ protected:
private:
Q_DECLARE_PRIVATE(QDialog)
Q_DISABLE_COPY(QDialog)
- Q_PRIVATE_SLOT(d_func(), void _q_platformRunNativeAppModalPanel())
#ifdef Q_OS_WINCE_WM
Q_PRIVATE_SLOT(d_func(), void _q_doneAction())
diff --git a/src/widgets/dialogs/qdialog_p.h b/src/widgets/dialogs/qdialog_p.h
index c40a885f86..3b8a5edb0f 100644
--- a/src/widgets/dialogs/qdialog_p.h
+++ b/src/widgets/dialogs/qdialog_p.h
@@ -58,7 +58,7 @@
#include "QtCore/qpointer.h"
#include "QtWidgets/qdialog.h"
#include "QtWidgets/qpushbutton.h"
-#include <QtGui/QPlatformDialogHelper>
+#include <qpa/qplatformdialoghelper.h>
QT_BEGIN_NAMESPACE
@@ -79,11 +79,11 @@ public:
nativeDialogInUse(false), m_platformHelper(0), m_platformHelperCreated(false)
{}
~QDialogPrivate() { delete m_platformHelper; }
- void _q_platformRunNativeAppModalPanel();
QWindow *parentWindow() const;
bool setNativeDialogVisible(bool visible);
QVariant styleHint(QPlatformDialogHelper::StyleHint hint) const;
+ void deleteNativeDialog();
QPointer<QPushButton> mainDef;
Qt::Orientation orientation;
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 43bb164366..a87d811d30 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -362,13 +362,11 @@ QFileDialog::QFileDialog(const QFileDialogArgs &args)
*/
QFileDialog::~QFileDialog()
{
- Q_D(QFileDialog);
#ifndef QT_NO_SETTINGS
QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
settings.beginGroup(QLatin1String("Qt"));
settings.setValue(QLatin1String("filedialog"), saveState());
#endif
- d->deleteNativeDialog_sys();
}
/*!
@@ -1372,10 +1370,10 @@ void QFileDialog::setAcceptMode(QFileDialog::AcceptMode mode)
d->qFileDialogUi->lookInCombo->setEditable(false);
}
d->retranslateWindowTitle();
-#if defined(Q_OS_MAC)
- d->deleteNativeDialog_sys();
+ // we need to recreate the native dialog when changing the AcceptMode
+ d->deleteNativeDialog();
+ // clear WA_DontShowOnScreen so that d->canBeNativeDialog() doesn't return false incorrectly
setAttribute(Qt::WA_DontShowOnScreen, false);
-#endif
}
/*
diff --git a/src/widgets/dialogs/qfiledialog.h b/src/widgets/dialogs/qfiledialog.h
index c5298b1227..ee4ae72519 100644
--- a/src/widgets/dialogs/qfiledialog.h
+++ b/src/widgets/dialogs/qfiledialog.h
@@ -252,7 +252,6 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_rowsInserted(const QModelIndex & parent))
Q_PRIVATE_SLOT(d_func(), void _q_fileRenamed(const QString &path,
const QString oldName, const QString newName))
- Q_PRIVATE_SLOT(d_func(), void _q_platformRunNativeAppModalPanel())
friend class QPlatformDialogHelper;
};
diff --git a/src/widgets/dialogs/qfiledialog_p.h b/src/widgets/dialogs/qfiledialog_p.h
index a66ee757f6..0132d4ba6f 100644
--- a/src/widgets/dialogs/qfiledialog_p.h
+++ b/src/widgets/dialogs/qfiledialog_p.h
@@ -244,8 +244,6 @@ public:
// dialog. Returning false means that a non-native dialog must be
// used instead.
bool canBeNativeDialog();
- void deleteNativeDialog_sys();
- QDialog::DialogCode dialogResultCode_sys();
void setDirectory_sys(const QString &directory);
QString directory_sys() const;
@@ -347,24 +345,6 @@ inline QString QFileDialogPrivate::rootPath() const {
return model->rootPath();
}
-// Dummies for platforms that don't use native dialogs:
-inline void QFileDialogPrivate::deleteNativeDialog_sys()
-{
- if (QPlatformFileDialogHelper *helper = platformFileDialogHelper()) {
- helper->deleteNativeDialog_sys();
- nativeDialogInUse = false;
- }
-}
-
-inline QDialog::DialogCode QFileDialogPrivate::dialogResultCode_sys()
-{
- QDialog::DialogCode result = QDialog::Rejected;
- if (QPlatformDialogHelper *helper = platformHelper())
- if (helper->dialogResultCode_sys() == QPlatformDialogHelper::Accepted)
- result = QDialog::Accepted;
- return result;
-}
-
inline void QFileDialogPrivate::setDirectory_sys(const QString &directory)
{
if (QPlatformFileDialogHelper *helper = platformFileDialogHelper())
diff --git a/src/widgets/dialogs/qfontdialog.h b/src/widgets/dialogs/qfontdialog.h
index c5f654a50a..979293c234 100644
--- a/src/widgets/dialogs/qfontdialog.h
+++ b/src/widgets/dialogs/qfontdialog.h
@@ -118,9 +118,6 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_styleHighlighted(int))
Q_PRIVATE_SLOT(d_func(), void _q_sizeHighlighted(int))
Q_PRIVATE_SLOT(d_func(), void _q_updateSample())
-#if defined(Q_WS_MAC)
- Q_PRIVATE_SLOT(d_func(), void _q_macRunNativeAppModalPanel())
-#endif
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QFontDialog::FontDialogOptions)
diff --git a/src/widgets/dialogs/qfontdialog_p.h b/src/widgets/dialogs/qfontdialog_p.h
index 75a9045d2b..e7b0e91340 100644
--- a/src/widgets/dialogs/qfontdialog_p.h
+++ b/src/widgets/dialogs/qfontdialog_p.h
@@ -57,7 +57,7 @@
#include "private/qdialog_p.h"
#include "qfontdatabase.h"
#include "qfontdialog.h"
-#include "qplatformdialoghelper_qpa.h"
+#include <qpa/qplatformdialoghelper.h>
#include "qsharedpointer.h"
#ifndef QT_NO_FONTDIALOG
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index 5c1a2a4a64..cb32de4bca 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -67,7 +67,7 @@
#ifdef Q_OS_WIN
# include <QtCore/qt_windows.h>
-# include <QtGui/QPlatformNativeInterface>
+#include <qpa/qplatformnativeinterface.h>
#endif
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp
index 49450be75b..3e0aedcabc 100644
--- a/src/widgets/dialogs/qwizard_win.cpp
+++ b/src/widgets/dialogs/qwizard_win.cpp
@@ -45,7 +45,7 @@
#include "qwizard_win_p.h"
#include <private/qsystemlibrary_p.h>
#include <private/qapplication_p.h>
-#include "qplatformnativeinterface_qpa.h"
+#include <qpa/qplatformnativeinterface.h>
#include "qwizard.h"
#include "qpaintengine.h"
#include "qapplication.h"
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index 9b6b2368c9..4ab984b53c 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -122,7 +122,7 @@ QDataStream &operator>>(QDataStream &in, QHeaderViewPrivate::SectionItem &sectio
A header can be fixed in place, or made movable with setSectionsMovable(). It can
be made clickable with setSectionsClickable(), and has resizing behavior in
- accordance with setResizeMode() and setSectionResizeMode()
+ accordance with setSectionResizeMode()
\note Double-clicking on a header to resize a section only applies for
visible rows.
@@ -162,7 +162,7 @@ QDataStream &operator>>(QDataStream &in, QHeaderViewPrivate::SectionItem &sectio
The resize mode specifies the behavior of the header sections. It can be
set on the entire header view or on individual sections using
- setResizeMode().
+ setSectionResizeMode().
\value Interactive The user can resize the section. The section can also be
resized programmatically using resizeSection(). The section size
@@ -501,7 +501,7 @@ void QHeaderView::setOffsetToLastSection()
/*!
Returns the length along the orientation of the header.
- \sa sizeHint(), setResizeMode(), offset()
+ \sa sizeHint(), setSectionResizeMode(), offset()
*/
int QHeaderView::length() const
@@ -625,7 +625,7 @@ int QHeaderView::logicalIndexAt(int position) const
Returns the width (or height for vertical headers) of the given
\a logicalIndex.
- \sa length(), setResizeMode(), defaultSectionSize()
+ \sa length(), setSectionResizeMode(), defaultSectionSize()
*/
int QHeaderView::sectionSize(int logicalIndex) const
@@ -1186,7 +1186,7 @@ bool QHeaderView::highlightSections() const
\sa resizeMode(), length(), sectionResized()
*/
-void QHeaderView::setResizeMode(ResizeMode mode)
+void QHeaderView::setSectionResizeMode(ResizeMode mode)
{
Q_D(QHeaderView);
initializeSections();
@@ -1243,10 +1243,19 @@ void QHeaderView::setSectionResizeMode(int logicalIndex, ResizeMode mode)
*/
/*!
+ \obsolete
+ \fn void QHeaderView::setResizeMode(ResizeMode mode)
+
+ Use setSectionResizeMode instead.
+
+ \sa setSectionResizeMode()
+*/
+
+/*!
Returns the resize mode that applies to the section specified by the given
\a logicalIndex.
- \sa setResizeMode()
+ \sa setSectionResizeMode()
*/
QHeaderView::ResizeMode QHeaderView::sectionResizeMode(int logicalIndex) const
@@ -1396,7 +1405,7 @@ Qt::SortOrder QHeaderView::sortIndicatorOrder() const
property will override the resize mode set on the last section in the
header.
- \sa setResizeMode()
+ \sa setSectionResizeMode()
*/
bool QHeaderView::stretchLastSection() const
{
@@ -1428,7 +1437,7 @@ void QHeaderView::setStretchLastSection(bool stretch)
The default value is false.
- \sa setResizeMode()
+ \sa setSectionResizeMode()
*/
bool QHeaderView::cascadingSectionResizes() const
{
@@ -1449,7 +1458,7 @@ void QHeaderView::setCascadingSectionResizes(bool enable)
This property only affects sections that have \l Interactive or \l Fixed
as their resize mode.
- \sa setResizeMode() minimumSectionSize
+ \sa setSectionResizeMode() minimumSectionSize
*/
int QHeaderView::defaultSectionSize() const
{
@@ -1475,7 +1484,7 @@ void QHeaderView::setDefaultSectionSize(int size)
This property is honored by all \l{ResizeMode}{resize modes}.
- \sa setResizeMode() defaultSectionSize
+ \sa setSectionResizeMode() defaultSectionSize
*/
int QHeaderView::minimumSectionSize() const
{
diff --git a/src/widgets/itemviews/qheaderview.h b/src/widgets/itemviews/qheaderview.h
index 0cea318953..f3f5b95a04 100644
--- a/src/widgets/itemviews/qheaderview.h
+++ b/src/widgets/itemviews/qheaderview.h
@@ -131,10 +131,12 @@ public:
void setHighlightSections(bool highlight);
bool highlightSections() const;
- void setResizeMode(ResizeMode mode);
ResizeMode sectionResizeMode(int logicalIndex) const;
+ void setSectionResizeMode(ResizeMode mode);
void setSectionResizeMode(int logicalIndex, ResizeMode mode);
#if QT_DEPRECATED_SINCE(5, 0)
+ inline QT_DEPRECATED void setResizeMode(ResizeMode mode)
+ { setSectionResizeMode(mode); }
inline QT_DEPRECATED void setResizeMode(int logicalindex, ResizeMode mode)
{ setSectionResizeMode(logicalindex, mode); }
inline QT_DEPRECATED ResizeMode resizeMode(int logicalindex) const
diff --git a/src/widgets/itemviews/qitemdelegate.cpp b/src/widgets/itemviews/qitemdelegate.cpp
index 68d31c7dd2..f5700746b8 100644
--- a/src/widgets/itemviews/qitemdelegate.cpp
+++ b/src/widgets/itemviews/qitemdelegate.cpp
@@ -44,7 +44,8 @@
#ifndef QT_NO_ITEMVIEWS
#include <qabstractitemmodel.h>
#include <qapplication.h>
-#include <qplatformintegration_qpa.h>
+#include <qpa/qplatformintegration.h>
+#include <qpa/qplatformdrag.h>
#include <private/qguiapplication_p.h>
#include <qbrush.h>
#include <qlineedit.h>
diff --git a/src/widgets/itemviews/qstyleditemdelegate.cpp b/src/widgets/itemviews/qstyleditemdelegate.cpp
index fc2d18a459..fce80341e1 100644
--- a/src/widgets/itemviews/qstyleditemdelegate.cpp
+++ b/src/widgets/itemviews/qstyleditemdelegate.cpp
@@ -44,7 +44,8 @@
#ifndef QT_NO_ITEMVIEWS
#include <qabstractitemmodel.h>
#include <qapplication.h>
-#include <qplatformintegration_qpa.h>
+#include <qpa/qplatformintegration.h>
+#include <qpa/qplatformdrag.h>
#include <private/qguiapplication_p.h>
#include <qbrush.h>
#include <qlineedit.h>
diff --git a/src/widgets/kernel/kernel.pri b/src/widgets/kernel/kernel.pri
index 97430babd3..9e3d82ea12 100644
--- a/src/widgets/kernel/kernel.pri
+++ b/src/widgets/kernel/kernel.pri
@@ -42,7 +42,7 @@ HEADERS += \
kernel/qsoftkeymanager_common_p.h \
kernel/qdesktopwidget_qpa_p.h \
kernel/qwidgetwindow_qpa_p.h \
- kernel/qplatformmenu_qpa.h
+ kernel/qplatformmenu.h
SOURCES += \
kernel/qaction.cpp \
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 381aa29eba..60328c4cf6 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -72,7 +72,7 @@
#include <QtWidgets/qgraphicsproxywidget.h>
#include <QtGui/qstylehints.h>
#include <QtGui/qinputmethod.h>
-#include <QtGui/qplatformtheme_qpa.h>
+#include <qpa/qplatformtheme.h>
#include "private/qkeymapper_p.h"
@@ -92,7 +92,7 @@
#include "qgesture.h"
#include "private/qgesturemanager_p.h"
#include "private/qguiapplication_p.h"
-#include "qplatformfontdatabase_qpa.h"
+#include <qpa/qplatformfontdatabase.h>
#ifndef QT_NO_LIBRARY
#include "qlibrary.h"
#endif
@@ -402,13 +402,7 @@ bool Q_WIDGETS_EXPORT qt_tab_all_widgets = true;
bool qt_in_tab_key_event = false;
int qt_antialiasing_threshold = -1;
QSize QApplicationPrivate::app_strut = QSize(0,0); // no default application strut
-bool QApplicationPrivate::animate_ui = true;
-bool QApplicationPrivate::animate_menu = false;
-bool QApplicationPrivate::fade_menu = false;
-bool QApplicationPrivate::animate_combo = false;
-bool QApplicationPrivate::animate_tooltip = false;
-bool QApplicationPrivate::fade_tooltip = false;
-bool QApplicationPrivate::animate_toolbox = false;
+int QApplicationPrivate::enabledAnimations = QPlatformTheme::GeneralUiEffect;
bool QApplicationPrivate::widgetCount = false;
bool QApplicationPrivate::load_testability = false;
#ifdef QT_KEYPAD_NAVIGATION
@@ -685,6 +679,10 @@ void QApplicationPrivate::initialize()
if (qt_is_gui_used)
initializeMultitouch();
+
+ if (QApplication::desktopSettingsAware())
+ if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme())
+ QApplicationPrivate::enabledAnimations = theme->themeHint(QPlatformTheme::UiEffects).toInt();
}
/*!
@@ -819,12 +817,7 @@ QApplication::~QApplication()
QApplicationPrivate::obey_desktop_settings = true;
QApplicationPrivate::app_strut = QSize(0, 0);
- QApplicationPrivate::animate_ui = true;
- QApplicationPrivate::animate_menu = false;
- QApplicationPrivate::fade_menu = false;
- QApplicationPrivate::animate_combo = false;
- QApplicationPrivate::animate_tooltip = false;
- QApplicationPrivate::fade_tooltip = false;
+ QApplicationPrivate::enabledAnimations = QPlatformTheme::GeneralUiEffect;
QApplicationPrivate::widgetCount = false;
#ifndef QT_NO_STATEMACHINE
diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h
index b1f510c5a5..63862269d6 100644
--- a/src/widgets/kernel/qapplication_p.h
+++ b/src/widgets/kernel/qapplication_p.h
@@ -61,7 +61,7 @@
#include "QtGui/qregion.h"
#include "QtGui/qwindow.h"
#include "qwidget.h"
-#include "QtGui/qplatformnativeinterface_qpa.h"
+#include <qpa/qplatformnativeinterface.h>
#include "QtCore/qmutex.h"
#include "QtCore/qtranslator.h"
#include "QtCore/qbasictimer.h"
@@ -72,7 +72,7 @@
#include <QTime>
#include <QWindowSystemInterface>
#include "private/qwindowsysteminterface_qpa_p.h"
-#include "QtGui/qplatformintegration_qpa.h"
+#include <qpa/qplatformintegration.h>
#include "private/qguiapplication_p.h"
QT_BEGIN_NAMESPACE
@@ -266,13 +266,7 @@ public:
static int wheel_scroll_lines;
#endif
- static bool animate_ui;
- static bool animate_menu;
- static bool animate_tooltip;
- static bool animate_combo;
- static bool fade_menu;
- static bool fade_tooltip;
- static bool animate_toolbox;
+ static int enabledAnimations; // Combination of QPlatformTheme::UiEffect
static bool widgetCount; // Coupled with -widgetcount switch
static bool load_testability; // Coupled with -testability switch
diff --git a/src/widgets/kernel/qapplication_qpa.cpp b/src/widgets/kernel/qapplication_qpa.cpp
index 0651d5bf44..e737fe1d8d 100644
--- a/src/widgets/kernel/qapplication_qpa.cpp
+++ b/src/widgets/kernel/qapplication_qpa.cpp
@@ -52,15 +52,15 @@
#include "private/qevent_p.h"
#include "qgenericpluginfactory_qpa.h"
-#include "private/qplatformintegrationfactory_qpa_p.h"
+#include <qpa/qplatformintegrationfactory_p.h>
#include <qdesktopwidget.h>
-#include <QPlatformCursor>
-#include <QPlatformTheme>
+#include <qpa/qplatformcursor.h>
+#include <qpa/qplatformtheme.h>
#include <qdebug.h>
#include <QWindowSystemInterface>
#include "private/qwindowsysteminterface_qpa_p.h"
-#include <QPlatformIntegration>
+#include <qpa/qplatformintegration.h>
#include "qdesktopwidget_qpa_p.h"
#include "qwidgetwindow_qpa_p.h"
@@ -354,58 +354,47 @@ int QApplication::wheelScrollLines()
}
#endif
-void QApplication::setEffectEnabled(Qt::UIEffect effect, bool enable)
+static inline int uiEffectToFlag(Qt::UIEffect effect)
{
switch (effect) {
+ case Qt::UI_General:
+ return QPlatformTheme::GeneralUiEffect;
case Qt::UI_AnimateMenu:
- QApplicationPrivate::animate_menu = enable;
- break;
+ return QPlatformTheme::AnimateMenuUiEffect;
case Qt::UI_FadeMenu:
- if (enable)
- QApplicationPrivate::animate_menu = true;
- QApplicationPrivate::fade_menu = enable;
- break;
+ return QPlatformTheme::FadeMenuUiEffect;
case Qt::UI_AnimateCombo:
- QApplicationPrivate::animate_combo = enable;
- break;
+ return QPlatformTheme::AnimateComboUiEffect;
case Qt::UI_AnimateTooltip:
- QApplicationPrivate::animate_tooltip = enable;
- break;
+ return QPlatformTheme::AnimateTooltipUiEffect;
case Qt::UI_FadeTooltip:
- if (enable)
- QApplicationPrivate::animate_tooltip = true;
- QApplicationPrivate::fade_tooltip = enable;
- break;
+ return QPlatformTheme::FadeTooltipUiEffect;
case Qt::UI_AnimateToolBox:
- QApplicationPrivate::animate_toolbox = enable;
- break;
- default:
- QApplicationPrivate::animate_ui = enable;
- break;
+ return QPlatformTheme::AnimateToolBoxUiEffect;
+ }
+ return 0;
+}
+
+void QApplication::setEffectEnabled(Qt::UIEffect effect, bool enable)
+{
+ int effectFlags = uiEffectToFlag(effect);
+ if (enable) {
+ if (effectFlags & QPlatformTheme::FadeMenuUiEffect)
+ effectFlags |= QPlatformTheme::AnimateMenuUiEffect;
+ if (effectFlags & QPlatformTheme::FadeTooltipUiEffect)
+ effectFlags |= QPlatformTheme::AnimateTooltipUiEffect;
+ QApplicationPrivate::enabledAnimations |= effectFlags;
+ } else {
+ QApplicationPrivate::enabledAnimations &= ~effectFlags;
}
}
bool QApplication::isEffectEnabled(Qt::UIEffect effect)
{
- if (QColormap::instance().depth() < 16 || !QApplicationPrivate::animate_ui)
+ return QColormap::instance().depth() >= 16
+ && (QApplicationPrivate::enabledAnimations & QPlatformTheme::GeneralUiEffect)
+ && (QApplicationPrivate::enabledAnimations & uiEffectToFlag(effect));
return false;
-
- switch(effect) {
- case Qt::UI_AnimateMenu:
- return QApplicationPrivate::animate_menu;
- case Qt::UI_FadeMenu:
- return QApplicationPrivate::fade_menu;
- case Qt::UI_AnimateCombo:
- return QApplicationPrivate::animate_combo;
- case Qt::UI_AnimateTooltip:
- return QApplicationPrivate::animate_tooltip;
- case Qt::UI_FadeTooltip:
- return QApplicationPrivate::fade_tooltip;
- case Qt::UI_AnimateToolBox:
- return QApplicationPrivate::animate_toolbox;
- default:
- return QApplicationPrivate::animate_ui;
- }
}
QWidget *QApplication::topLevelAt(const QPoint &pos)
diff --git a/src/widgets/kernel/qicon.cpp b/src/widgets/kernel/qicon.cpp
index dc506b780c..448b6a8cfd 100644
--- a/src/widgets/kernel/qicon.cpp
+++ b/src/widgets/kernel/qicon.cpp
@@ -816,10 +816,13 @@ void QIcon::addFile(const QString &fileName, const QSize &size, Mode mode, State
QString suffix = info.suffix();
if (!suffix.isEmpty()) {
// first try version 2 engines..
- if (QIconEngineFactoryInterface *factory = qobject_cast<QIconEngineFactoryInterface*>(loader()->instance(suffix))) {
- if (QIconEngine *engine = factory->create(fileName)) {
- d = new QIconPrivate;
- d->engine = engine;
+ const int index = loader()->indexOf(suffix);
+ if (index != -1) {
+ if (QIconEngineFactoryInterface *factory = qobject_cast<QIconEngineFactoryInterface*>(loader()->instance(index))) {
+ if (QIconEngine *engine = factory->create(fileName)) {
+ d = new QIconPrivate;
+ d->engine = engine;
+ }
}
}
}
@@ -1068,12 +1071,17 @@ QDataStream &operator>>(QDataStream &s, QIcon &icon)
icon.d->engine = engine;
engine->read(s);
#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
- } else if (QIconEngineFactoryInterface *factory = qobject_cast<QIconEngineFactoryInterface*>(loader()->instance(key))) {
- if (QIconEngine *engine= factory->create()) {
- icon.d = new QIconPrivate;
- icon.d->engine = engine;
- engine->read(s);
- }
+ } else {
+ const int index = loader()->indexOf(key);
+ if (index != -1) {
+ if (QIconEngineFactoryInterface *factory = qobject_cast<QIconEngineFactoryInterface*>(loader()->instance(index))) {
+ if (QIconEngine *engine= factory->create()) {
+ icon.d = new QIconPrivate;
+ icon.d->engine = engine;
+ engine->read(s);
+ } // factory
+ } // instance
+ } // index
#endif
}
} else if (s.version() == QDataStream::Qt_4_2) {
diff --git a/src/widgets/kernel/qiconloader.cpp b/src/widgets/kernel/qiconloader.cpp
index e1828fd1f1..acbf7c1d07 100644
--- a/src/widgets/kernel/qiconloader.cpp
+++ b/src/widgets/kernel/qiconloader.cpp
@@ -48,7 +48,7 @@
#include <QtWidgets/QApplication>
#include <QtWidgets/QIconEnginePlugin>
#include <QtGui/QPixmapCache>
-#include <QtGui/QPlatformTheme>
+#include <qpa/qplatformtheme.h>
#include <QtWidgets/QIconEngine>
#include <QtWidgets/QStyleOption>
#include <QtCore/QList>
@@ -121,7 +121,7 @@ void QIconLoader::ensureInitialized()
QFactoryLoader iconFactoryLoader(QIconEngineFactoryInterface_iid,
QLatin1String("/iconengines"),
Qt::CaseInsensitive);
- if (iconFactoryLoader.keys().contains(QLatin1String("svg")))
+ if (iconFactoryLoader.keyMap().key(QLatin1String("svg"), -1) != -1)
m_supportsSvg = true;
#endif //QT_NO_LIBRARY
}
diff --git a/src/widgets/kernel/qplatformmenu_qpa.h b/src/widgets/kernel/qplatformmenu.h
index cbd7eae6ac..cbd7eae6ac 100644
--- a/src/widgets/kernel/qplatformmenu_qpa.h
+++ b/src/widgets/kernel/qplatformmenu.h
diff --git a/src/widgets/kernel/qplatformmenu_qpa.cpp b/src/widgets/kernel/qplatformmenu_qpa.cpp
index 95a70d9dcd..f28560e560 100644
--- a/src/widgets/kernel/qplatformmenu_qpa.cpp
+++ b/src/widgets/kernel/qplatformmenu_qpa.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qplatformmenu_qpa.h"
+#include "qplatformmenu.h"
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/kernel/qwhatsthis.cpp b/src/widgets/kernel/qwhatsthis.cpp
index 9f4d8571b3..c1a6ead381 100644
--- a/src/widgets/kernel/qwhatsthis.cpp
+++ b/src/widgets/kernel/qwhatsthis.cpp
@@ -55,7 +55,7 @@
#include "qcursor.h"
#include "qbitmap.h"
#include "qtextdocument.h"
-#include "qplatformtheme_qpa.h"
+#include <qpa/qplatformtheme.h>
#include "private/qtextdocumentlayout_p.h"
#include "qtoolbutton.h"
#include "qdebug.h"
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 6d5bdf92cd..74612559f0 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -67,7 +67,7 @@
# include "qtoolbar.h"
# include <private/qmainwindowlayout_p.h>
#endif
-#include "qplatformwindow_qpa.h"
+#include <qpa/qplatformwindow.h>
#include "private/qwidgetwindow_qpa_p.h"
#include "qpainter.h"
#include "qtooltip.h"
@@ -1530,7 +1530,7 @@ void QWidgetPrivate::createTLExtra()
x->normalGeometry = QRect(0,0,-1,-1);
x->savedFlags = 0;
x->opacity = 255;
- x->posFromMove = false;
+ x->posIncludesFrame = 0;
x->sizeAdjusted = false;
x->inTopLevelResize = false;
x->inRepaint = false;
@@ -3242,11 +3242,11 @@ int QWidget::y() const
QPoint QWidget::pos() const
{
Q_D(const QWidget);
- if (isWindow() && ! (windowType() == Qt::Popup)) {
- QRect fs = d->frameStrut();
- return QPoint(data->crect.x() - fs.left(), data->crect.y() - fs.top());
- }
- return data->crect.topLeft();
+ QPoint result = data->crect.topLeft();
+ if (isWindow() && ! (windowType() == Qt::Popup))
+ if (!d->maybeTopData() || !d->maybeTopData()->posIncludesFrame)
+ result -= d->frameStrut().topLeft();
+ return result;
}
/*!
@@ -6475,14 +6475,17 @@ void QWidget::move(const QPoint &p)
{
Q_D(QWidget);
setAttribute(Qt::WA_Moved);
- if (isWindow())
- d->topData()->posFromMove = true;
if (testAttribute(Qt::WA_WState_Created)) {
+ if (isWindow())
+ d->topData()->posIncludesFrame = false;
d->setGeometry_sys(p.x() + geometry().x() - QWidget::x(),
p.y() + geometry().y() - QWidget::y(),
width(), height(), true);
d->setDirtyOpaqueRegion();
} else {
+ // no frame yet: see also QWidgetPrivate::fixPosIncludesFrame(), QWindowPrivate::PositionPolicy.
+ if (isWindow())
+ d->topData()->posIncludesFrame = true;
data->crect.moveTopLeft(p); // no frame yet
setAttribute(Qt::WA_PendingMoveEvent);
}
@@ -6499,6 +6502,7 @@ void QWidget::resize(const QSize &s)
Q_D(QWidget);
setAttribute(Qt::WA_Resized);
if (testAttribute(Qt::WA_WState_Created)) {
+ d->fixPosIncludesFrame();
d->setGeometry_sys(geometry().x(), geometry().y(), s.width(), s.height(), false);
d->setDirtyOpaqueRegion();
} else {
@@ -6513,7 +6517,7 @@ void QWidget::setGeometry(const QRect &r)
setAttribute(Qt::WA_Resized);
setAttribute(Qt::WA_Moved);
if (isWindow())
- d->topData()->posFromMove = false;
+ d->topData()->posIncludesFrame = 0;
if (testAttribute(Qt::WA_WState_Created)) {
d->setGeometry_sys(r.x(), r.y(), r.width(), r.height(), true);
d->setDirtyOpaqueRegion();
@@ -6681,11 +6685,11 @@ bool QWidget::restoreGeometry(const QByteArray &geometry)
restoredNormalGeometry.moveTop(qMax(restoredNormalGeometry.top(), availableGeometry.top() + frameHeight));
if (maximized || fullScreen) {
- // set geomerty before setting the window state to make
+ // set geometry before setting the window state to make
// sure the window is maximized to the right screen.
// Skip on windows: the window is restored into a broken
// half-maximized state.
-#ifndef Q_WS_WIN
+#ifndef Q_OS_WIN
setGeometry(restoredNormalGeometry);
#endif
Qt::WindowStates ws = windowState();
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h
index d7c0ec75b0..4b3216c6f0 100644
--- a/src/widgets/kernel/qwidget_p.h
+++ b/src/widgets/kernel/qwidget_p.h
@@ -157,7 +157,7 @@ struct QTLWExtra {
// *************************** Cross-platform bit fields ****************************
uint opacity : 8;
- uint posFromMove : 1;
+ uint posIncludesFrame : 1;
uint sizeAdjusted : 1;
uint inTopLevelResize : 1;
uint inRepaint : 1;
@@ -432,6 +432,7 @@ public:
void scroll_sys(int dx, int dy, const QRect &r);
void deactivateWidgetCleanup();
void setGeometry_sys(int, int, int, int, bool);
+ void fixPosIncludesFrame();
void sendPendingMoveAndResizeEvents(bool recursive = false, bool disableUpdates = false);
void activateChildLayoutsRecursively();
void show_recursive();
diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp
index a8175455b2..c4d1fb1d0d 100644
--- a/src/widgets/kernel/qwidget_qpa.cpp
+++ b/src/widgets/kernel/qwidget_qpa.cpp
@@ -47,14 +47,15 @@
#include "private/qwidgetwindow_qpa_p.h"
#include "private/qapplication_p.h"
#include "QtWidgets/qdesktopwidget.h"
-#include "QtGui/qplatformwindow_qpa.h"
+#include <qpa/qplatformwindow.h>
#include "QtGui/qsurfaceformat.h"
-#include "QtGui/qplatformopenglcontext_qpa.h"
+#include <qpa/qplatformopenglcontext.h>
#include "QtGui/private/qwindow_p.h"
-#include <QtGui/QPlatformCursor>
+#include <qpa/qplatformcursor.h>
#include <QtGui/QGuiApplication>
#include <QtGui/QScreen>
+#include <QtCore/QMargins>
QT_BEGIN_NAMESPACE
@@ -105,6 +106,7 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
}
win->setWindowFlags(data.window_flags);
+ fixPosIncludesFrame();
win->setGeometry(q->geometry());
win->setScreen(QGuiApplication::screens().value(topData()->screenIndex, 0));
@@ -126,7 +128,8 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
}
}
- qt_window_private(win)->positionPolicy = topData()->posFromMove ? QWindowPrivate::WindowFrameInclusive : QWindowPrivate::WindowFrameExclusive;
+ qt_window_private(win)->positionPolicy = topData()->posIncludesFrame ?
+ QWindowPrivate::WindowFrameInclusive : QWindowPrivate::WindowFrameExclusive;
win->create();
data.window_flags = win->windowFlags();
@@ -438,6 +441,31 @@ static inline QRect positionTopLevelWindow(QRect geometry, const QScreen *screen
return geometry;
}
+// move() was invoked with Qt::WA_WState_Created not set (frame geometry
+// unknown), that is, crect has a position including the frame.
+// If we can determine the frame strut, fix that and clear the flag.
+void QWidgetPrivate::fixPosIncludesFrame()
+{
+ Q_Q(QWidget);
+ if (QTLWExtra *te = maybeTopData()) {
+ if (te->posIncludesFrame) {
+ // For Qt::WA_DontShowOnScreen, assume a frame of 0 (for
+ // example, in QGraphicsProxyWidget).
+ if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
+ te->posIncludesFrame = 0;
+ } else {
+ if (q->windowHandle()) {
+ updateFrameStrut();
+ if (!q->data->fstrut_dirty) {
+ data.crect.translate(te->frameStrut.x(), te->frameStrut.y());
+ te->posIncludesFrame = 0;
+ }
+ } // windowHandle()
+ } // !WA_DontShowOnScreen
+ } // posIncludesFrame
+ } // QTLWExtra
+}
+
void QWidgetPrivate::show_sys()
{
Q_Q(QWidget);
@@ -460,6 +488,8 @@ void QWidgetPrivate::show_sys()
return;
if (window) {
+ if (q->isWindow())
+ fixPosIncludesFrame();
QRect geomRect = q->geometry();
if (q->isWindow()) {
if (!q->testAttribute(Qt::WA_Moved))
@@ -491,12 +521,13 @@ void QWidgetPrivate::hide_sys()
QWindow *window = q->windowHandle();
- if (q->testAttribute(Qt::WA_DontShowOnScreen)
- && q->isWindow()
- && q->windowModality() != Qt::NonModal
- && window) {
- // remove our window from the modal window list
- QGuiApplicationPrivate::hideModalWindow(window);
+ if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
+ q->setAttribute(Qt::WA_Mapped, false);
+ if (q->isWindow() && q->windowModality() != Qt::NonModal && window) {
+ // remove our window from the modal window list
+ QGuiApplicationPrivate::hideModalWindow(window);
+ }
+ // do not return here, if window non-zero, we must hide it
}
deactivateWidgetCleanup();
@@ -511,11 +542,8 @@ void QWidgetPrivate::hide_sys()
invalidateBuffer(q->rect());
- if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
- q->setAttribute(Qt::WA_Mapped, false);
- } else if (window) {
- window->setVisible(false);
- }
+ if (window)
+ window->setVisible(false);
}
void QWidgetPrivate::setMaxWindowState_helper()
@@ -545,7 +573,7 @@ void QWidgetPrivate::setFullScreenSize_helper()
data.in_set_window_state = old_state;
}
-static Qt::WindowState effectiveState(Qt::WindowStates state)
+Qt::WindowState effectiveState(Qt::WindowStates state)
{
if (state & Qt::WindowMinimized)
return Qt::WindowMinimized;
@@ -707,7 +735,6 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
if (!q->testAttribute(Qt::WA_DontShowOnScreen) && !q->testAttribute(Qt::WA_OutsideWSRange)) {
if (q->windowHandle()) {
if (q->isWindow()) {
- qt_window_private(q->windowHandle())->positionPolicy = topData()->posFromMove ? QWindowPrivate::WindowFrameInclusive : QWindowPrivate::WindowFrameExclusive;
q->windowHandle()->setGeometry(q->geometry());
} else {
QPoint posInNativeParent = q->mapTo(q->nativeParentWidget(),QPoint());
@@ -763,8 +790,10 @@ void QWidgetPrivate::setConstraints_sys()
winp->sizeIncrement = QSize(extra->topextra->incw, extra->topextra->inch);
}
- if (winp->platformWindow)
+ if (winp->platformWindow) {
+ fixPosIncludesFrame();
winp->platformWindow->propagateSizeHints();
+ }
}
}
@@ -895,7 +924,20 @@ void QWidgetPrivate::setMask_sys(const QRegion &region)
void QWidgetPrivate::updateFrameStrut()
{
- // XXX
+ Q_Q(QWidget);
+ if (q->data->fstrut_dirty) {
+ if (QTLWExtra *te = maybeTopData()) {
+ if (te->window) {
+ if (const QPlatformWindow *pw = te->window->handle()) {
+ const QMargins margins = pw->frameMargins();
+ if (!margins.isNull()) {
+ te->frameStrut.setCoords(margins.left(), margins.top(), margins.right(), margins.bottom());
+ q->data->fstrut_dirty = false;
+ }
+ }
+ }
+ }
+ }
}
void QWidgetPrivate::setWindowOpacity_sys(qreal level)
diff --git a/src/widgets/kernel/qwidgetwindow_qpa.cpp b/src/widgets/kernel/qwidgetwindow_qpa.cpp
index 0a45cce62e..5639bac3ff 100644
--- a/src/widgets/kernel/qwidgetwindow_qpa.cpp
+++ b/src/widgets/kernel/qwidgetwindow_qpa.cpp
@@ -83,6 +83,12 @@ QObject *QWidgetWindow::focusObject() const
bool QWidgetWindow::event(QEvent *event)
{
+ if (m_widget->testAttribute(Qt::WA_DontShowOnScreen)) {
+ // \a event is uninteresting for QWidgetWindow, the event was probably
+ // generated before WA_DontShowOnScreen was set
+ return m_widget->event(event);
+ }
+
switch (event->type()) {
case QEvent::Close:
handleCloseEvent(static_cast<QCloseEvent *>(event));
@@ -327,10 +333,13 @@ void QWidgetWindow::updateGeometry()
if (m_widget->testAttribute(Qt::WA_OutsideWSRange))
return;
- QMargins margins = frameMargins();
+ const QMargins margins = frameMargins();
m_widget->data->crect = geometry();
- m_widget->d_func()->topData()->frameStrut.setCoords(margins.left(), margins.top(), margins.right(), margins.bottom());
+ QTLWExtra *te = m_widget->d_func()->topData();
+ te->posIncludesFrame= false;
+ te->frameStrut.setCoords(margins.left(), margins.top(), margins.right(), margins.bottom());
+ m_widget->data->fstrut_dirty = false;
}
void QWidgetWindow::handleMoveEvent(QMoveEvent *event)
@@ -447,6 +456,8 @@ void QWidgetWindow::handleExposeEvent(QExposeEvent *event)
}
}
+Qt::WindowState effectiveState(Qt::WindowStates state);
+
void QWidgetWindow::handleWindowStateChangedEvent(QWindowStateChangeEvent *event)
{
// QWindow does currently not know 'active'.
@@ -465,10 +476,16 @@ void QWidgetWindow::handleWindowStateChangedEvent(QWindowStateChangeEvent *event
widgetState |= Qt::WindowMinimized;
break;
case Qt::WindowMaximized:
+ if (effectiveState(widgetState) == Qt::WindowNoState)
+ if (QTLWExtra *tle = m_widget->d_func()->maybeTopData())
+ tle->normalGeometry = m_widget->geometry();
widgetState &= ~Qt::WindowFullScreen;
widgetState |= Qt::WindowMaximized;
break;
case Qt::WindowFullScreen:
+ if (effectiveState(widgetState) == Qt::WindowNoState)
+ if (QTLWExtra *tle = m_widget->d_func()->maybeTopData())
+ tle->normalGeometry = m_widget->geometry();
widgetState &= ~Qt::WindowMaximized;
widgetState |= Qt::WindowFullScreen;
break;
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index b2b1d3fec5..3de94a8f17 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -45,7 +45,7 @@
#include <qfile.h>
#include <qapplication.h>
#include <private/qguiapplication_p.h>
-#include <qplatformtheme_qpa.h>
+#include <qpa/qplatformtheme.h>
#include <qbitmap.h>
#include <qcache.h>
#include <qdockwidget.h>
diff --git a/src/widgets/styles/qgtkstyle_p.h b/src/widgets/styles/qgtkstyle_p.h
index b095820626..3cd443122c 100644
--- a/src/widgets/styles/qgtkstyle_p.h
+++ b/src/widgets/styles/qgtkstyle_p.h
@@ -65,7 +65,7 @@
#include <QtWidgets/QGtkStyle>
#include <private/qcleanlooksstyle_p.h>
-#undef signals // Collides with GTK stymbols
+#undef signals // Collides with GTK symbols
#include <gtk/gtk.h>
typedef unsigned long XID;
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 05bd90abef..662f0e2a60 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -100,7 +100,7 @@
#include <QtWidgets/qgraphicsproxywidget.h>
#include <QtWidgets/qgraphicsview.h>
#include <private/qstylehelper_p.h>
-#include <QtGui/QPlatformFontDatabase>
+#include <qpa/qplatformfontdatabase.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/styles/qstylefactory.cpp b/src/widgets/styles/qstylefactory.cpp
index 9ed452b516..ec29ae7b99 100644
--- a/src/widgets/styles/qstylefactory.cpp
+++ b/src/widgets/styles/qstylefactory.cpp
@@ -181,10 +181,8 @@ QStyle *QStyleFactory::create(const QString& key)
#endif
{ } // Keep these here - they make the #ifdefery above work
#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
- if(!ret) {
- if (QStyleFactoryInterface *factory = qobject_cast<QStyleFactoryInterface*>(loader()->instance(style)))
- ret = factory->create(style);
- }
+ if (!ret)
+ ret = qLoadPlugin<QStyle, QStyleFactoryInterface>(loader(), style);
#endif
if(ret)
ret->setObjectName(style);
@@ -199,10 +197,15 @@ QStyle *QStyleFactory::create(const QString& key)
*/
QStringList QStyleFactory::keys()
{
-#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
- QStringList list = loader()->keys();
-#else
QStringList list;
+#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
+ typedef QMultiMap<int, QString> PluginKeyMap;
+ typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator;
+
+ const PluginKeyMap keyMap = loader()->keyMap();
+ const PluginKeyMap::const_iterator cend = keyMap.constEnd();
+ for (PluginKeyMap::const_iterator it = keyMap.constBegin(); it != cend; ++it)
+ list.append(it.value());
#endif
#ifndef QT_NO_STYLE_WINDOWS
if (!list.contains(QLatin1String("Windows")))
diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp
index 6fce426dd3..bcb24db663 100644
--- a/src/widgets/styles/qwindowsvistastyle.cpp
+++ b/src/widgets/styles/qwindowsvistastyle.cpp
@@ -46,7 +46,7 @@
#include <private/qstylehelper_p.h>
#include <private/qsystemlibrary_p.h>
#include <private/qapplication_p.h>
-#include <qplatformnativeinterface_qpa.h>
+#include <qpa/qplatformnativeinterface.h>
#if !defined(QT_NO_STYLE_WINDOWSVISTA) || defined(QT_PLUGIN)
diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp
index 091b27d87b..18a28bc556 100644
--- a/src/widgets/styles/qwindowsxpstyle.cpp
+++ b/src/widgets/styles/qwindowsxpstyle.cpp
@@ -46,14 +46,14 @@
#include <private/qobject_p.h>
#include <private/qpaintengine_raster_p.h>
#include <private/qapplication_p.h>
-#include <qplatformnativeinterface_qpa.h>
+#include <qpa/qplatformnativeinterface.h>
#include <private/qstylehelper_p.h>
#include <private/qwidget_p.h>
#include <private/qsystemlibrary_p.h>
#include <qpainter.h>
#include <qpaintengine.h>
#include <qwidget.h>
-#include <qbackingstore.>
+#include <qbackingstore.h>
#include <qapplication.h>
#include <qpixmapcache.h>
diff --git a/src/widgets/util/qsystemtrayicon_win.cpp b/src/widgets/util/qsystemtrayicon_win.cpp
index fa72e791ba..84becf4a70 100644
--- a/src/widgets/util/qsystemtrayicon_win.cpp
+++ b/src/widgets/util/qsystemtrayicon_win.cpp
@@ -52,7 +52,7 @@
#include <private/qsystemlibrary_p.h>
#include <private/qguiapplication_p.h>
-#include <QPlatformNativeInterface>
+#include <qpa/qplatformnativeinterface.h>
#include <QSettings>
#include <QDebug>
#include <QHash>
diff --git a/src/widgets/util/qsystemtrayicon_x11.cpp b/src/widgets/util/qsystemtrayicon_x11.cpp
index 174c39d1f6..e58d0d9315 100644
--- a/src/widgets/util/qsystemtrayicon_x11.cpp
+++ b/src/widgets/util/qsystemtrayicon_x11.cpp
@@ -54,7 +54,7 @@
#include <qguiapplication.h>
#include <qscreen.h>
#include <qbackingstore.h>
-#include <qplatformnativeinterface_qpa.h>
+#include <qpa/qplatformnativeinterface.h>
#include <qdebug.h>
#include <X11/Xlib.h>
diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp
index acd07d2a5b..5ac7348217 100644
--- a/src/widgets/widgets/qcalendarwidget.cpp
+++ b/src/widgets/widgets/qcalendarwidget.cpp
@@ -2067,9 +2067,9 @@ QCalendarWidget::QCalendarWidget(QWidget *parent)
d->m_model->setView(d->m_view);
d->m_view->setSelectionBehavior(QAbstractItemView::SelectItems);
d->m_view->setSelectionMode(QAbstractItemView::SingleSelection);
- d->m_view->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
+ d->m_view->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
d->m_view->horizontalHeader()->setSectionsClickable(false);
- d->m_view->verticalHeader()->setResizeMode(QHeaderView::Stretch);
+ d->m_view->verticalHeader()->setSectionResizeMode(QHeaderView::Stretch);
d->m_view->verticalHeader()->setSectionsClickable(false);
d->m_selection = d->m_view->selectionModel();
d->createNavigationBar(this);
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index bea4061076..6a8e7b4641 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -43,7 +43,7 @@
#ifndef QT_NO_COMBOBOX
#include <qstylepainter.h>
-#include <qplatformtheme_qpa.h>
+#include <qpa/qplatformtheme.h>
#include <qlineedit.h>
#include <qapplication.h>
#include <qdesktopwidget.h>
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index fccb062e07..955e2e5c8c 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -49,7 +49,7 @@
#include "qtimer.h"
#include "qlayout.h"
#include "qpainter.h"
-#include "qplatformtheme_qpa.h"
+#include <qpa/qplatformtheme.h>
#include "qapplication.h"
#include "qdesktopwidget.h"
#ifndef QT_NO_ACCESSIBILITY
@@ -71,7 +71,7 @@
#include <private/qaction_p.h>
#include <private/qsoftkeymanager_p.h>
#include <private/qguiapplication_p.h>
-#include <qplatformtheme_qpa.h>
+#include <qpa/qplatformtheme.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/widgets/qmenu_p.h b/src/widgets/widgets/qmenu_p.h
index d637a9be8f..692fd19050 100644
--- a/src/widgets/widgets/qmenu_p.h
+++ b/src/widgets/widgets/qmenu_p.h
@@ -61,7 +61,7 @@
#include "QtCore/qbasictimer.h"
#include "private/qwidget_p.h"
-#include <qplatformmenu_qpa.h>
+#include <qpa/qplatformmenu.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp
index 104424cabf..80b6faa1a0 100644
--- a/src/widgets/widgets/qmenubar.cpp
+++ b/src/widgets/widgets/qmenubar.cpp
@@ -55,7 +55,7 @@
#include <qtoolbar.h>
#include <qtoolbutton.h>
#include <qwhatsthis.h>
-#include <qplatformtheme_qpa.h>
+#include <qpa/qplatformtheme.h>
#include "private/qguiapplication_p.h"
#ifndef QT_NO_MENUBAR
diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp
index 017cbee219..6347593efe 100644
--- a/src/widgets/widgets/qwidgetlinecontrol.cpp
+++ b/src/widgets/widgets/qwidgetlinecontrol.cpp
@@ -46,7 +46,7 @@
#include "qabstractitemview.h"
#include "qclipboard.h"
#include <private/qguiapplication_p.h>
-#include <qplatformtheme_qpa.h>
+#include <qpa/qplatformtheme.h>
#include <qstylehints.h>
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"