Clean up style selection code
Turn styles into proper features and test for them using qtConfig/QT_CONFIG. Change-Id: I7e28785a46723364b90d8aa286f4d6e5ab085651 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>bb10
parent
e3555fe970
commit
7d12ef183e
|
|
@ -44,31 +44,31 @@
|
|||
},
|
||||
"style-fusion": {
|
||||
"label": "Fusion",
|
||||
"output": [ "styles" ]
|
||||
"output": [ "privateFeature", "styles" ]
|
||||
},
|
||||
"style-mac": {
|
||||
"label": "macOS",
|
||||
"condition": "config.osx",
|
||||
"output": [ "styles" ]
|
||||
"output": [ "privateFeature", "styles" ]
|
||||
},
|
||||
"style-windows": {
|
||||
"label": "Windows",
|
||||
"output": [ "styles" ]
|
||||
"output": [ "privateFeature", "styles" ]
|
||||
},
|
||||
"style-windowsxp": {
|
||||
"label": "WindowsXP",
|
||||
"condition": "features.style-windows && config.win32 && !config.winrt && tests.uxtheme",
|
||||
"output": [ "styles" ]
|
||||
"output": [ "privateFeature", "styles" ]
|
||||
},
|
||||
"style-windowsvista": {
|
||||
"label": "WindowsVista",
|
||||
"condition": "features.style-windowsxp",
|
||||
"output": [ "styles" ]
|
||||
"output": [ "privateFeature", "styles" ]
|
||||
},
|
||||
"style-android": {
|
||||
"label": "Android",
|
||||
"autoDetect": "config.android",
|
||||
"output": [ "styles" ]
|
||||
"output": [ "privateFeature", "styles" ]
|
||||
},
|
||||
"style-stylesheet": {
|
||||
"label": "QStyleSheetStyle",
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
#include "qwizard.h"
|
||||
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
||||
|
||||
#ifndef QT_NO_WIZARD
|
||||
|
||||
|
|
@ -61,7 +62,7 @@
|
|||
#include <QtCore/QMetaMethod>
|
||||
#include <QtGui/QGuiApplication>
|
||||
#include <qpa/qplatformnativeinterface.h>
|
||||
#elif !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#elif QT_CONFIG(style_windowsvista)
|
||||
#include "qwizard_win_p.h"
|
||||
#include "qtimer.h"
|
||||
#endif
|
||||
|
|
@ -295,7 +296,7 @@ public:
|
|||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
private:
|
||||
bool vistaDisabled() const;
|
||||
#endif
|
||||
|
|
@ -342,7 +343,7 @@ QWizardHeader::QWizardHeader(QWidget *parent)
|
|||
layout->addWidget(logoLabel, 1, 5, 5, 1);
|
||||
}
|
||||
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
bool QWizardHeader::vistaDisabled() const
|
||||
{
|
||||
bool styleDisabled = false;
|
||||
|
|
@ -362,7 +363,7 @@ void QWizardHeader::setup(const QWizardLayoutInfo &info, const QString &title,
|
|||
Qt::TextFormat titleFormat, Qt::TextFormat subTitleFormat)
|
||||
{
|
||||
bool modern = ((info.wizStyle == QWizard::ModernStyle)
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
|| ((info.wizStyle == QWizard::AeroStyle
|
||||
&& QVistaHelper::vistaState() == QVistaHelper::Classic) || vistaDisabled())
|
||||
#endif
|
||||
|
|
@ -525,7 +526,7 @@ void QWizardPagePrivate::_q_updateCachedCompleteState()
|
|||
class QWizardAntiFlickerWidget : public QWidget
|
||||
{
|
||||
public:
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
QWizardPrivate *wizardPrivate;
|
||||
QWizardAntiFlickerWidget(QWizard *wizard, QWizardPrivate *wizardPrivate)
|
||||
: QWidget(wizard)
|
||||
|
|
@ -572,7 +573,7 @@ public:
|
|||
, titleLabel(0)
|
||||
, subTitleLabel(0)
|
||||
, bottomRuler(0)
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
, vistaHelper(0)
|
||||
, vistaInitPending(false)
|
||||
, vistaState(QVistaHelper::Dirty)
|
||||
|
|
@ -586,7 +587,7 @@ public:
|
|||
{
|
||||
std::fill(btns, btns + QWizard::NButtons, static_cast<QAbstractButton *>(0));
|
||||
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA
|
||||
&& (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))
|
||||
vistaInitPending = true;
|
||||
|
|
@ -611,7 +612,7 @@ public:
|
|||
void setButtonLayout(const QWizard::WizardButton *array, int size);
|
||||
bool buttonLayoutContains(QWizard::WizardButton which);
|
||||
void updatePixmap(QWizard::WizardPixmap which);
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
bool vistaDisabled() const;
|
||||
bool isVistaThemeEnabled(QVistaHelper::VistaState state) const;
|
||||
bool handleAeroStyleChange();
|
||||
|
|
@ -677,7 +678,7 @@ public:
|
|||
QHBoxLayout *buttonLayout;
|
||||
QGridLayout *mainLayout;
|
||||
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
QVistaHelper *vistaHelper;
|
||||
bool vistaInitPending;
|
||||
QVistaHelper::VistaState vistaState;
|
||||
|
|
@ -692,7 +693,7 @@ public:
|
|||
|
||||
static QString buttonDefaultText(int wstyle, int which, const QWizardPrivate *wizardPrivate)
|
||||
{
|
||||
#if defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if !QT_CONFIG(style_windowsvista)
|
||||
Q_UNUSED(wizardPrivate);
|
||||
#endif
|
||||
const bool macStyle = (wstyle == QWizard::MacStyle);
|
||||
|
|
@ -730,7 +731,7 @@ void QWizardPrivate::init()
|
|||
opts = QWizard::HelpButtonOnRight;
|
||||
}
|
||||
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
vistaHelper = new QVistaHelper(q);
|
||||
#endif
|
||||
|
||||
|
|
@ -959,7 +960,7 @@ QWizardLayoutInfo QWizardPrivate::layoutInfoForCurrentPage()
|
|||
|
||||
info.wizStyle = wizStyle;
|
||||
if (info.wizStyle == QWizard::AeroStyle
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
&& (QVistaHelper::vistaState() == QVistaHelper::Classic || vistaDisabled())
|
||||
#endif
|
||||
)
|
||||
|
|
@ -1337,7 +1338,7 @@ void QWizardPrivate::updateMinMaxSizes(const QWizardLayoutInfo &info)
|
|||
Q_Q(QWizard);
|
||||
|
||||
int extraHeight = 0;
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
if (isVistaThemeEnabled())
|
||||
extraHeight = vistaHelper->titleBarSize() + vistaHelper->topOffset();
|
||||
#endif
|
||||
|
|
@ -1560,7 +1561,7 @@ void QWizardPrivate::updatePixmap(QWizard::WizardPixmap which)
|
|||
}
|
||||
}
|
||||
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
bool QWizardPrivate::vistaDisabled() const
|
||||
{
|
||||
Q_Q(const QWizard);
|
||||
|
|
@ -1642,7 +1643,7 @@ bool QWizardPrivate::handleAeroStyleChange()
|
|||
|
||||
bool QWizardPrivate::isVistaThemeEnabled() const
|
||||
{
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
return isVistaThemeEnabled(QVistaHelper::VistaAero)
|
||||
|| isVistaThemeEnabled(QVistaHelper::VistaBasic);
|
||||
#else
|
||||
|
|
@ -1720,7 +1721,7 @@ void QWizardPrivate::_q_updateButtonStates()
|
|||
if (QPushButton *finishPush = qobject_cast<QPushButton *>(btn.finish))
|
||||
finishPush->setDefault(!canContinue && useDefault);
|
||||
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
if (isVistaThemeEnabled()) {
|
||||
vistaHelper->backButton()->setEnabled(btn.back->isEnabled());
|
||||
vistaHelper->backButton()->setVisible(backButtonVisible);
|
||||
|
|
@ -1788,7 +1789,7 @@ QPixmap QWizardPrivate::findDefaultBackgroundPixmap()
|
|||
|
||||
#endif
|
||||
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
void QWizardAntiFlickerWidget::paintEvent(QPaintEvent *)
|
||||
{
|
||||
if (wizardPrivate->isVistaThemeEnabled()) {
|
||||
|
|
@ -2556,7 +2557,7 @@ void QWizard::setWizardStyle(WizardStyle style)
|
|||
|
||||
const bool styleChange = style != d->wizStyle;
|
||||
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
const bool aeroStyleChange =
|
||||
d->vistaInitPending || d->vistaStateChanged || (styleChange && (style == AeroStyle || d->wizStyle == AeroStyle));
|
||||
d->vistaStateChanged = false;
|
||||
|
|
@ -2564,14 +2565,14 @@ void QWizard::setWizardStyle(WizardStyle style)
|
|||
#endif
|
||||
|
||||
if (styleChange
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
|| aeroStyleChange
|
||||
#endif
|
||||
) {
|
||||
d->disableUpdates();
|
||||
d->wizStyle = style;
|
||||
d->updateButtonTexts();
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
if (aeroStyleChange) {
|
||||
//Send a resizeevent since the antiflicker widget probably needs a new size
|
||||
//because of the backbutton in the window title
|
||||
|
|
@ -2582,7 +2583,7 @@ void QWizard::setWizardStyle(WizardStyle style)
|
|||
d->updateLayout();
|
||||
updateGeometry();
|
||||
d->enableUpdates();
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
// Delay initialization when activating Aero style fails due to missing native window.
|
||||
if (aeroStyleChange && !d->handleAeroStyleChange() && d->wizStyle == AeroStyle)
|
||||
d->vistaInitPending = true;
|
||||
|
|
@ -2816,7 +2817,7 @@ void QWizard::setButton(WizardButton which, QAbstractButton *button)
|
|||
QAbstractButton *QWizard::button(WizardButton which) const
|
||||
{
|
||||
Q_D(const QWizard);
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
if (d->wizStyle == AeroStyle && which == BackButton)
|
||||
return d->vistaHelper->backButton();
|
||||
#endif
|
||||
|
|
@ -3176,7 +3177,7 @@ bool QWizard::event(QEvent *event)
|
|||
d->setStyle(style());
|
||||
d->updateLayout();
|
||||
}
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
else if (event->type() == QEvent::Show && d->vistaInitPending) {
|
||||
d->vistaInitPending = false;
|
||||
// Do not force AeroStyle when in Classic theme.
|
||||
|
|
@ -3211,7 +3212,7 @@ void QWizard::resizeEvent(QResizeEvent *event)
|
|||
{
|
||||
Q_D(QWizard);
|
||||
int heightOffset = 0;
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
if (d->isVistaThemeEnabled()) {
|
||||
heightOffset = d->vistaHelper->topOffset();
|
||||
if (d->isVistaThemeEnabled(QVistaHelper::VistaAero))
|
||||
|
|
@ -3219,7 +3220,7 @@ void QWizard::resizeEvent(QResizeEvent *event)
|
|||
}
|
||||
#endif
|
||||
d->antiFlickerWidget->resize(event->size().width(), event->size().height() - heightOffset);
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
if (d->isVistaThemeEnabled())
|
||||
d->vistaHelper->resizeEvent(event);
|
||||
#endif
|
||||
|
|
@ -3240,7 +3241,7 @@ void QWizard::paintEvent(QPaintEvent * event)
|
|||
QPainter painter(this);
|
||||
painter.drawPixmap(0, (height() - backgroundPixmap.height()) / 2, backgroundPixmap);
|
||||
}
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
else if (d->isVistaThemeEnabled()) {
|
||||
if (d->isVistaThemeEnabled(QVistaHelper::VistaBasic)) {
|
||||
QPainter painter(this);
|
||||
|
|
@ -3260,7 +3261,7 @@ void QWizard::paintEvent(QPaintEvent * event)
|
|||
*/
|
||||
bool QWizard::nativeEvent(const QByteArray &eventType, void *message, long *result)
|
||||
{
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
Q_D(QWizard);
|
||||
if (d->isVistaThemeEnabled() && eventType == "windows_generic_MSG") {
|
||||
MSG *windowsMessage = static_cast<MSG *>(message);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,10 @@
|
|||
****************************************************************************/
|
||||
|
||||
#ifndef QT_NO_WIZARD
|
||||
#ifndef QT_NO_STYLE_WINDOWSVISTA
|
||||
|
||||
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
||||
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
|
||||
#include "qwizard_win_p.h"
|
||||
#include <private/qapplication_p.h>
|
||||
|
|
@ -722,6 +725,6 @@ int QVistaHelper::topOffset()
|
|||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QT_NO_STYLE_WINDOWSVISTA
|
||||
#endif // style_windowsvista
|
||||
|
||||
#endif // QT_NO_WIZARD
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
||||
|
||||
#ifndef QT_NO_WIZARD
|
||||
#ifndef QT_NO_STYLE_WINDOWSVISTA
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
|
||||
#include <qobject.h>
|
||||
#include <qwidget.h>
|
||||
|
|
@ -156,6 +156,6 @@ private:
|
|||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QT_NO_STYLE_WINDOWSVISTA
|
||||
#endif // style_windowsvista
|
||||
#endif // QT_NO_WIZARD
|
||||
#endif // QWIZARD_WIN_P_H
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
#include <QtWidgets/qstyleoption.h>
|
||||
#include <QtWidgets/QStyleOptionTitleBar>
|
||||
#include <QtWidgets/QGraphicsSceneMouseEvent>
|
||||
#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ && !defined(QT_NO_STYLE_MAC)
|
||||
#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ && QT_CONFIG(style_mac)
|
||||
# include <private/qmacstyle_mac_p.h>
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -2194,7 +2194,7 @@ QModelIndex QTreeView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifie
|
|||
return QModelIndex();
|
||||
}
|
||||
int vi = -1;
|
||||
#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ && !defined(QT_NO_STYLE_MAC)
|
||||
#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ && QT_CONFIG(style_mac)
|
||||
// Selection behavior is slightly different on the Mac.
|
||||
if (d->selectionMode == QAbstractItemView::ExtendedSelection
|
||||
&& d->selectionModel
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
#include "qandroidstyle_p.h"
|
||||
|
||||
#if !defined(QT_NO_STYLE_ANDROID) || defined(QT_PLUGIN)
|
||||
#if QT_CONFIG(style_android) || defined(QT_PLUGIN)
|
||||
|
||||
#include <QFile>
|
||||
#include <QFont>
|
||||
|
|
@ -1807,4 +1807,4 @@ QRect QAndroidStyle::AndroidSpinnerControl::subControlRect(const QStyleOptionCom
|
|||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // !defined(QT_NO_STYLE_ANDROID) || defined(QT_PLUGIN)
|
||||
#endif // QT_CONFIG(style_android) || defined(QT_PLUGIN)
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@
|
|||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#if !defined(QT_NO_STYLE_ANDROID)
|
||||
#if QT_CONFIG(style_android)
|
||||
|
||||
class Q_WIDGETS_EXPORT QAndroidStyle : public QFusionStyle
|
||||
{
|
||||
|
|
@ -388,7 +388,7 @@ private:
|
|||
AndroidCompoundButtonControl *checkBoxControl;
|
||||
};
|
||||
|
||||
#endif // QT_NO_STYLE_ANDROID
|
||||
#endif // style_android
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
#include "qfusionstyle_p.h"
|
||||
#include "qfusionstyle_p_p.h"
|
||||
|
||||
#if !defined(QT_NO_STYLE_FUSION) || defined(QT_PLUGIN)
|
||||
#if QT_CONFIG(style_fusion) || defined(QT_PLUGIN)
|
||||
#include "qcommonstyle_p.h"
|
||||
#include <qcombobox.h>
|
||||
#include <qpushbutton.h>
|
||||
|
|
@ -3746,4 +3746,4 @@ QT_END_NAMESPACE
|
|||
|
||||
#include "moc_qfusionstyle_p.cpp"
|
||||
|
||||
#endif // QT_NO_STYLE_FUSION || QT_PLUGIN
|
||||
#endif // style_fusion|| QT_PLUGIN
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#if !defined(QT_NO_STYLE_FUSION)
|
||||
#if QT_CONFIG(style_fusion)
|
||||
|
||||
class QFusionStylePrivate;
|
||||
class QFusionStyle : public QCommonStyle
|
||||
|
|
@ -110,7 +110,7 @@ protected:
|
|||
|
||||
};
|
||||
|
||||
#endif // QT_NO_STYLE_FUSION
|
||||
#endif // style_fusion
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
#include <qpa/qplatformtheme.h>
|
||||
#include "private/qguiapplication_p.h"
|
||||
|
||||
#ifndef QT_NO_STYLE_FUSION
|
||||
#if QT_CONFIG(style_fusion)
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
|
@ -147,6 +147,6 @@ public:
|
|||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QT_NO_STYLE_FUSION
|
||||
#endif // style_fusion
|
||||
|
||||
#endif //QFUSIONSTYLE_P_P_H
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
|
||||
#if QT_CONFIG(style_mac)
|
||||
|
||||
class QPalette;
|
||||
|
||||
|
|
|
|||
|
|
@ -44,20 +44,20 @@
|
|||
|
||||
#include "qapplication.h"
|
||||
#include "qwindowsstyle_p.h"
|
||||
#ifndef QT_NO_STYLE_FUSION
|
||||
#if QT_CONFIG(style_fusion)
|
||||
#include "qfusionstyle_p.h"
|
||||
#ifndef QT_NO_STYLE_ANDROID
|
||||
#if QT_CONFIG(style_android)
|
||||
#include "qandroidstyle_p.h"
|
||||
#endif
|
||||
#endif
|
||||
#ifndef QT_NO_STYLE_WINDOWSXP
|
||||
#if QT_CONFIG(style_windowsxp)
|
||||
#include "qwindowsxpstyle_p.h"
|
||||
#endif
|
||||
#ifndef QT_NO_STYLE_WINDOWSVISTA
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
#include "qwindowsvistastyle_p.h"
|
||||
#endif
|
||||
|
||||
#if !defined(QT_NO_STYLE_MAC) && defined(Q_OS_MAC)
|
||||
#if QT_CONFIG(style_mac)
|
||||
# include "qmacstyle_mac_p.h"
|
||||
#endif
|
||||
|
||||
|
|
@ -103,32 +103,32 @@ QStyle *QStyleFactory::create(const QString& key)
|
|||
{
|
||||
QStyle *ret = 0;
|
||||
QString style = key.toLower();
|
||||
#ifndef QT_NO_STYLE_WINDOWS
|
||||
#if QT_CONFIG(style_windows)
|
||||
if (style == QLatin1String("windows"))
|
||||
ret = new QWindowsStyle;
|
||||
else
|
||||
#endif
|
||||
#ifndef QT_NO_STYLE_WINDOWSXP
|
||||
#if QT_CONFIG(style_windowsxp)
|
||||
if (style == QLatin1String("windowsxp"))
|
||||
ret = new QWindowsXPStyle;
|
||||
else
|
||||
#endif
|
||||
#ifndef QT_NO_STYLE_WINDOWSVISTA
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
if (style == QLatin1String("windowsvista"))
|
||||
ret = new QWindowsVistaStyle;
|
||||
else
|
||||
#endif
|
||||
#ifndef QT_NO_STYLE_FUSION
|
||||
#if QT_CONFIG(style_fusion)
|
||||
if (style == QLatin1String("fusion"))
|
||||
ret = new QFusionStyle;
|
||||
else
|
||||
#endif
|
||||
#ifndef QT_NO_STYLE_ANDROID
|
||||
#if QT_CONFIG(style_android)
|
||||
if (style == QLatin1String("android"))
|
||||
ret = new QAndroidStyle;
|
||||
else
|
||||
#endif
|
||||
#ifndef QT_NO_STYLE_MAC
|
||||
#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
|
||||
|
|
@ -160,29 +160,29 @@ QStringList QStyleFactory::keys()
|
|||
const PluginKeyMap::const_iterator cend = keyMap.constEnd();
|
||||
for (PluginKeyMap::const_iterator it = keyMap.constBegin(); it != cend; ++it)
|
||||
list.append(it.value());
|
||||
#ifndef QT_NO_STYLE_WINDOWS
|
||||
#if QT_CONFIG(style_windows)
|
||||
if (!list.contains(QLatin1String("Windows")))
|
||||
list << QLatin1String("Windows");
|
||||
#endif
|
||||
#ifndef QT_NO_STYLE_WINDOWSXP
|
||||
#if QT_CONFIG(style_windowsxp)
|
||||
if (!list.contains(QLatin1String("WindowsXP")) &&
|
||||
(QSysInfo::WindowsVersion >= QSysInfo::WV_XP && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)))
|
||||
list << QLatin1String("WindowsXP");
|
||||
#endif
|
||||
#ifndef QT_NO_STYLE_WINDOWSVISTA
|
||||
#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
|
||||
#ifndef QT_NO_STYLE_ANDROID
|
||||
#if QT_CONFIG(style_android)
|
||||
if (!list.contains(QLatin1String("Android")))
|
||||
list << QLatin1String("Android");
|
||||
#endif
|
||||
#ifndef QT_NO_STYLE_FUSION
|
||||
#if QT_CONFIG(style_fusion)
|
||||
if (!list.contains(QLatin1String("Fusion")))
|
||||
list << QLatin1String("Fusion");
|
||||
#endif
|
||||
#ifndef QT_NO_STYLE_MAC
|
||||
#if QT_CONFIG(style_mac)
|
||||
QString mstyle = QLatin1String("Macintosh");
|
||||
# if 0 // Used to be included in Qt4 for Q_WS_MAC
|
||||
mstyle += QLatin1String(" (aqua)");
|
||||
|
|
|
|||
|
|
@ -37,9 +37,10 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
||||
#include "qstyleoption.h"
|
||||
#include "qapplication.h"
|
||||
#ifdef Q_OS_MAC
|
||||
#if QT_CONFIG(style_mac)
|
||||
# include "qmacstyle_mac_p.h"
|
||||
#endif
|
||||
#include <qdebug.h>
|
||||
|
|
@ -204,7 +205,7 @@ void QStyleOption::init(const QWidget *widget)
|
|||
if (!(state & QStyle::State_Active) && !qt_mac_can_clickThrough(widget))
|
||||
state &= ~QStyle::State_Enabled;
|
||||
#endif
|
||||
#if defined(Q_OS_OSX) && !defined(QT_NO_STYLE_MAC)
|
||||
#if QT_CONFIG(style_mac)
|
||||
switch (QMacStyle::widgetSizePolicy(widget)) {
|
||||
case QMacStyle::SizeSmall:
|
||||
state |= QStyle::State_Small;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
#include "qwindowsstyle_p.h"
|
||||
#include "qwindowsstyle_p_p.h"
|
||||
|
||||
#if !defined(QT_NO_STYLE_WINDOWS) || defined(QT_PLUGIN)
|
||||
#if QT_CONFIG(style_windows) || defined(QT_PLUGIN)
|
||||
|
||||
#include "qapplication.h"
|
||||
#include "qbitmap.h"
|
||||
|
|
@ -2407,4 +2407,4 @@ QT_END_NAMESPACE
|
|||
|
||||
#include "moc_qwindowsstyle_p.cpp"
|
||||
|
||||
#endif // QT_NO_STYLE_WINDOWS
|
||||
#endif // style_windows
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#if !defined(QT_NO_STYLE_WINDOWS)
|
||||
#if QT_CONFIG(style_windows)
|
||||
|
||||
class QWindowsStylePrivate;
|
||||
|
||||
|
|
@ -106,7 +106,7 @@ private:
|
|||
Q_DECLARE_PRIVATE(QWindowsStyle)
|
||||
};
|
||||
|
||||
#endif // QT_NO_STYLE_WINDOWS
|
||||
#endif // style_windows
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@
|
|||
#include "qwindowsstyle_p.h"
|
||||
#include "qcommonstyle_p.h"
|
||||
|
||||
#ifndef QT_NO_STYLE_WINDOWS
|
||||
#if QT_CONFIG(style_windows)
|
||||
#include <qlist.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
|
@ -103,7 +103,7 @@ private:
|
|||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QT_NO_STYLE_WINDOWS
|
||||
#endif // style_windows
|
||||
|
||||
#endif //QWINDOWSSTYLE_P_P_H
|
||||
;
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
#include <private/qapplication_p.h>
|
||||
#include <qpa/qplatformnativeinterface.h>
|
||||
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA) || defined(QT_PLUGIN)
|
||||
#if QT_CONFIG(style_windowsvista) || defined(QT_PLUGIN)
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
|
||||
class QWindowsVistaStylePrivate;
|
||||
class QWindowsVistaStyle : public QWindowsXPStyle
|
||||
|
|
@ -103,7 +103,7 @@ private:
|
|||
Q_DECLARE_PRIVATE(QWindowsVistaStyle)
|
||||
friend class QStyleFactory;
|
||||
};
|
||||
#endif //QT_NO_STYLE_WINDOWSVISTA
|
||||
#endif // style_windowsvista
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
||||
#include "qwindowsvistastyle_p.h"
|
||||
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
#if QT_CONFIG(style_windowsvista)
|
||||
#include <private/qwindowsxpstyle_p_p.h>
|
||||
#include <private/qstyleanimation_p.h>
|
||||
#include <private/qpaintengine_raster_p.h>
|
||||
|
|
@ -177,6 +177,6 @@ public:
|
|||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QT_NO_STYLE_WINDOWSVISTA
|
||||
#endif // style_windowsvista
|
||||
|
||||
#endif // QWINDOWSVISTASTYLE_P_P_H
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
#include "qwindowsxpstyle_p.h"
|
||||
#include "qwindowsxpstyle_p_p.h"
|
||||
|
||||
#if !defined(QT_NO_STYLE_WINDOWSXP) || defined(QT_PLUGIN)
|
||||
#if QT_CONFIG(style_windowsxp) || defined(QT_PLUGIN)
|
||||
|
||||
#include <private/qobject_p.h>
|
||||
#include <private/qpaintengine_raster_p.h>
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#if !defined(QT_NO_STYLE_WINDOWSXP)
|
||||
#if QT_CONFIG(style_windowsxp)
|
||||
|
||||
class QWindowsXPStylePrivate;
|
||||
class QWindowsXPStyle : public QWindowsStyle
|
||||
|
|
@ -102,7 +102,7 @@ private:
|
|||
friend class QStyleFactory;
|
||||
};
|
||||
|
||||
#endif // QT_NO_STYLE_WINDOWSXP
|
||||
#endif // style_windowsxp
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ QT_BEGIN_NAMESPACE
|
|||
// Uncomment define below to build debug assisting code, and output
|
||||
// #define DEBUG_XP_STYLE
|
||||
|
||||
#if !defined(QT_NO_STYLE_WINDOWSXP)
|
||||
#if QT_CONFIG(style_windowsxp)
|
||||
|
||||
// Declarations -----------------------------------------------------------------------------------
|
||||
class XPThemeData
|
||||
|
|
@ -338,7 +338,7 @@ inline QMarginsF XPThemeData::themeMargins(const QWidget *w, QPainter *p, int th
|
|||
return theme.margins(propId);
|
||||
}
|
||||
|
||||
#endif // QT_NO_STYLE_WINDOWS
|
||||
#endif // style_windows
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
|
|
|
|||
|
|
@ -37,51 +37,35 @@ RESOURCES += styles/qstyle.qrc
|
|||
|
||||
include($$OUT_PWD/qtwidgets-config.pri)
|
||||
|
||||
contains( styles, mac ) {
|
||||
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
|
||||
} else {
|
||||
DEFINES += QT_NO_STYLE_MAC
|
||||
}
|
||||
|
||||
contains( styles, windowsvista ) {
|
||||
HEADERS += styles/qwindowsvistastyle_p.h
|
||||
HEADERS += styles/qwindowsvistastyle_p_p.h
|
||||
qtConfig(style-windowsvista) {
|
||||
HEADERS += styles/qwindowsvistastyle_p.h styles/qwindowsvistastyle_p_p.h
|
||||
SOURCES += styles/qwindowsvistastyle.cpp
|
||||
} else {
|
||||
DEFINES += QT_NO_STYLE_WINDOWSVISTA
|
||||
}
|
||||
|
||||
contains( styles, windowsxp ) {
|
||||
HEADERS += styles/qwindowsxpstyle_p.h
|
||||
HEADERS += styles/qwindowsxpstyle_p_p.h
|
||||
qtConfig(style-windowsxp) {
|
||||
HEADERS += styles/qwindowsxpstyle_p.h styles/qwindowsxpstyle_p_p.h
|
||||
SOURCES += styles/qwindowsxpstyle.cpp
|
||||
} else {
|
||||
DEFINES += QT_NO_STYLE_WINDOWSXP
|
||||
}
|
||||
|
||||
contains( styles, windows ) {
|
||||
HEADERS += styles/qwindowsstyle_p.h
|
||||
HEADERS += styles/qwindowsstyle_p_p.h
|
||||
qtConfig(style-windows) {
|
||||
HEADERS += styles/qwindowsstyle_p.h styles/qwindowsstyle_p_p.h
|
||||
SOURCES += styles/qwindowsstyle.cpp
|
||||
} else {
|
||||
DEFINES += QT_NO_STYLE_WINDOWS
|
||||
}
|
||||
|
||||
contains( styles, fusion ) {
|
||||
HEADERS += styles/qfusionstyle_p.h
|
||||
HEADERS += styles/qfusionstyle_p_p.h
|
||||
SOURCES += styles/qfusionstyle.cpp
|
||||
} else {
|
||||
DEFINES += QT_NO_STYLE_FUSION
|
||||
qtConfig(style-fusion) {
|
||||
HEADERS += styles/qfusionstyle_p.h styles/qfusionstyle_p_p.h
|
||||
SOURCES += styles/qfusionstyle.cpp
|
||||
}
|
||||
|
||||
contains( styles, android ) {
|
||||
qtConfig(style-android) {
|
||||
HEADERS += styles/qandroidstyle_p.h
|
||||
SOURCES += styles/qandroidstyle.cpp
|
||||
} else {
|
||||
DEFINES += QT_NO_STYLE_ANDROID
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@
|
|||
#include <private/qabstractitemmodel_p.h>
|
||||
#include <private/qabstractscrollarea_p.h>
|
||||
#include <qdebug.h>
|
||||
#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ && !defined(QT_NO_EFFECTS) && !defined(QT_NO_STYLE_MAC)
|
||||
#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ && !defined(QT_NO_EFFECTS) && QT_CONFIG(style_mac)
|
||||
#include <private/qcore_mac_p.h>
|
||||
#include <private/qmacstyle_mac_p.h>
|
||||
#include <private/qt_cocoa_helpers_mac_p.h>
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@
|
|||
|
||||
#include <QApplication>
|
||||
#include <QStyle>
|
||||
#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ && !defined(QT_NO_STYLE_MAC)
|
||||
#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ && QT_CONFIG(style_mac)
|
||||
#include <private/qmacstyle_mac_p.h>
|
||||
#endif
|
||||
#include <QChildEvent>
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@
|
|||
#include <QMainWindow>
|
||||
#include <QScrollBar>
|
||||
#include <QDebug>
|
||||
#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
|
||||
#if QT_CONFIG(style_mac)
|
||||
#include <private/qmacstyle_mac_p.h>
|
||||
#endif
|
||||
#include <QMdiArea>
|
||||
|
|
@ -295,7 +295,7 @@ static void showToolTip(QHelpEvent *helpEvent, QWidget *widget, const QStyleOpti
|
|||
Q_ASSERT(helpEvent->type() == QEvent::ToolTip);
|
||||
Q_ASSERT(widget);
|
||||
|
||||
#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
|
||||
#if QT_CONFIG(style_mac)
|
||||
// Native Mac windows don't show tool tip.
|
||||
if (qobject_cast<QMacStyle *>(widget->style()))
|
||||
return;
|
||||
|
|
@ -1076,7 +1076,7 @@ void QMdiSubWindowPrivate::updateCursor()
|
|||
{
|
||||
#ifndef QT_NO_CURSOR
|
||||
Q_Q(QMdiSubWindow);
|
||||
#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
|
||||
#if QT_CONFIG(style_mac)
|
||||
if (qobject_cast<QMacStyle *>(q->style()))
|
||||
return;
|
||||
#endif
|
||||
|
|
@ -1504,7 +1504,7 @@ void QMdiSubWindowPrivate::processClickedSubControl()
|
|||
q->showNormal();
|
||||
break;
|
||||
case QStyle::SC_TitleBarMinButton:
|
||||
#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
|
||||
#if QT_CONFIG(style_mac)
|
||||
if (qobject_cast<QMacStyle *>(q->style())) {
|
||||
if (q->isMinimized())
|
||||
q->showNormal();
|
||||
|
|
@ -1521,7 +1521,7 @@ void QMdiSubWindowPrivate::processClickedSubControl()
|
|||
q->showNormal();
|
||||
break;
|
||||
case QStyle::SC_TitleBarMaxButton:
|
||||
#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
|
||||
#if QT_CONFIG(style_mac)
|
||||
if (qobject_cast<QMacStyle *>(q->style())) {
|
||||
if (q->isMaximized())
|
||||
q->showNormal();
|
||||
|
|
@ -1568,7 +1568,7 @@ QRegion QMdiSubWindowPrivate::getRegion(Operation operation) const
|
|||
}
|
||||
|
||||
QRegion region;
|
||||
#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
|
||||
#if QT_CONFIG(style_mac)
|
||||
if (qobject_cast<QMacStyle *>(q->style()))
|
||||
return region;
|
||||
#endif
|
||||
|
|
@ -1775,7 +1775,7 @@ bool QMdiSubWindowPrivate::drawTitleBarWhenMaximized() const
|
|||
if (isChildOfTabbedQMdiArea(q))
|
||||
return false;
|
||||
|
||||
#if defined(Q_OS_DARWIN) && !defined(QT_NO_STYLE_MAC)
|
||||
#if QT_CONFIG(style_mac)
|
||||
Q_UNUSED(isChildOfQMdiSubWindow);
|
||||
return true;
|
||||
#else
|
||||
|
|
@ -2191,7 +2191,7 @@ void QMdiSubWindowPrivate::setSizeGrip(QSizeGrip *newSizeGrip)
|
|||
return;
|
||||
newSizeGrip->setFixedSize(newSizeGrip->sizeHint());
|
||||
bool putSizeGripInLayout = layout ? true : false;
|
||||
#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
|
||||
#if QT_CONFIG(style_mac)
|
||||
if (qobject_cast<QMacStyle *>(q->style()))
|
||||
putSizeGripInLayout = false;
|
||||
#endif
|
||||
|
|
@ -2843,7 +2843,7 @@ bool QMdiSubWindow::event(QEvent *event)
|
|||
d->isMaximizeMode = false;
|
||||
d->isWidgetHiddenByUs = false;
|
||||
if (!parent()) {
|
||||
#if !defined(QT_NO_SIZEGRIP) && defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
|
||||
#if !defined(QT_NO_SIZEGRIP) && QT_CONFIG(style_mac)
|
||||
if (qobject_cast<QMacStyle *>(style()))
|
||||
delete d->sizeGrip;
|
||||
#endif
|
||||
|
|
@ -2938,7 +2938,7 @@ void QMdiSubWindow::showEvent(QShowEvent *showEvent)
|
|||
return;
|
||||
}
|
||||
|
||||
#if !defined(QT_NO_SIZEGRIP) && defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
|
||||
#if !defined(QT_NO_SIZEGRIP) && QT_CONFIG(style_mac)
|
||||
if (qobject_cast<QMacStyle *>(style()) && !d->sizeGrip
|
||||
&& !(windowFlags() & Qt::FramelessWindowHint)) {
|
||||
d->setSizeGrip(new QSizeGrip(this));
|
||||
|
|
@ -3333,7 +3333,7 @@ void QMdiSubWindow::mouseMoveEvent(QMouseEvent *mouseEvent)
|
|||
hoverRegion += style()->subControlRect(QStyle::CC_TitleBar, &options,
|
||||
d->hoveredSubControl, this);
|
||||
}
|
||||
#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
|
||||
#if QT_CONFIG(style_mac)
|
||||
if (qobject_cast<QMacStyle *>(style()) && !hoverRegion.isEmpty())
|
||||
hoverRegion += QRegion(0, 0, width(), d->titleBarHeight(options));
|
||||
#endif
|
||||
|
|
@ -3543,7 +3543,7 @@ QSize QMdiSubWindow::minimumSizeHint() const
|
|||
int sizeGripHeight = 0;
|
||||
if (d->sizeGrip && d->sizeGrip->isVisibleTo(const_cast<QMdiSubWindow *>(this)))
|
||||
sizeGripHeight = d->sizeGrip->height();
|
||||
#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
|
||||
#if QT_CONFIG(style_mac)
|
||||
else if (parent() && qobject_cast<QMacStyle *>(style()) && !d->sizeGrip)
|
||||
sizeGripHeight = style()->pixelMetric(QStyle::PM_SizeGripSize, 0, this);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue