diff --git a/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp b/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp index 6111d5b0dd..32003f2124 100644 --- a/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp +++ b/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp @@ -61,6 +61,17 @@ private: QPointer m_menu; }; +class MyToolButton : public QToolButton +{ + friend class tst_QToolButton; +public: + void initStyleOption(QStyleOptionToolButton *option) const override + { + QToolButton::initStyleOption(option); + } +}; + + tst_QToolButton::tst_QToolButton() { } @@ -150,16 +161,6 @@ void tst_QToolButton::triggered() void tst_QToolButton::collapseTextOnPriority() { - class MyToolButton : public QToolButton - { - friend class tst_QToolButton; - public: - void initStyleOption(QStyleOptionToolButton *option) - { - QToolButton::initStyleOption(option); - } - }; - MyToolButton button; button.setToolButtonStyle(Qt::ToolButtonTextBesideIcon); QAction action(button.style()->standardIcon(QStyle::SP_ArrowBack), "test", 0); @@ -178,16 +179,6 @@ void tst_QToolButton::task230994_iconSize() { //we check that the iconsize returned bu initStyleOption is valid //when the toolbutton has no parent - class MyToolButton : public QToolButton - { - friend class tst_QToolButton; - public: - void initStyleOption(QStyleOptionToolButton *option) - { - QToolButton::initStyleOption(option); - } - }; - MyToolButton button; QStyleOptionToolButton option; button.initStyleOption(&option);