Pluginize the platform styles
This enforces decoupling and in the case of QMacStyle, isolates QtWidgets and therefore end user applications, from Carbon/HITheme. Windows and Fusion are platform independent, so they remain built-in (but mostly because the Windows style is tightly coupled to other styles like QStylesheetStyle). Task-number: QTBUG-59428 Change-Id: Id6519fe0c5269c1bce5b5921f9db06257032a1c9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>bb10
parent
571eb37ac9
commit
4f3249f32d
|
|
@ -8,6 +8,7 @@ qtHaveModule(gui) {
|
|||
qtConfig(imageformatplugin): SUBDIRS *= imageformats
|
||||
!android:qtConfig(library): SUBDIRS *= generic
|
||||
}
|
||||
qtHaveModule(widgets): SUBDIRS += styles
|
||||
|
||||
!winrt:!wince:qtHaveModule(printsupport): \
|
||||
SUBDIRS += printsupport
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
TARGET = qandroidstyle
|
||||
|
||||
QT += widgets-private
|
||||
|
||||
SOURCES += \
|
||||
main.cpp \
|
||||
qandroidstyle.cpp
|
||||
|
||||
HEADERS += \
|
||||
qandroidstyle_p.h
|
||||
|
||||
DISTFILES += androidstyle.json
|
||||
|
||||
PLUGIN_TYPE = styles
|
||||
PLUGIN_CLASS_NAME = QAndroidStylePlugin
|
||||
load(qt_plugin)
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"Keys": [ "android" ]
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the plugins of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or (at your option) the GNU General
|
||||
** Public license version 3 or any later version approved by the KDE Free
|
||||
** Qt Foundation. The licenses are as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <QtWidgets/qstyleplugin.h>
|
||||
#include "qandroidstyle_p.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QAndroidStylePlugin : public QStylePlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "androidstyle.json")
|
||||
public:
|
||||
QStyle *create(const QString &key);
|
||||
};
|
||||
|
||||
QStyle *QAndroidStylePlugin::create(const QString &key)
|
||||
{
|
||||
if (key.compare(QLatin1String("android"), Qt::CaseInsensitive) == 0)
|
||||
return new QAndroidStyle();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#include "main.moc"
|
||||
|
||||
|
|
@ -39,8 +39,6 @@
|
|||
|
||||
#include "qandroidstyle_p.h"
|
||||
|
||||
#if QT_CONFIG(style_android) || defined(QT_PLUGIN)
|
||||
|
||||
#include <QFile>
|
||||
#include <QFont>
|
||||
#include <QApplication>
|
||||
|
|
@ -1805,5 +1803,3 @@ QRect QAndroidStyle::AndroidSpinnerControl::subControlRect(const QStyleOptionCom
|
|||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QT_CONFIG(style_android) || defined(QT_PLUGIN)
|
||||
|
|
@ -52,16 +52,14 @@
|
|||
//
|
||||
|
||||
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
||||
#include <QtWidgets/private/qfusionstyle_p.h>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMargins>
|
||||
#include <QtCore/QHash>
|
||||
#include <QtCore/QVariantMap>
|
||||
#include "qfusionstyle_p.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#if QT_CONFIG(style_android)
|
||||
|
||||
class Q_WIDGETS_EXPORT QAndroidStyle : public QFusionStyle
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
@ -388,8 +386,6 @@ private:
|
|||
AndroidCompoundButtonControl *checkBoxControl;
|
||||
};
|
||||
|
||||
#endif // style_android
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QANDROIDSTYLE_P_H
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
TARGET = qmacstyle
|
||||
|
||||
QT += widgets-private
|
||||
|
||||
SOURCES += \
|
||||
main.mm \
|
||||
qmacstyle_mac.mm
|
||||
|
||||
HEADERS += \
|
||||
qmacstyle_mac_p.h \
|
||||
qmacstyle_mac_p_p.h
|
||||
|
||||
LIBS_PRIVATE += -framework AppKit -framework Carbon
|
||||
|
||||
DISTFILES += macstyle.json
|
||||
|
||||
PLUGIN_TYPE = styles
|
||||
PLUGIN_CLASS_NAME = QMacStylePlugin
|
||||
load(qt_plugin)
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"Keys": [ "macintosh" ]
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the plugins of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or (at your option) the GNU General
|
||||
** Public license version 3 or any later version approved by the KDE Free
|
||||
** Qt Foundation. The licenses are as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <QtWidgets/qstyleplugin.h>
|
||||
#include "qmacstyle_mac_p.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QMacStylePlugin : public QStylePlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "macstyle.json")
|
||||
public:
|
||||
QStyle *create(const QString &key);
|
||||
};
|
||||
|
||||
QStyle *QMacStylePlugin::create(const QString &key)
|
||||
{
|
||||
QMacAutoReleasePool pool;
|
||||
if (key.compare(QLatin1String("macintosh"), Qt::CaseInsensitive) == 0)
|
||||
return new QMacStyle();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#include "main.moc"
|
||||
|
||||
|
|
@ -56,9 +56,6 @@
|
|||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#if QT_CONFIG(style_mac)
|
||||
|
||||
class QPalette;
|
||||
|
||||
class QPushButton;
|
||||
|
|
@ -126,8 +123,6 @@ private:
|
|||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QMACSTYLE_MAC_P_H
|
||||
|
|
@ -45,8 +45,8 @@
|
|||
#undef check
|
||||
|
||||
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
||||
#include <QtWidgets/private/qcommonstyle_p.h>
|
||||
#include "qmacstyle_mac_p.h"
|
||||
#include "qcommonstyle_p.h"
|
||||
#include <private/qapplication_p.h>
|
||||
#include <private/qcombobox_p.h>
|
||||
#include <private/qpainter_p.h>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
TEMPLATE = subdirs
|
||||
QT_FOR_CONFIG += widgets-private
|
||||
|
||||
qtConfig(style-android): SUBDIRS += android
|
||||
|
||||
qtConfig(style-mac): SUBDIRS += mac
|
||||
|
||||
qtConfig(style-windowsvista): SUBDIRS += windowsvista
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the plugins of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or (at your option) the GNU General
|
||||
** Public license version 3 or any later version approved by the KDE Free
|
||||
** Qt Foundation. The licenses are as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
||||
#include <QtWidgets/qstyleplugin.h>
|
||||
#include "qwindowsvistastyle_p.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QWindowsVistaStylePlugin : public QStylePlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "windowsvistastyle.json")
|
||||
public:
|
||||
QStyle *create(const QString &key);
|
||||
};
|
||||
|
||||
QStyle *QWindowsVistaStylePlugin::create(const QString &key)
|
||||
{
|
||||
if (key.compare(QLatin1String("windowsvista"), Qt::CaseInsensitive) == 0)
|
||||
return new QWindowsVistaStyle();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#include "main.moc"
|
||||
|
|
@ -47,8 +47,6 @@
|
|||
#include <private/qapplication_p.h>
|
||||
#include <qpa/qplatformnativeinterface.h>
|
||||
|
||||
#if QT_CONFIG(style_windowsvista) || defined(QT_PLUGIN)
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
static const int windowsItemFrame = 2; // menu item frame width
|
||||
|
|
@ -2487,5 +2485,3 @@ QIcon QWindowsVistaStyle::standardIcon(StandardPixmap standardIcon,
|
|||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif //QT_NO_WINDOWSVISTA
|
||||
|
|
@ -52,13 +52,10 @@
|
|||
//
|
||||
|
||||
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
||||
#include <private/qwindowsxpstyle_p.h>
|
||||
#include "qwindowsxpstyle_p.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
|
||||
class QWindowsVistaStylePrivate;
|
||||
class QWindowsVistaStyle : public QWindowsXPStyle
|
||||
{
|
||||
|
|
@ -103,7 +100,6 @@ private:
|
|||
Q_DECLARE_PRIVATE(QWindowsVistaStyle)
|
||||
friend class QStyleFactory;
|
||||
};
|
||||
#endif // style_windowsvista
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
|
|
@ -53,9 +53,7 @@
|
|||
|
||||
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
||||
#include "qwindowsvistastyle_p.h"
|
||||
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
#include <private/qwindowsxpstyle_p_p.h>
|
||||
#include "qwindowsxpstyle_p_p.h"
|
||||
#include <private/qstyleanimation_p.h>
|
||||
#include <private/qpaintengine_raster_p.h>
|
||||
#include <qpaintengine.h>
|
||||
|
|
@ -179,6 +177,4 @@ public:
|
|||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // style_windowsvista
|
||||
|
||||
#endif // QWINDOWSVISTASTYLE_P_P_H
|
||||
|
|
@ -39,8 +39,6 @@
|
|||
#include "qwindowsxpstyle_p.h"
|
||||
#include "qwindowsxpstyle_p_p.h"
|
||||
|
||||
#if QT_CONFIG(style_windowsvista) || defined(QT_PLUGIN)
|
||||
|
||||
#include <private/qobject_p.h>
|
||||
#include <private/qpaintengine_raster_p.h>
|
||||
#include <private/qapplication_p.h>
|
||||
|
|
@ -4223,5 +4221,3 @@ void QWindowsXPStylePrivate::showProperties(XPThemeData &themeData)
|
|||
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif //QT_NO_WINDOWSXP
|
||||
|
|
@ -52,13 +52,10 @@
|
|||
//
|
||||
|
||||
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
||||
#include <private/qwindowsstyle_p.h>
|
||||
#include <QtWidgets/private/qwindowsstyle_p.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
|
||||
class QWindowsXPStylePrivate;
|
||||
class QWindowsXPStyle : public QWindowsStyle
|
||||
{
|
||||
|
|
@ -102,8 +99,6 @@ private:
|
|||
friend class QStyleFactory;
|
||||
};
|
||||
|
||||
#endif // style_windowsvista
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QWINDOWSXPSTYLE_P_H
|
||||
|
|
@ -53,7 +53,7 @@
|
|||
|
||||
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
||||
#include "qwindowsxpstyle_p.h"
|
||||
#include "qwindowsstyle_p_p.h"
|
||||
#include <QtWidgets/private/qwindowsstyle_p_p.h>
|
||||
#include <qmap.h>
|
||||
#include <qt_windows.h>
|
||||
|
||||
|
|
@ -94,8 +94,6 @@ QT_BEGIN_NAMESPACE
|
|||
// Uncomment define below to build debug assisting code, and output
|
||||
// #define DEBUG_XP_STYLE
|
||||
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
|
||||
// Declarations -----------------------------------------------------------------------------------
|
||||
class XPThemeData
|
||||
{
|
||||
|
|
@ -338,8 +336,6 @@ inline QMarginsF XPThemeData::themeMargins(const QWidget *w, QPainter *p, int th
|
|||
return theme.margins(propId);
|
||||
}
|
||||
|
||||
#endif // style_windows
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif //QWINDOWSXPSTYLE_P_P_H
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
TARGET = qwindowsvistastyle
|
||||
|
||||
QT += widgets-private
|
||||
|
||||
SOURCES += main.cpp
|
||||
|
||||
HEADERS += qwindowsvistastyle_p.h qwindowsvistastyle_p_p.h
|
||||
SOURCES += qwindowsvistastyle.cpp
|
||||
|
||||
HEADERS += qwindowsxpstyle_p.h qwindowsxpstyle_p_p.h
|
||||
SOURCES += qwindowsxpstyle.cpp
|
||||
|
||||
LIBS_PRIVATE += -lgdi32 -luser32
|
||||
|
||||
# DEFINES/LIBS needed for qwizard_win.cpp and the styles
|
||||
include(../../../widgets/kernel/win.pri)
|
||||
|
||||
DISTFILES += windowsvistastyle.json
|
||||
|
||||
PLUGIN_TYPE = styles
|
||||
PLUGIN_CLASS_NAME = QWindowsVistaStylePlugin
|
||||
load(qt_plugin)
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"Keys": [ "windowsvista" ]
|
||||
}
|
||||
|
|
@ -2726,7 +2726,7 @@ bool QApplicationPrivate::sendMouseEvent(QWidget *receiver, QMouseEvent *event,
|
|||
case enter/leave events are genereated by the underlying windowing system.
|
||||
*/
|
||||
extern QPointer<QWidget> qt_last_mouse_receiver;
|
||||
extern QWidget *qt_button_down;
|
||||
extern Q_WIDGETS_EXPORT QWidget *qt_button_down;
|
||||
void QApplicationPrivate::sendSyntheticEnterLeave(QWidget *widget)
|
||||
{
|
||||
#ifndef QT_NO_CURSOR
|
||||
|
|
@ -3751,7 +3751,6 @@ static void grabForPopup(QWidget *popup)
|
|||
}
|
||||
}
|
||||
|
||||
extern QWidget *qt_button_down;
|
||||
extern QWidget *qt_popup_down;
|
||||
extern bool qt_replay_popup_mouse_event;
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ extern QClipboard *qt_clipboard;
|
|||
#endif
|
||||
|
||||
typedef QHash<QByteArray, QFont> FontHash;
|
||||
FontHash *qt_app_fonts_hash();
|
||||
Q_WIDGETS_EXPORT FontHash *qt_app_fonts_hash();
|
||||
|
||||
typedef QHash<QByteArray, QPalette> PaletteHash;
|
||||
PaletteHash *qt_app_palettes_hash();
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE
|
|||
|
||||
Q_WIDGETS_EXPORT extern bool qt_tab_all_widgets();
|
||||
|
||||
QWidget *qt_button_down = 0; // widget got last button-down
|
||||
Q_WIDGETS_EXPORT QWidget *qt_button_down = 0; // widget got last button-down
|
||||
|
||||
// popup control
|
||||
QWidget *qt_popup_down = 0; // popup that contains the pressed widget
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE
|
|||
class QStringList;
|
||||
|
||||
// Private class
|
||||
class QCommonStylePrivate : public QStylePrivate
|
||||
class Q_WIDGETS_EXPORT QCommonStylePrivate : public QStylePrivate
|
||||
{
|
||||
Q_DECLARE_PUBLIC(QCommonStyle)
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
|
|||
#if QT_CONFIG(style_fusion)
|
||||
|
||||
class QFusionStylePrivate;
|
||||
class QFusionStyle : public QCommonStyle
|
||||
class Q_WIDGETS_EXPORT QFusionStyle : public QCommonStyle
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DECLARE_PRIVATE(QFusionStyle)
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
|
|||
// We mean it.
|
||||
//
|
||||
|
||||
class QStyleAnimation : public QAbstractAnimation
|
||||
class Q_WIDGETS_EXPORT QStyleAnimation : public QAbstractAnimation
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -106,7 +106,7 @@ private:
|
|||
int _skip;
|
||||
};
|
||||
|
||||
class QProgressStyleAnimation : public QStyleAnimation
|
||||
class Q_WIDGETS_EXPORT QProgressStyleAnimation : public QStyleAnimation
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -127,7 +127,7 @@ private:
|
|||
mutable int _step;
|
||||
};
|
||||
|
||||
class QNumberStyleAnimation : public QStyleAnimation
|
||||
class Q_WIDGETS_EXPORT QNumberStyleAnimation : public QStyleAnimation
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -151,7 +151,7 @@ private:
|
|||
mutable qreal _prev;
|
||||
};
|
||||
|
||||
class QBlendStyleAnimation : public QStyleAnimation
|
||||
class Q_WIDGETS_EXPORT QBlendStyleAnimation : public QStyleAnimation
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -178,7 +178,7 @@ private:
|
|||
QImage _current;
|
||||
};
|
||||
|
||||
class QScrollbarStyleAnimation : public QNumberStyleAnimation
|
||||
class Q_WIDGETS_EXPORT QScrollbarStyleAnimation : public QNumberStyleAnimation
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
|
|||
|
|
@ -46,16 +46,6 @@
|
|||
#include "qwindowsstyle_p.h"
|
||||
#if QT_CONFIG(style_fusion)
|
||||
#include "qfusionstyle_p.h"
|
||||
#if QT_CONFIG(style_android)
|
||||
#include "qandroidstyle_p.h"
|
||||
#endif
|
||||
#endif
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
#include "qwindowsvistastyle_p.h"
|
||||
#endif
|
||||
|
||||
#if QT_CONFIG(style_mac)
|
||||
# include "qmacstyle_mac_p.h"
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
|
@ -105,29 +95,10 @@ QStyle *QStyleFactory::create(const QString& key)
|
|||
ret = new QWindowsStyle;
|
||||
else
|
||||
#endif
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
if (style == QLatin1String("windowsvista"))
|
||||
ret = new QWindowsVistaStyle;
|
||||
else
|
||||
#endif
|
||||
#if QT_CONFIG(style_fusion)
|
||||
if (style == QLatin1String("fusion"))
|
||||
ret = new QFusionStyle;
|
||||
else
|
||||
#endif
|
||||
#if QT_CONFIG(style_android)
|
||||
if (style == QLatin1String("android"))
|
||||
ret = new QAndroidStyle;
|
||||
else
|
||||
#endif
|
||||
#if QT_CONFIG(style_mac)
|
||||
if (style.startsWith(QLatin1String("macintosh"))) {
|
||||
ret = new QMacStyle;
|
||||
# if 0 // Used to be included in Qt4 for Q_WS_MAC
|
||||
if (style == QLatin1String("macintosh"))
|
||||
style += QLatin1String(" (aqua)");
|
||||
# endif
|
||||
} else
|
||||
#endif
|
||||
{ } // Keep these here - they make the #ifdefery above work
|
||||
if (!ret)
|
||||
|
|
@ -156,26 +127,9 @@ QStringList QStyleFactory::keys()
|
|||
if (!list.contains(QLatin1String("Windows")))
|
||||
list << QLatin1String("Windows");
|
||||
#endif
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
if (!list.contains(QLatin1String("WindowsVista")) &&
|
||||
(QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)))
|
||||
list << QLatin1String("WindowsVista");
|
||||
#endif
|
||||
#if QT_CONFIG(style_android)
|
||||
if (!list.contains(QLatin1String("Android")))
|
||||
list << QLatin1String("Android");
|
||||
#endif
|
||||
#if QT_CONFIG(style_fusion)
|
||||
if (!list.contains(QLatin1String("Fusion")))
|
||||
list << QLatin1String("Fusion");
|
||||
#endif
|
||||
#if QT_CONFIG(style_mac)
|
||||
QString mstyle = QLatin1String("Macintosh");
|
||||
# if 0 // Used to be included in Qt4 for Q_WS_MAC
|
||||
mstyle += QLatin1String(" (aqua)");
|
||||
# endif
|
||||
if (!list.contains(mstyle))
|
||||
list << mstyle;
|
||||
#endif
|
||||
return list;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,27 +71,27 @@ class QWindow;
|
|||
namespace QStyleHelper
|
||||
{
|
||||
QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size);
|
||||
qreal dpiScaled(qreal value);
|
||||
Q_WIDGETS_EXPORT qreal dpiScaled(qreal value);
|
||||
#ifndef QT_NO_DIAL
|
||||
qreal angle(const QPointF &p1, const QPointF &p2);
|
||||
QPolygonF calcLines(const QStyleOptionSlider *dial);
|
||||
int calcBigLineSize(int radius);
|
||||
void drawDial(const QStyleOptionSlider *dial, QPainter *painter);
|
||||
Q_WIDGETS_EXPORT void drawDial(const QStyleOptionSlider *dial, QPainter *painter);
|
||||
#endif //QT_NO_DIAL
|
||||
void drawBorderPixmap(const QPixmap &pixmap, QPainter *painter, const QRect &rect,
|
||||
Q_WIDGETS_EXPORT void drawBorderPixmap(const QPixmap &pixmap, QPainter *painter, const QRect &rect,
|
||||
int left = 0, int top = 0, int right = 0,
|
||||
int bottom = 0);
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
bool isInstanceOf(QObject *obj, QAccessible::Role role);
|
||||
bool hasAncestor(QObject *obj, QAccessible::Role role);
|
||||
Q_WIDGETS_EXPORT bool isInstanceOf(QObject *obj, QAccessible::Role role);
|
||||
Q_WIDGETS_EXPORT bool hasAncestor(QObject *obj, QAccessible::Role role);
|
||||
#endif
|
||||
QColor backgroundColor(const QPalette &pal, const QWidget* widget = 0);
|
||||
QWindow *styleObjectWindow(QObject *so);
|
||||
Q_WIDGETS_EXPORT QColor backgroundColor(const QPalette &pal, const QWidget* widget = 0);
|
||||
Q_WIDGETS_EXPORT QWindow *styleObjectWindow(QObject *so);
|
||||
|
||||
enum WidgetSizePolicy { SizeSmall, SizeLarge, SizeMini, SizeDefault };
|
||||
|
||||
void setWidgetSizePolicy(const QWidget *w, WidgetSizePolicy policy);
|
||||
WidgetSizePolicy widgetSizePolicy(const QWidget *w, const QStyleOption *opt = 0);
|
||||
Q_WIDGETS_EXPORT WidgetSizePolicy widgetSizePolicy(const QWidget *w, const QStyleOption *opt = 0);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE
|
|||
|
||||
class QWindowsStylePrivate;
|
||||
|
||||
class QWindowsStyle : public QCommonStyle
|
||||
class Q_WIDGETS_EXPORT QWindowsStyle : public QCommonStyle
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE
|
|||
|
||||
class QTime;
|
||||
|
||||
class QWindowsStylePrivate : public QCommonStylePrivate
|
||||
class Q_WIDGETS_EXPORT QWindowsStylePrivate : public QCommonStylePrivate
|
||||
{
|
||||
Q_DECLARE_PUBLIC(QWindowsStyle)
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -37,22 +37,6 @@ RESOURCES += styles/qstyle.qrc
|
|||
|
||||
include($$OUT_PWD/qtwidgets-config.pri)
|
||||
|
||||
qtConfig(style-mac) {
|
||||
HEADERS += \
|
||||
styles/qmacstyle_mac_p.h \
|
||||
styles/qmacstyle_mac_p_p.h
|
||||
OBJECTIVE_SOURCES += styles/qmacstyle_mac.mm
|
||||
LIBS_PRIVATE += -framework Carbon
|
||||
}
|
||||
|
||||
qtConfig(style-windowsvista) {
|
||||
HEADERS += styles/qwindowsvistastyle_p.h styles/qwindowsvistastyle_p_p.h
|
||||
SOURCES += styles/qwindowsvistastyle.cpp
|
||||
|
||||
HEADERS += styles/qwindowsxpstyle_p.h styles/qwindowsxpstyle_p_p.h
|
||||
SOURCES += styles/qwindowsxpstyle.cpp
|
||||
}
|
||||
|
||||
qtConfig(style-windows) {
|
||||
HEADERS += styles/qwindowsstyle_p.h styles/qwindowsstyle_p_p.h
|
||||
SOURCES += styles/qwindowsstyle.cpp
|
||||
|
|
@ -62,8 +46,3 @@ qtConfig(style-fusion) {
|
|||
HEADERS += styles/qfusionstyle_p.h styles/qfusionstyle_p_p.h
|
||||
SOURCES += styles/qfusionstyle.cpp
|
||||
}
|
||||
|
||||
qtConfig(style-android) {
|
||||
HEADERS += styles/qandroidstyle_p.h
|
||||
SOURCES += styles/qandroidstyle.cpp
|
||||
}
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ private:
|
|||
bool fast;
|
||||
};
|
||||
|
||||
class Q_AUTOTEST_EXPORT QComboBoxPrivateContainer : public QFrame
|
||||
class Q_WIDGETS_EXPORT QComboBoxPrivateContainer : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ private:
|
|||
QPixmap m_pixmap;
|
||||
};
|
||||
|
||||
class QTabBarPrivate : public QWidgetPrivate
|
||||
class Q_WIDGETS_EXPORT QTabBarPrivate : public QWidgetPrivate
|
||||
{
|
||||
Q_DECLARE_PUBLIC(QTabBar)
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -2903,7 +2903,7 @@ void tst_QGraphicsView::scrollBarRanges()
|
|||
QFETCH(ExpectedValueDescription, vmax);
|
||||
QFETCH(bool, useStyledPanel);
|
||||
|
||||
if (useStyledPanel && style == "Macintosh" && platformName == QStringLiteral("cocoa"))
|
||||
if (useStyledPanel && style == "macintosh" && platformName == QStringLiteral("cocoa"))
|
||||
QSKIP("Insignificant on OSX");
|
||||
|
||||
QScopedPointer<QStyle> stylePtr;
|
||||
|
|
|
|||
|
|
@ -143,9 +143,6 @@ void tst_QStyle::testStyleFactory()
|
|||
#ifndef QT_NO_STYLE_WINDOWS
|
||||
QVERIFY(keys.contains("Windows"));
|
||||
#endif
|
||||
#ifdef Q_OS_WIN
|
||||
QVERIFY(keys.contains("WindowsVista"));
|
||||
#endif
|
||||
|
||||
foreach (QString styleName , keys) {
|
||||
QStyle *style = QStyleFactory::create(styleName);
|
||||
|
|
|
|||
Loading…
Reference in New Issue