Windows Vista/XP Styles: Clean up some code
Remove public constructor of QWindowsXPStyle since it cannot be instantiated via style factory since 5.0. Remove overridden functions that merely call the base implementation. Change-Id: I3b2998115c4ab65fabf3744874bc3a69a1f5e5b0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
18bd226564
commit
d37b353e5d
@ -2285,22 +2285,6 @@ int QWindowsVistaStyle::pixelMetric(PixelMetric metric, const QStyleOption *opti
|
||||
return QWindowsXPStyle::pixelMetric(metric, option, widget);
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
*/
|
||||
QPalette QWindowsVistaStyle::standardPalette() const
|
||||
{
|
||||
return QWindowsXPStyle::standardPalette();
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
*/
|
||||
void QWindowsVistaStyle::polish(QApplication *app)
|
||||
{
|
||||
QWindowsXPStyle::polish(app);
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
*/
|
||||
@ -2408,15 +2392,6 @@ void QWindowsVistaStyle::unpolish(QWidget *widget)
|
||||
#endif // QT_CONFIG(commandlinkbutton)
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\internal
|
||||
*/
|
||||
void QWindowsVistaStyle::unpolish(QApplication *app)
|
||||
{
|
||||
QWindowsXPStyle::unpolish(app);
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
*/
|
||||
@ -2438,11 +2413,6 @@ QPixmap QWindowsVistaStyle::standardPixmap(StandardPixmap standardPixmap, const
|
||||
return QWindowsXPStyle::standardPixmap(standardPixmap, option, widget);
|
||||
}
|
||||
|
||||
QWindowsVistaStylePrivate::QWindowsVistaStylePrivate() :
|
||||
QWindowsXPStylePrivate()
|
||||
{
|
||||
}
|
||||
|
||||
bool QWindowsVistaStylePrivate::transitionsEnabled() const
|
||||
{
|
||||
BOOL animEnabled = false;
|
||||
|
@ -94,9 +94,6 @@ public:
|
||||
void polish(QWidget *widget) override;
|
||||
void unpolish(QWidget *widget) override;
|
||||
void polish(QPalette &pal) override;
|
||||
void polish(QApplication *app) override;
|
||||
void unpolish(QApplication *app) override;
|
||||
QPalette standardPalette() const override;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY_MOVE(QWindowsVistaStyle)
|
||||
|
@ -192,8 +192,6 @@ class QWindowsVistaStylePrivate : public QWindowsXPStylePrivate
|
||||
Q_DECLARE_PUBLIC(QWindowsVistaStyle)
|
||||
|
||||
public:
|
||||
QWindowsVistaStylePrivate();
|
||||
|
||||
static int fixedPixelMetric(QStyle::PixelMetric pm);
|
||||
static inline bool useVista();
|
||||
bool transitionsEnabled() const;
|
||||
|
@ -215,8 +215,9 @@ static HRGN qt_hrgn_from_qregion(const QRegion ®ion)
|
||||
}
|
||||
|
||||
/* \internal
|
||||
Checks if the theme engine can/should be used, or if we should
|
||||
fall back to Windows style.
|
||||
Checks if the theme engine can/should be used, or if we should fall back
|
||||
to Windows style. For Windows 10, this will still return false for the
|
||||
High Contrast themes.
|
||||
*/
|
||||
bool QWindowsXPStylePrivate::useXP(bool update)
|
||||
{
|
||||
@ -1104,10 +1105,11 @@ bool QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(XPThemeData &themeDa
|
||||
*/
|
||||
|
||||
/*!
|
||||
Constructs a QWindowsStyle
|
||||
\internal
|
||||
|
||||
Constructs a QWindowsXPStyle object.
|
||||
*/
|
||||
QWindowsXPStyle::QWindowsXPStyle()
|
||||
: QWindowsStyle(*new QWindowsXPStylePrivate)
|
||||
QWindowsXPStyle::QWindowsXPStyle(QWindowsXPStylePrivate &dd) : QWindowsStyle(dd)
|
||||
{
|
||||
}
|
||||
|
||||
@ -1116,20 +1118,6 @@ QWindowsXPStyle::QWindowsXPStyle()
|
||||
*/
|
||||
QWindowsXPStyle::~QWindowsXPStyle() = default;
|
||||
|
||||
/*! \reimp */
|
||||
void QWindowsXPStyle::unpolish(QApplication *app)
|
||||
{
|
||||
QWindowsStyle::unpolish(app);
|
||||
}
|
||||
|
||||
/*! \reimp */
|
||||
void QWindowsXPStyle::polish(QApplication *app)
|
||||
{
|
||||
QWindowsStyle::polish(app);
|
||||
if (!QWindowsXPStylePrivate::useXP())
|
||||
return;
|
||||
}
|
||||
|
||||
/*! \reimp */
|
||||
void QWindowsXPStyle::polish(QWidget *widget)
|
||||
{
|
||||
@ -3862,15 +3850,6 @@ QIcon QWindowsXPStyle::standardIcon(StandardPixmap standardIcon,
|
||||
return QWindowsStyle::standardIcon(standardIcon, option, widget);
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
|
||||
Constructs a QWindowsXPStyle object.
|
||||
*/
|
||||
QWindowsXPStyle::QWindowsXPStyle(QWindowsXPStylePrivate &dd) : QWindowsStyle(dd)
|
||||
{
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
QDebug operator<<(QDebug d, const XPThemeData &t)
|
||||
{
|
||||
|
@ -61,12 +61,8 @@ class QWindowsXPStyle : public QWindowsStyle
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QWindowsXPStyle();
|
||||
QWindowsXPStyle(QWindowsXPStylePrivate &dd);
|
||||
~QWindowsXPStyle() override;
|
||||
|
||||
void unpolish(QApplication*) override;
|
||||
void polish(QApplication*) override;
|
||||
void polish(QWidget*) override;
|
||||
void polish(QPalette&) override;
|
||||
void unpolish(QWidget*) override;
|
||||
@ -95,6 +91,9 @@ public:
|
||||
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option = nullptr,
|
||||
const QWidget *widget = nullptr) const override;
|
||||
|
||||
protected:
|
||||
QWindowsXPStyle(QWindowsXPStylePrivate &dd);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY_MOVE(QWindowsXPStyle)
|
||||
Q_DECLARE_PRIVATE(QWindowsXPStyle)
|
||||
|
Loading…
x
Reference in New Issue
Block a user