diff options
author | J-P Nurmi <jpnurmi@gmail.com> | 2012-11-17 00:52:26 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-23 15:18:15 +0100 |
commit | 27aa41cbba6c0bd76148fde63863cfbba0ec2456 (patch) | |
tree | d49ef13e32d9294c30c7e2017beee3ff71264c0c /tests/auto/widgets/widgets | |
parent | d25572cc7b1dc414d2c0b1b575334f8152346a31 (diff) |
Made QMacStyle internal
We will take this opportynity to remove various QStyle specializations
from the public API in Qt5. This gives us much more freedom, for
example changing the inheritance hierarchy, pluginizing etc. without
worrying about BC.
=> Use QStyleFactory and/or QProxyStyle instead of creating an instance
or inheriting QMacStyle directly.
Change-Id: I44a2f5ee3fe08ecc837b593a2a2737eb90e8c267
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'tests/auto/widgets/widgets')
3 files changed, 4 insertions, 11 deletions
diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp index af14ad13d3..4f390fa2c8 100644 --- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp @@ -60,9 +60,6 @@ #include <qtablewidget.h> #include <qscrollbar.h> #include <qboxlayout.h> -#ifdef Q_OS_MAC -#include <qmacstyle_mac.h> -#endif #include <qstandarditemmodel.h> #include <qstringlistmodel.h> @@ -450,7 +447,7 @@ void tst_QComboBox::setEditable() void tst_QComboBox::setPalette() { #ifdef Q_OS_MAC - if (qobject_cast<QMacStyle *>(testWidget->style())) { + if (testWidget->style()->inherits("QMacStyle")) { QSKIP("This test doesn't make sense for pixmap-based styles"); } #endif diff --git a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp index 51a49f467d..5aa7b19917 100644 --- a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp +++ b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp @@ -60,7 +60,6 @@ #ifndef QT_NO_OPENGL #include <QtOpenGL> #endif -#include <QMacStyle> #include <QStyleHints> static const Qt::WindowFlags DefaultWindowFlags @@ -195,7 +194,7 @@ static bool verifyArrangement(QMdiArea *mdiArea, Arrangement arrangement, const int titleBarHeight = firstSubWindow->style()->pixelMetric(QStyle::PM_TitleBarHeight, &options); #ifdef Q_OS_MAC // ### Remove this after the mac style has been fixed - if (qobject_cast<QMacStyle *>(firstSubWindow->style())) + if (firstSubWindow->style()->inherits("QMacStyle")) titleBarHeight -= 4; #endif const QFontMetrics fontMetrics = QFontMetrics(QApplication::font("QMdiSubWindowTitleBar")); diff --git a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp index caf030e3b6..4b2124e8d4 100644 --- a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp +++ b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp @@ -59,9 +59,6 @@ #include <QStyleOptionTitleBar> #include <QPushButton> #include <QSizeGrip> -#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC) -#include <QMacStyle> -#endif #include "../../../qtest-config.h" @@ -598,7 +595,7 @@ void tst_QMdiSubWindow::showShaded() QPoint mousePosition(window->width() - qMax(offset, 2), window->height() - qMax(offset, 2)); QWidget *mouseReceiver = 0; #ifdef Q_OS_MAC - if (qobject_cast<QMacStyle*>(window->style())) + if (window->style()->inherits("QMacStyle")) mouseReceiver = qFindChild<QSizeGrip *>(window); else #endif @@ -1704,7 +1701,7 @@ void tst_QMdiSubWindow::fixedMinMaxSize() int minimizedHeight = subWindow->style()->pixelMetric(QStyle::PM_TitleBarHeight, &options); #if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC) // ### Remove this after mac style has been fixed - if (qobject_cast<QMacStyle *>(subWindow->style())) + if (subWindow->style()->inherits("QMacStyle")) minimizedHeight -= 4; #endif if (!subWindow->style()->styleHint(QStyle::SH_TitleBar_NoBorder, &options, subWindow)) |