diff options
author | J-P Nurmi <jpnurmi@gmail.com> | 2009-10-01 18:41:44 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-12-08 11:16:03 (GMT) |
commit | e1c515f73eca4e85211fffc718b3d9e27f21eb19 (patch) | |
tree | 9209182ae72f8a2e02cd95377ad439aba79ff484 /tests/auto | |
parent | 0c9aa0cc58e3cf3f477024b35291b407be059c01 (diff) | |
download | Qt-e1c515f73eca4e85211fffc718b3d9e27f21eb19.zip Qt-e1c515f73eca4e85211fffc718b3d9e27f21eb19.tar.gz Qt-e1c515f73eca4e85211fffc718b3d9e27f21eb19.tar.bz2 |
Added QToolBar::visibilityChanged(bool) signal.
Reviewed-By: Thierry
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qtoolbar/tst_qtoolbar.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/auto/qtoolbar/tst_qtoolbar.cpp b/tests/auto/qtoolbar/tst_qtoolbar.cpp index ac86fd9..93dfca5 100644 --- a/tests/auto/qtoolbar/tst_qtoolbar.cpp +++ b/tests/auto/qtoolbar/tst_qtoolbar.cpp @@ -102,6 +102,7 @@ private slots: void orientationChanged(); void iconSizeChanged(); void toolButtonStyleChanged(); + void visibilityChanged(); void actionOwnership(); void widgetAction(); void accel(); @@ -998,6 +999,36 @@ void tst_QToolBar::iconSizeChanged() void tst_QToolBar::toolButtonStyleChanged() { DEPENDS_ON("toolButtonStyle()"); } +void tst_QToolBar::visibilityChanged() +{ + QMainWindow mw; + QToolBar tb; + QSignalSpy spy(&tb, SIGNAL(visibilityChanged(bool))); + + mw.addToolBar(&tb); + mw.show(); + + QCOMPARE(spy.count(), 1); + QCOMPARE(spy.at(0).at(0).toBool(), true); + spy.clear(); + + tb.hide(); + QCOMPARE(spy.count(), 1); + QCOMPARE(spy.at(0).at(0).toBool(), false); + spy.clear(); + + tb.hide(); + QCOMPARE(spy.count(), 0); + + tb.show(); + QCOMPARE(spy.count(), 1); + QCOMPARE(spy.at(0).at(0).toBool(), true); + spy.clear(); + + tb.show(); + QCOMPARE(spy.count(), 0); +} + void tst_QToolBar::actionOwnership() { { |