summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-08-17 12:14:32 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-08-17 12:14:32 (GMT)
commitf30cf8d452afd8e279384fe6a6a10216c7d52304 (patch)
tree3695dc75a57ee15aad55f91ad7a348488fddf0a5 /tests/auto
parent996a719324a678a0a5d130eef6380451a207ffe7 (diff)
parentfb934f2a8d7398a3ff39a107093f9da6ceda59a7 (diff)
downloadQt-f30cf8d452afd8e279384fe6a6a10216c7d52304.zip
Qt-f30cf8d452afd8e279384fe6a6a10216c7d52304.tar.gz
Qt-f30cf8d452afd8e279384fe6a6a10216c7d52304.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-water-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-water-staging: Fix a crash in a11y introduced by d289e54f2d2aa066cb3 Fix bug QTBUG-13901, Mac style button rect Cocoa: change usage of deprecated API (scrolling) in Lion
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qpushbutton/tst_qpushbutton.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/auto/qpushbutton/tst_qpushbutton.cpp b/tests/auto/qpushbutton/tst_qpushbutton.cpp
index 7742f6b..db4f385 100644
--- a/tests/auto/qpushbutton/tst_qpushbutton.cpp
+++ b/tests/auto/qpushbutton/tst_qpushbutton.cpp
@@ -91,6 +91,9 @@ private slots:
void animateClick();
void toggle();
void clicked();
+#ifdef Q_OS_MAC
+ void macClicked();
+#endif
void toggled();
void isEnabled();
void defaultAndAutoDefault();
@@ -469,6 +472,34 @@ void tst_QPushButton::clicked()
QCOMPARE( release_count, (uint)10 );
}
+#ifdef Q_OS_MAC
+// test that the corners of a mac style button are not treated as clicks.
+// but that if a style is applied, they are.
+void tst_QPushButton::macClicked()
+{
+ QPushButton *macTestWidget = new QPushButton( "Push button" );
+ macTestWidget->show();
+ connect( macTestWidget, SIGNAL(clicked()), this, SLOT(onClicked()) );
+
+ QTest::mouseClick( macTestWidget, Qt::LeftButton, 0, QPoint(1,1) );
+ QVERIFY( click_count == 0 );
+
+ QTest::mouseClick( macTestWidget, Qt::LeftButton, 0, macTestWidget->rect().center() );
+ QVERIFY( click_count == 1 );
+
+ resetCounters();
+ macTestWidget->setStyleSheet("background: white;");
+
+ QTest::mouseClick( macTestWidget, Qt::LeftButton, 0, QPoint(1,1) );
+ QVERIFY( click_count == 1 );
+
+ QTest::mouseClick( macTestWidget, Qt::LeftButton, 0, macTestWidget->rect().center() );
+ QVERIFY( click_count == 2 );
+
+ delete macTestWidget;
+}
+#endif
+
/*
void tst_QPushButton::group()
{