Skip testing empty window sizes on Windows
Change-Id: Ib4f3bc63196527583a274180c40d0f7847e13f55 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
parent
361e24b79e
commit
118d5dc496
@ -4562,8 +4562,18 @@ void tst_QWidget::setWindowGeometry_data()
|
|||||||
QList<int> windowFlags;
|
QList<int> windowFlags;
|
||||||
windowFlags << 0 << Qt::FramelessWindowHint;
|
windowFlags << 0 << Qt::FramelessWindowHint;
|
||||||
|
|
||||||
|
const bool skipEmptyRects = (m_platform == QStringLiteral("windows"));
|
||||||
foreach (QList<QRect> l, rects) {
|
foreach (QList<QRect> l, rects) {
|
||||||
QRect rect = l.first();
|
QRect rect = l.first();
|
||||||
|
if (skipEmptyRects) {
|
||||||
|
QList<QRect>::iterator it = l.begin();
|
||||||
|
while (it != l.end()) {
|
||||||
|
if (it->isEmpty())
|
||||||
|
it = l.erase(it);
|
||||||
|
else
|
||||||
|
++it;
|
||||||
|
}
|
||||||
|
}
|
||||||
foreach (int windowFlag, windowFlags) {
|
foreach (int windowFlag, windowFlags) {
|
||||||
QTest::newRow(QString("%1,%2 %3x%4, flags %5")
|
QTest::newRow(QString("%1,%2 %3x%4, flags %5")
|
||||||
.arg(rect.x())
|
.arg(rect.x())
|
||||||
@ -4612,8 +4622,13 @@ void tst_QWidget::setWindowGeometry()
|
|||||||
|
|
||||||
widget.setGeometry(rect);
|
widget.setGeometry(rect);
|
||||||
widget.showNormal();
|
widget.showNormal();
|
||||||
if (rect.isValid())
|
if (rect.isValid()) {
|
||||||
QVERIFY(QTest::qWaitForWindowExposed(&widget));
|
QVERIFY(QTest::qWaitForWindowExposed(&widget));
|
||||||
|
} else {
|
||||||
|
// in case of an invalid rect, wait for the geometry to become
|
||||||
|
// adjusted to the actual (valid) value.
|
||||||
|
QApplication::processEvents();
|
||||||
|
}
|
||||||
QTRY_COMPARE(widget.geometry(), rect);
|
QTRY_COMPARE(widget.geometry(), rect);
|
||||||
|
|
||||||
// setGeometry() while shown
|
// setGeometry() while shown
|
||||||
|
Loading…
Reference in New Issue
Block a user