summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qaction/tst_qaction.cpp4
-rw-r--r--tests/auto/qtoolbutton/tst_qtoolbutton.cpp27
2 files changed, 31 insertions, 0 deletions
diff --git a/tests/auto/qaction/tst_qaction.cpp b/tests/auto/qaction/tst_qaction.cpp
index 452ca58..3c71baf 100644
--- a/tests/auto/qaction/tst_qaction.cpp
+++ b/tests/auto/qaction/tst_qaction.cpp
@@ -105,6 +105,10 @@ void tst_QAction::getSetCheck()
obj1.setMenu((QMenu *)0);
QCOMPARE((QMenu *)0, obj1.menu());
delete var2;
+
+ QCOMPARE(obj1.priority(), QAction::NormalPriority);
+ obj1.setPriority(QAction::LowPriority);
+ QCOMPARE(obj1.priority(), QAction::LowPriority);
}
class MyWidget : public QWidget
diff --git a/tests/auto/qtoolbutton/tst_qtoolbutton.cpp b/tests/auto/qtoolbutton/tst_qtoolbutton.cpp
index 9e342ad..4176507 100644
--- a/tests/auto/qtoolbutton/tst_qtoolbutton.cpp
+++ b/tests/auto/qtoolbutton/tst_qtoolbutton.cpp
@@ -64,6 +64,7 @@ public:
private slots:
void getSetCheck();
void triggered();
+ void collapseTextOnPriority();
void task230994_iconSize();
void task176137_autoRepeatOfAction();
@@ -160,6 +161,32 @@ void tst_QToolButton::triggered()
delete menu;
}
+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);
+ button.setDefaultAction(&action);
+
+ QStyleOptionToolButton option;
+ button.initStyleOption(&option);
+ QVERIFY(option.toolButtonStyle == Qt::ToolButtonTextBesideIcon);
+ action.setPriority(QAction::LowPriority);
+ button.initStyleOption(&option);
+ QVERIFY(option.toolButtonStyle == Qt::ToolButtonIconOnly);
+}
+
+
void tst_QToolButton::task230994_iconSize()
{
//we check that the iconsize returned bu initStyleOption is valid