Activate native window tests of QMdiArea.

Change-Id: Ic272b5e28256e454a3186d4407d009c9331b292b
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
This commit is contained in:
Friedemann Kleint 2012-07-16 17:34:09 +02:00 committed by Qt by Nokia
parent 8761840397
commit fa896f03c2

View File

@ -288,9 +288,7 @@ private slots:
void setTabShape(); void setTabShape();
void setTabPosition_data(); void setTabPosition_data();
void setTabPosition(); void setTabPosition();
#if defined(Q_WS_WIN) || defined(Q_WS_X11)
void nativeSubWindows(); void nativeSubWindows();
#endif
void task_209615(); void task_209615();
void task_236750(); void task_236750();
@ -2599,9 +2597,12 @@ void tst_QMdiArea::setTabPosition()
qApp->setLayoutDirection(originalLayoutDirection); qApp->setLayoutDirection(originalLayoutDirection);
} }
#if defined(Q_WS_WIN) || defined(Q_WS_X11)
void tst_QMdiArea::nativeSubWindows() void tst_QMdiArea::nativeSubWindows()
{ {
const QString platformName = QGuiApplication::platformName();
if (platformName != QLatin1String("xcb") && platformName != QLatin1String("windows"))
QSKIP(qPrintable(QString::fromLatin1("nativeSubWindows() does not work on this platform (%1).").arg(platformName)));
{ // Add native widgets after show. { // Add native widgets after show.
QMdiArea mdiArea; QMdiArea mdiArea;
mdiArea.addSubWindow(new QWidget); mdiArea.addSubWindow(new QWidget);
@ -2616,7 +2617,8 @@ void tst_QMdiArea::nativeSubWindows()
QWidget *nativeWidget = new QWidget; QWidget *nativeWidget = new QWidget;
QVERIFY(nativeWidget->winId()); // enforce native window. QVERIFY(nativeWidget->winId()); // enforce native window.
mdiArea.addSubWindow(nativeWidget); QMdiSubWindow *subWin = mdiArea.addSubWindow(nativeWidget);
QVERIFY(subWin->internalWinId());
// The viewport and all the sub-windows must be native. // The viewport and all the sub-windows must be native.
QVERIFY(mdiArea.viewport()->internalWinId()); QVERIFY(mdiArea.viewport()->internalWinId());
@ -2687,7 +2689,6 @@ void tst_QMdiArea::nativeSubWindows()
} }
#endif #endif
} }
#endif
void tst_QMdiArea::task_209615() void tst_QMdiArea::task_209615()
{ {