tst_QGridLayout: use QProxyStyle instead of QWindowsStyle
QWindowsStyle is soon to become an internal class. Change-Id: If163aae6910c0b082a9bcca1ebbab66660cc005f Reviewed-by: Caroline Chao <caroline.chao@digia.com>
This commit is contained in:
parent
7caaab5262
commit
8e7135c894
@ -44,14 +44,13 @@
|
||||
#include <qlayout.h>
|
||||
#include <qapplication.h>
|
||||
#include <qwidget.h>
|
||||
#include <qwindowsstyle.h>
|
||||
#include <qproxystyle.h>
|
||||
#include <qsizepolicy.h>
|
||||
//#include <QtGui>
|
||||
|
||||
#include <QtWidgets/QLabel>
|
||||
#include <QtWidgets/QLineEdit>
|
||||
#include <QtWidgets/QRadioButton>
|
||||
#include <QtWidgets/QWindowsStyle>
|
||||
#include <QStyleFactory>
|
||||
|
||||
class tst_QGridLayout : public QObject
|
||||
@ -458,11 +457,11 @@ void tst_QGridLayout::spacingAndSpacers()
|
||||
}
|
||||
|
||||
|
||||
class Qt42Style : public QWindowsStyle
|
||||
class Qt42Style : public QProxyStyle
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Qt42Style() : QWindowsStyle()
|
||||
Qt42Style() : QProxyStyle(QStyleFactory::create("windows"))
|
||||
{
|
||||
spacing = 6;
|
||||
margin = 9;
|
||||
@ -494,7 +493,7 @@ int Qt42Style::pixelMetric(PixelMetric metric, const QStyleOption * option /*= 0
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return QWindowsStyle::pixelMetric(metric, option, widget);
|
||||
return QProxyStyle::pixelMetric(metric, option, widget);
|
||||
}
|
||||
|
||||
|
||||
@ -915,11 +914,11 @@ void tst_QGridLayout::minMaxSize()
|
||||
}
|
||||
|
||||
|
||||
class CustomLayoutStyle : public QWindowsStyle
|
||||
class CustomLayoutStyle : public QProxyStyle
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CustomLayoutStyle() : QWindowsStyle()
|
||||
CustomLayoutStyle() : QProxyStyle(QStyleFactory::create("windows"))
|
||||
{
|
||||
hspacing = 5;
|
||||
vspacing = 10;
|
||||
@ -961,7 +960,7 @@ QRect CustomLayoutStyle::subElementRect(SubElement sr, const QStyleOption *opt,
|
||||
}
|
||||
}
|
||||
if (rect.isNull())
|
||||
rect = QWindowsStyle::subElementRect(sr, opt, widget);
|
||||
rect = QProxyStyle::subElementRect(sr, opt, widget);
|
||||
return rect;
|
||||
}
|
||||
|
||||
@ -1016,7 +1015,7 @@ int CustomLayoutStyle::pixelMetric(PixelMetric metric, const QStyleOption * opti
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return QWindowsStyle::pixelMetric(metric, option, widget);
|
||||
return QProxyStyle::pixelMetric(metric, option, widget);
|
||||
}
|
||||
|
||||
void tst_QGridLayout::styleDependentSpacingsAndMargins_data()
|
||||
|
Loading…
x
Reference in New Issue
Block a user