tst_QColorDialog();
virtual ~tst_QColorDialog();
-#ifndef Q_OS_MAC
public slots:
void postKeyReturn();
-private slots:
- void defaultOkButton();
-#endif
+ void testGetRgba();
+ void testNativeActiveModalWidget();
public slots:
void initTestCase();
void cleanup();
private slots:
+ void defaultOkButton();
void native_activeModalWidget();
void task247349_alpha();
};
{
}
-void tst_QColorDialog::native_activeModalWidget()
+void tst_QColorDialog::testNativeActiveModalWidget()
{
-#ifdef Q_OS_MAC
- QSKIP("Test hangs on Mac OS X, see QTBUG-24320");
-#endif
// Check that QApplication::activeModalWidget retruns the
// color dialog when it is executing, even when using a native
// dialog:
QVERIFY(&d == d.m_activeModalWidget);
}
+void tst_QColorDialog::native_activeModalWidget()
+{
+ QTimer::singleShot(3000, qApp, SLOT(quit()));
+ QTimer::singleShot(0, this, SLOT(testNativeActiveModalWidget()));
+ qApp->exec();
+}
+
void tst_QColorDialog::initTestCase()
{
}
{
}
-#ifndef Q_OS_MAC
-//copied from QFontDialogTest
void tst_QColorDialog::postKeyReturn() {
QWidgetList list = QApplication::topLevelWidgets();
for (int i=0; i<list.count(); ++i) {
}
}
-void tst_QColorDialog::defaultOkButton()
+void tst_QColorDialog::testGetRgba()
{
+#ifdef Q_OS_MAC
+ QEXPECT_FAIL("", "Sending QTest::keyClick to OSX color dialog helper fails, see QTBUG-24320", Continue);
+#endif
bool ok = false;
QTimer::singleShot(500, this, SLOT(postKeyReturn()));
QColorDialog::getRgba(0xffffffff, &ok);
QVERIFY(ok);
}
-#endif
+
+void tst_QColorDialog::defaultOkButton()
+{
+ QTimer::singleShot(4000, qApp, SLOT(quit()));
+ QTimer::singleShot(0, this, SLOT(testGetRgba()));
+ qApp->exec();
+}
void tst_QColorDialog::task247349_alpha()
{
public slots:
void postKeyReturn();
+ void testGetFont();
+ void testSetFont();
public slots:
void initTestCase();
{
}
-
void tst_QFontDialog::postKeyReturn() {
QWidgetList list = QApplication::topLevelWidgets();
for (int i=0; i<list.count(); ++i) {
}
}
-void tst_QFontDialog::defaultOkButton()
+void tst_QFontDialog::testGetFont()
{
#ifdef Q_OS_MAC
- QSKIP("Test hangs on Mac OS X, see QTBUG-24321");
+ QEXPECT_FAIL("", "Sending QTest::keyClick to OSX font dialog helper fails, see QTBUG-24321", Continue);
#endif
bool ok = false;
QTimer::singleShot(2000, this, SLOT(postKeyReturn()));
}
-void tst_QFontDialog::setFont()
+void tst_QFontDialog::defaultOkButton()
+{
+ QTimer::singleShot(4000, qApp, SLOT(quit()));
+ QTimer::singleShot(0, this, SLOT(testGetFont()));
+ qApp->exec();
+}
+
+void tst_QFontDialog::testSetFont()
{
-#ifdef Q_OS_MAC
- QSKIP("Test hangs on Mac OS X, see QTBUG-24321");
-#endif
- /* The font should be the same before as it is after if nothing changed
- while the font dialog was open.
- Task #27662
- */
bool ok = false;
#if defined Q_OS_HPUX
QString fontName = "Courier";
QCOMPARE(QFontInfo(f2).pointSize(), QFontInfo(f1).pointSize());
}
+void tst_QFontDialog::setFont()
+{
+ /* The font should be the same before as it is after if nothing changed
+ while the font dialog was open.
+ Task #27662
+ */
+ QTimer::singleShot(4000, qApp, SLOT(quit()));
+ QTimer::singleShot(0, this, SLOT(testSetFont()));
+ qApp->exec();
+}
+
class FriendlyFontDialog : public QFontDialog
{
friend class tst_QFontDialog;
- Q_DECLARE_PRIVATE(QFontDialog);
+ Q_DECLARE_PRIVATE(QFontDialog)
};
void tst_QFontDialog::task256466_wrongStyle()