From 1ce725cb60358a31b1107ab5c892abb7ceca8453 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Thu, 14 Apr 2011 13:58:25 +0200 Subject: [PATCH 01/21] Fix licence headers again for MR 900 See commit b00089261eafbdf5f92ed94d7fb20b402bfcaeb2 Reviewed-by: Trust me (cherry picked from commit 7b6a7f475119878681c9d0c06b29896ec3fe72c3) --- src/gui/itemviews/qidentityproxymodel.cpp | 21 ++++++------ src/gui/itemviews/qidentityproxymodel.h | 20 +++++------ .../tst_qidentityproxymodel.cpp | 33 +++++++++++-------- 3 files changed, 40 insertions(+), 34 deletions(-) diff --git a/src/gui/itemviews/qidentityproxymodel.cpp b/src/gui/itemviews/qidentityproxymodel.cpp index 9396e6199a..fcc0504388 100644 --- a/src/gui/itemviews/qidentityproxymodel.cpp +++ b/src/gui/itemviews/qidentityproxymodel.cpp @@ -20,20 +20,21 @@ ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. ** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** +** $QT_END_LICENSE$ ** ****************************************************************************/ + #include "qidentityproxymodel.h" #ifndef QT_NO_IDENTITYPROXYMODEL diff --git a/src/gui/itemviews/qidentityproxymodel.h b/src/gui/itemviews/qidentityproxymodel.h index b60aa0b7c9..9845533b15 100644 --- a/src/gui/itemviews/qidentityproxymodel.h +++ b/src/gui/itemviews/qidentityproxymodel.h @@ -20,17 +20,17 @@ ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. ** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/qidentityproxymodel/tst_qidentityproxymodel.cpp b/tests/auto/qidentityproxymodel/tst_qidentityproxymodel.cpp index bbcdb4c0a7..cfc3f1a6a8 100644 --- a/tests/auto/qidentityproxymodel/tst_qidentityproxymodel.cpp +++ b/tests/auto/qidentityproxymodel/tst_qidentityproxymodel.cpp @@ -1,13 +1,18 @@ /**************************************************************************** ** -** Copyright (C) 2011 Klarälvdalens Datakonsult AB, -** a KDAB Group company, info@kdab.com, -** author Stephen Kelly +** Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly ** All rights reserved. -** Contact: Nokia Corporation (info@qt.nokia.com) +** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the QtGui module of the Qt Toolkit. ** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software @@ -20,17 +25,17 @@ ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. ** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** +** $QT_END_LICENSE$ ** ****************************************************************************/ From 913ff732004c2c61c39bcdd82ff05ea1827f328b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Wed, 9 Feb 2011 15:07:24 +0100 Subject: [PATCH 02/21] Avoid flicker when invalidate is propagated in a widget/layout hierarchy * Do not call invalidate from activateRecursive(). This resulted in that a layout was invalidated as many times as there were items in the layout. * Several improvements. Do not call resize(size()) too often. Calling resize() from the widgetEvent() is not very nice though... * Remove commented out code * make sure layout is activated even if the widget does not change size * activate the layout if the resize is same as size() * In order to not break existing apps, make this an opt-in feature with QGraphicsLayout::setInstantInvalidatePropagation(true); Reviewed-by: Frederik Gladhorn Reviewed-by: John Tapsell --- src/gui/graphicsview/qgraphicslayout.cpp | 139 +++++++++++++----- src/gui/graphicsview/qgraphicslayout.h | 2 + src/gui/graphicsview/qgraphicslayout_p.cpp | 11 +- .../graphicsview/qgraphicslinearlayout.cpp | 9 +- src/gui/graphicsview/qgraphicswidget.cpp | 105 ++++++++----- .../tst_qgraphicsanchorlayout.cpp | 3 + .../qgraphicslayout/tst_qgraphicslayout.cpp | 88 +++++++++++ .../tst_qgraphicslinearlayout.cpp | 40 +++++ 8 files changed, 321 insertions(+), 76 deletions(-) diff --git a/src/gui/graphicsview/qgraphicslayout.cpp b/src/gui/graphicsview/qgraphicslayout.cpp index 5bd298061d..a67ae48cc7 100644 --- a/src/gui/graphicsview/qgraphicslayout.cpp +++ b/src/gui/graphicsview/qgraphicslayout.cpp @@ -269,12 +269,20 @@ void QGraphicsLayout::activate() return; Q_ASSERT(!parentItem->isLayout()); - setGeometry(parentItem->contentsRect()); // relayout children + if (QGraphicsLayout::instantInvalidatePropagation()) { + QGraphicsWidget *parentWidget = static_cast(parentItem); + if (!parentWidget->parentLayoutItem()) { + // we've reached the topmost widget, resize it + bool wasResized = parentWidget->testAttribute(Qt::WA_Resized); + parentWidget->resize(parentWidget->size()); + parentWidget->setAttribute(Qt::WA_Resized, wasResized); + } - // ### bug, should be parentItem ? - parentLayoutItem()->updateGeometry(); // bubble up; will set activated to false - // ### too many resizes? maybe we should walk up the chain to the - // ### top-level layouted layoutItem and call activate there. + setGeometry(parentItem->contentsRect()); // relayout children + } else { + setGeometry(parentItem->contentsRect()); // relayout children + parentLayoutItem()->updateGeometry(); + } } /*! @@ -300,32 +308,36 @@ bool QGraphicsLayout::isActivated() const */ void QGraphicsLayout::invalidate() { - // only mark layouts as invalid (activated = false) if we can post a LayoutRequest event. - QGraphicsLayoutItem *layoutItem = this; - while (layoutItem && layoutItem->isLayout()) { - // we could call updateGeometry(), but what if that method - // does not call the base implementation? In addition, updateGeometry() - // does more than we need. - layoutItem->d_func()->sizeHintCacheDirty = true; - layoutItem->d_func()->sizeHintWithConstraintCacheDirty = true; - layoutItem = layoutItem->parentLayoutItem(); - } - if (layoutItem) { - layoutItem->d_func()->sizeHintCacheDirty = true; - layoutItem->d_func()->sizeHintWithConstraintCacheDirty = true; - } - - bool postIt = layoutItem ? !layoutItem->isLayout() : false; - if (postIt) { - layoutItem = this; - while (layoutItem && layoutItem->isLayout() - && static_cast(layoutItem)->d_func()->activated) { - static_cast(layoutItem)->d_func()->activated = false; + if (QGraphicsLayout::instantInvalidatePropagation()) { + updateGeometry(); + } else { + // only mark layouts as invalid (activated = false) if we can post a LayoutRequest event. + QGraphicsLayoutItem *layoutItem = this; + while (layoutItem && layoutItem->isLayout()) { + // we could call updateGeometry(), but what if that method + // does not call the base implementation? In addition, updateGeometry() + // does more than we need. + layoutItem->d_func()->sizeHintCacheDirty = true; + layoutItem->d_func()->sizeHintWithConstraintCacheDirty = true; layoutItem = layoutItem->parentLayoutItem(); } - if (layoutItem && !layoutItem->isLayout()) { - // If a layout has a parent that is not a layout it must be a QGraphicsWidget. - QApplication::postEvent(static_cast(layoutItem), new QEvent(QEvent::LayoutRequest)); + if (layoutItem) { + layoutItem->d_func()->sizeHintCacheDirty = true; + layoutItem->d_func()->sizeHintWithConstraintCacheDirty = true; + } + + bool postIt = layoutItem ? !layoutItem->isLayout() : false; + if (postIt) { + layoutItem = this; + while (layoutItem && layoutItem->isLayout() + && static_cast(layoutItem)->d_func()->activated) { + static_cast(layoutItem)->d_func()->activated = false; + layoutItem = layoutItem->parentLayoutItem(); + } + if (layoutItem && !layoutItem->isLayout()) { + // If a layout has a parent that is not a layout it must be a QGraphicsWidget. + QApplication::postEvent(static_cast(layoutItem), new QEvent(QEvent::LayoutRequest)); + } } } } @@ -335,12 +347,27 @@ void QGraphicsLayout::invalidate() */ void QGraphicsLayout::updateGeometry() { - QGraphicsLayoutItem::updateGeometry(); - if (QGraphicsLayoutItem *parentItem = parentLayoutItem()) { - if (parentItem->isLayout()) { + Q_D(QGraphicsLayout); + if (QGraphicsLayout::instantInvalidatePropagation()) { + d->activated = false; + QGraphicsLayoutItem::updateGeometry(); + + QGraphicsLayoutItem *parentItem = parentLayoutItem(); + if (!parentItem) + return; + + if (parentItem->isLayout()) + static_cast(parentItem)->invalidate(); + else parentItem->updateGeometry(); - } else { - invalidate(); + } else { + QGraphicsLayoutItem::updateGeometry(); + if (QGraphicsLayoutItem *parentItem = parentLayoutItem()) { + if (parentItem->isLayout()) { + parentItem->updateGeometry(); + } else { + invalidate(); + } } } } @@ -446,6 +473,50 @@ void QGraphicsLayout::addChildLayoutItem(QGraphicsLayoutItem *layoutItem) d->addChildLayoutItem(layoutItem); } +static bool g_instantInvalidatePropagation = false; + +/*! + \internal + \since 4.8 + \see instantInvalidatePropagation + + Calling this function with \a enable set to true will enable a feature that + makes propagation of invalidation up to ancestor layout items to be done in + one go. It will propagate up the parentLayoutItem() hierarchy until it has + reached the root. If the root item is a QGraphicsWidget, it will *post* a + layout request to it. When the layout request is consumed it will traverse + down the hierarchy of layouts and widgets and activate all layouts that is + invalid (not activated). This is the recommended behaviour. + + If not set it will also propagate up the parentLayoutItem() hierarchy, but + it will stop at the \i first \i widget it encounters, and post a layout + request to the widget. When the layout request is consumed, this might + cause it to continue propagation up to the parentLayoutItem() of the + widget. It will continue in this fashion until it has reached a widget with + no parentLayoutItem(). This strategy might cause drawing artifacts, since + it is not done in one go, and the consumption of layout requests might be + interleaved by consumption of paint events, which might cause significant + flicker. + Note, this is not the recommended behavior, but for compatibility reasons + this is the default behaviour. +*/ +void QGraphicsLayout::setInstantInvalidatePropagation(bool enable) +{ + g_instantInvalidatePropagation = enable; +} + +/*! + \internal + \since 4.8 + \see setInstantInvalidatePropagation + + returns true if the complete widget/layout hierarchy is rearranged in one go. +*/ +bool QGraphicsLayout::instantInvalidatePropagation() +{ + return g_instantInvalidatePropagation; +} + QT_END_NAMESPACE #endif //QT_NO_GRAPHICSVIEW diff --git a/src/gui/graphicsview/qgraphicslayout.h b/src/gui/graphicsview/qgraphicslayout.h index c622fb881e..60311744a2 100644 --- a/src/gui/graphicsview/qgraphicslayout.h +++ b/src/gui/graphicsview/qgraphicslayout.h @@ -76,6 +76,8 @@ public: virtual QGraphicsLayoutItem *itemAt(int i) const = 0; virtual void removeAt(int index) = 0; + static void setInstantInvalidatePropagation(bool enable); + static bool instantInvalidatePropagation(); protected: QGraphicsLayout(QGraphicsLayoutPrivate &, QGraphicsLayoutItem *); void addChildLayoutItem(QGraphicsLayoutItem *layoutItem); diff --git a/src/gui/graphicsview/qgraphicslayout_p.cpp b/src/gui/graphicsview/qgraphicslayout_p.cpp index c325602cc6..05e6cdf599 100644 --- a/src/gui/graphicsview/qgraphicslayout_p.cpp +++ b/src/gui/graphicsview/qgraphicslayout_p.cpp @@ -180,9 +180,14 @@ void QGraphicsLayoutPrivate::activateRecursive(QGraphicsLayoutItem *item) { if (item->isLayout()) { QGraphicsLayout *layout = static_cast(item); - if (layout->d_func()->activated) - layout->invalidate(); - + if (layout->d_func()->activated) { + if (QGraphicsLayout::instantInvalidatePropagation()) { + return; + } else { + layout->invalidate(); // ### LOOKS SUSPICIOUSLY WRONG!!??? + } + } + for (int i = layout->count() - 1; i >= 0; --i) { QGraphicsLayoutItem *childItem = layout->itemAt(i); if (childItem) diff --git a/src/gui/graphicsview/qgraphicslinearlayout.cpp b/src/gui/graphicsview/qgraphicslinearlayout.cpp index 5591638395..1229379ee8 100644 --- a/src/gui/graphicsview/qgraphicslinearlayout.cpp +++ b/src/gui/graphicsview/qgraphicslinearlayout.cpp @@ -275,17 +275,16 @@ void QGraphicsLinearLayout::insertItem(int index, QGraphicsLayoutItem *item) qWarning("QGraphicsLinearLayout::insertItem: cannot insert itself"); return; } - Q_ASSERT(item); - //the order of the following instructions is very important because - //invalidating the layout before adding the child item will make the layout happen - //before we try to paint the item - invalidate(); d->addChildLayoutItem(item); d->fixIndex(&index); d->engine.insertRow(index, d->orientation); new QGridLayoutItem(&d->engine, item, d->gridRow(index), d->gridColumn(index), 1, 1, 0, index); + //the order of the following instructions is very important because + //invalidating the layout before adding the child item will make the layout happen + //before we try to paint the item + invalidate(); } /*! diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp index 675a5c5c77..141e305acd 100644 --- a/src/gui/graphicsview/qgraphicswidget.cpp +++ b/src/gui/graphicsview/qgraphicswidget.cpp @@ -354,8 +354,10 @@ void QGraphicsWidget::setGeometry(const QRectF &rect) newGeom = rect; newGeom.setSize(rect.size().expandedTo(effectiveSizeHint(Qt::MinimumSize)) .boundedTo(effectiveSizeHint(Qt::MaximumSize))); - if (newGeom == d->geom) - return; + + if (newGeom == d->geom) { + goto relayoutChildrenAndReturn; + } // setPos triggers ItemPositionChange, which can adjust position wd->inSetGeometry = 1; @@ -363,8 +365,9 @@ void QGraphicsWidget::setGeometry(const QRectF &rect) wd->inSetGeometry = 0; newGeom.moveTopLeft(pos()); - if (newGeom == d->geom) - return; + if (newGeom == d->geom) { + goto relayoutChildrenAndReturn; + } // Update and prepare to change the geometry (remove from index) if the size has changed. if (wd->scene) { @@ -375,35 +378,54 @@ void QGraphicsWidget::setGeometry(const QRectF &rect) } // Update the layout item geometry - bool moved = oldPos != pos(); - if (moved) { - // Send move event. - QGraphicsSceneMoveEvent event; - event.setOldPos(oldPos); - event.setNewPos(pos()); - QApplication::sendEvent(this, &event); - if (wd->inSetPos) { - //set the new pos - d->geom.moveTopLeft(pos()); - emit geometryChanged(); - return; + { + bool moved = oldPos != pos(); + if (moved) { + // Send move event. + QGraphicsSceneMoveEvent event; + event.setOldPos(oldPos); + event.setNewPos(pos()); + QApplication::sendEvent(this, &event); + if (wd->inSetPos) { + //set the new pos + d->geom.moveTopLeft(pos()); + emit geometryChanged(); + goto relayoutChildrenAndReturn; + } + } + QSizeF oldSize = size(); + QGraphicsLayoutItem::setGeometry(newGeom); + // Send resize event + bool resized = newGeom.size() != oldSize; + if (resized) { + QGraphicsSceneResizeEvent re; + re.setOldSize(oldSize); + re.setNewSize(newGeom.size()); + if (oldSize.width() != newGeom.size().width()) + emit widthChanged(); + if (oldSize.height() != newGeom.size().height()) + emit heightChanged(); + QGraphicsLayout *lay = wd->layout; + if (QGraphicsLayout::instantInvalidatePropagation()) { + if (!lay || lay->isActivated()) { + QApplication::sendEvent(this, &re); + } + } else { + QApplication::sendEvent(this, &re); + } } } - QSizeF oldSize = size(); - QGraphicsLayoutItem::setGeometry(newGeom); - // Send resize event - bool resized = newGeom.size() != oldSize; - if (resized) { - QGraphicsSceneResizeEvent re; - re.setOldSize(oldSize); - re.setNewSize(newGeom.size()); - if (oldSize.width() != newGeom.size().width()) - emit widthChanged(); - if (oldSize.height() != newGeom.size().height()) - emit heightChanged(); - QApplication::sendEvent(this, &re); - } + emit geometryChanged(); +relayoutChildrenAndReturn: + if (QGraphicsLayout::instantInvalidatePropagation()) { + if (QGraphicsLayout *lay = wd->layout) { + if (!lay->isActivated()) { + QEvent layoutRequest(QEvent::LayoutRequest); + QApplication::sendEvent(this, &layoutRequest); + } + } + } } /*! @@ -1052,16 +1074,31 @@ void QGraphicsWidget::updateGeometry() QGraphicsLayoutItem *parentItem = parentLayoutItem(); if (parentItem && parentItem->isLayout()) { - parentItem->updateGeometry(); + if (QGraphicsLayout::instantInvalidatePropagation()) { + static_cast(parentItem)->invalidate(); + } else { + parentItem->updateGeometry(); + } } else { if (parentItem) { + // This is for custom layouting QGraphicsWidget *parentWid = parentWidget(); //### if (parentWid->isVisible()) QApplication::postEvent(parentWid, new QEvent(QEvent::LayoutRequest)); + } else { + /** + * If this is the topmost widget, post a LayoutRequest event to the widget. + * When the event is received, it will start flowing all the way down to the leaf + * widgets in one go. This will make a relayout flicker-free. + */ + if (QGraphicsLayout::instantInvalidatePropagation()) + QApplication::postEvent(static_cast(this), new QEvent(QEvent::LayoutRequest)); + } + if (!QGraphicsLayout::instantInvalidatePropagation()) { + bool wasResized = testAttribute(Qt::WA_Resized); + resize(size()); // this will restrict the size + setAttribute(Qt::WA_Resized, wasResized); } - bool wasResized = testAttribute(Qt::WA_Resized); - resize(size()); // this will restrict the size - setAttribute(Qt::WA_Resized, wasResized); } } diff --git a/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp index e7c63d540e..447385a7d8 100644 --- a/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp +++ b/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp @@ -1091,6 +1091,9 @@ void tst_QGraphicsAnchorLayout::setSpacing() #ifdef Q_WS_MAC QTest::qWait(200); #endif + + // 21x21 + QCOMPARE(p->size(), QSizeF(41, 41)); QCOMPARE(a->geometry(), QRectF(0, 0, 20, 20)); QCOMPARE(b->geometry(), QRectF(21, 0, 20, 20)); QCOMPARE(c->geometry(), QRectF(0, 21, 41, 20)); diff --git a/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp b/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp index 979f03df64..c57392640f 100644 --- a/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp +++ b/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp @@ -62,6 +62,7 @@ private slots: void compressLayoutRequest(); void automaticReparenting(); void verifyActivate(); + void invalidate(); void constructors(); void alternativeLayoutItems(); void ownership(); @@ -218,6 +219,7 @@ class TestLayout : public QGraphicsLinearLayout : QGraphicsLinearLayout(parent) { m_count = 0; + m_invalidateCount = 0; } void setGeometry(const QRectF &rect) { @@ -226,7 +228,12 @@ class TestLayout : public QGraphicsLinearLayout QGraphicsLinearLayout::setGeometry(rect); } + void invalidate() { + ++m_invalidateCount; + QGraphicsLinearLayout::invalidate(); + } + int m_invalidateCount; int m_count; }; @@ -251,6 +258,87 @@ void tst_QGraphicsLayout::verifyActivate() } +void tst_QGraphicsLayout::invalidate() +{ + QGraphicsLayout::setInstantInvalidatePropagation(true); + QGraphicsScene scene; + QGraphicsView view(&scene); + + TestGraphicsWidget *a = new TestGraphicsWidget; + scene.addItem(a); + TestLayout *alay = new TestLayout(a); + TestGraphicsWidget *b = new TestGraphicsWidget; + alay->addItem(b); + TestLayout *blay = new TestLayout(b); + TestGraphicsWidget *e = new TestGraphicsWidget; + blay->addItem(e); + + + TestGraphicsWidget *c = new TestGraphicsWidget; + alay->addItem(c); + TestLayout *clay = new TestLayout(c); + TestGraphicsWidget *f = new TestGraphicsWidget; + clay->addItem(f); + + TestGraphicsWidget *d = new TestGraphicsWidget; + alay->addItem(d); + TestLayout *dlay = new TestLayout(d); + TestGraphicsWidget *g = new TestGraphicsWidget; + dlay->addItem(g); + + view.show(); + + alay->m_invalidateCount = 0; + blay->m_invalidateCount = 0; + clay->m_invalidateCount = 0; + dlay->m_invalidateCount = 0; + + QCoreApplication::sendPostedEvents(); + QCoreApplication::processEvents(); + + alay->activate(); + QCOMPARE(alay->isActivated(), true); + QCOMPARE(blay->isActivated(), true); + QCOMPARE(clay->isActivated(), true); + qDebug() << "alay->m_invalidateCount:" << alay->m_invalidateCount; + qDebug() << "blay->m_invalidateCount:" << blay->m_invalidateCount; + qDebug() << "clay->m_invalidateCount:" << clay->m_invalidateCount; + qDebug() << "dlay->m_invalidateCount:" << dlay->m_invalidateCount; + + a->clearEventCount(); + b->clearEventCount(); + c->clearEventCount(); + + blay->invalidate(); + QCOMPARE(alay->isActivated(), false); + QCOMPARE(blay->isActivated(), false); + QCOMPARE(clay->isActivated(), true); + QCOMPARE(a->eventCount(QEvent::LayoutRequest), 0); + QCOMPARE(b->eventCount(QEvent::LayoutRequest), 0); + QCOMPARE(c->eventCount(QEvent::LayoutRequest), 0); + + + alay->m_invalidateCount = 0; + blay->m_invalidateCount = 0; + clay->m_invalidateCount = 0; + dlay->m_invalidateCount = 0; + clay->invalidate(); + QCOMPARE(alay->isActivated(), false); + QCOMPARE(blay->isActivated(), false); + QCOMPARE(clay->isActivated(), false); + + QCoreApplication::sendPostedEvents(); + QCOMPARE(a->eventCount(QEvent::LayoutRequest), 1); + QCOMPARE(b->eventCount(QEvent::LayoutRequest), 0); + QCOMPARE(c->eventCount(QEvent::LayoutRequest), 0); + qDebug() << "alay->m_invalidateCount:" << alay->m_invalidateCount; + qDebug() << "blay->m_invalidateCount:" << blay->m_invalidateCount; + qDebug() << "clay->m_invalidateCount:" << clay->m_invalidateCount; + qDebug() << "dlay->m_invalidateCount:" << dlay->m_invalidateCount; + + QGraphicsLayout::setInstantInvalidatePropagation(false); +} + class Layout : public QGraphicsLayout { public: diff --git a/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp b/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp index 62ba1b4981..8f8ac67d09 100644 --- a/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp +++ b/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp @@ -94,6 +94,7 @@ private slots: void itemSpacing(); void setStretchFactor_data(); void setStretchFactor(); + void testStretch(); void defaultStretchFactors_data(); void defaultStretchFactors(); void sizeHint_data(); @@ -667,6 +668,10 @@ void tst_QGraphicsLinearLayout::invalidate() layout.setContentsMargins(0, 0, 0, 0); view.show(); widget->show(); + //QTest::qWait(1000); + QTest::qWaitForWindowShown(&view); + qApp->processEvents(); + layout.layoutRequest = 0; layout.setContentsMargins(1, 2, 3, 4); QApplication::sendPostedEvents(0, 0); @@ -1130,6 +1135,41 @@ void tst_QGraphicsLinearLayout::setStretchFactor() delete widget; } +void tst_QGraphicsLinearLayout::testStretch() +{ + QGraphicsScene scene; + QGraphicsView *view = new QGraphicsView(&scene); + QGraphicsWidget *form = new QGraphicsWidget(0, Qt::Window); + + scene.addItem(form); + form->setMinimumSize(600, 600); + form->setMaximumSize(600, 600); + QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Horizontal, form); + QGraphicsWidget *w1 = new RectWidget; + w1->setPreferredSize(100,100); + w1->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + QGraphicsWidget *w2 = new RectWidget; + w2->setPreferredSize(200,200); + w2->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + layout->setSpacing(0); + layout->setContentsMargins(0, 0, 0, 0); + layout->addItem(w1); + layout->addStretch(2); + layout->addItem(w2); + QCOMPARE(layout->count(), 2); + QVERIFY(layout->itemAt(0) == w1); + QVERIFY(layout->itemAt(1) == w2); + layout->activate(); + + //view->setSceneRect(-50, -50, 800, 800); + //view->show(); + //QTest::qWaitForWindowShown(view); + //QTest::qWait(5000); + QCOMPARE(form->geometry().size(), QSizeF(600,600)); + QCOMPARE(w1->geometry(), QRectF(0, 0, 100, 100)); + QCOMPARE(w2->geometry(), QRectF(400, 0, 200, 200)); +} + void tst_QGraphicsLinearLayout::defaultStretchFactors_data() { QTest::addColumn("orientation"); From f76acd935da496d161916dd6b12015b76a8d881e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Fri, 18 Mar 2011 10:52:03 +0100 Subject: [PATCH 03/21] Improve invalidate() testcase. Test number of: * events * setGeometry() calls * invalidate() calls (cherry picked from commit b8b4e6fe141d99c4639d492a546226cdc3fc06c5) --- .../qgraphicslayout/tst_qgraphicslayout.cpp | 321 +++++++++++++++--- 1 file changed, 269 insertions(+), 52 deletions(-) diff --git a/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp b/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp index c57392640f..29ea07460e 100644 --- a/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp +++ b/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp @@ -96,6 +96,14 @@ void tst_QGraphicsLayout::sizeHints() } +enum FunctionType { + SetGeometry = 0, + Invalidate, + NumFunctionTypes +}; + + + class TestGraphicsWidget : public QGraphicsWidget { public: TestGraphicsWidget(QGraphicsWidget *parent = 0) : QGraphicsWidget(parent) @@ -109,9 +117,28 @@ public: int eventCount(QEvent::Type type) { return m_eventCount.value(int(type)); } + void clearEventCount() { m_eventCount.clear(); } + + void clearCounters() { + m_eventCount.clear(); + functionCount.clear(); + } + + void setGeometry(const QRectF &rect) + { + QGraphicsWidget::setGeometry(rect); + ++(functionCount[SetGeometry]); + } + + void callUpdateGeometry() + { + // updateGeometry() is protected + QGraphicsWidget::updateGeometry(); + } + QMap functionCount; private: QMap m_eventCount; }; @@ -123,6 +150,8 @@ void tst_QGraphicsLayout::compressLayoutRequest() TestGraphicsWidget *tw = new TestGraphicsWidget(); scene.addItem(tw); view.show(); + + QTest::qWaitForWindowShown(&view); QGraphicsLinearLayout *lout = new QGraphicsLinearLayout(tw); for (int i = 0; i < 4; ++i) { QGraphicsWidget *gw = new QGraphicsWidget(tw); @@ -218,23 +247,27 @@ class TestLayout : public QGraphicsLinearLayout TestLayout(QGraphicsLayoutItem *parent = 0) : QGraphicsLinearLayout(parent) { - m_count = 0; - m_invalidateCount = 0; + setContentsMargins(0,0,0,0); + setSpacing(0); } - void setGeometry(const QRectF &rect) { - - ++m_count; + void setGeometry(const QRectF &rect) + { + ++(functionCount[SetGeometry]); QGraphicsLinearLayout::setGeometry(rect); } - void invalidate() { - ++m_invalidateCount; + void invalidate() + { + ++(functionCount[Invalidate]); QGraphicsLinearLayout::invalidate(); } - int m_invalidateCount; - int m_count; + void clearCounters() { + functionCount.clear(); + } + + QMap functionCount; }; void tst_QGraphicsLayout::verifyActivate() @@ -249,15 +282,47 @@ void tst_QGraphicsLayout::verifyActivate() lout->addItem(w); window->setLayout(lout); - QCOMPARE(lout->m_count, 0); + QCOMPARE(lout->functionCount[SetGeometry], 0); window->setVisible(false); - QCOMPARE(lout->m_count, 0); + QCOMPARE(lout->functionCount[SetGeometry], 0); window->setVisible(true); // on polish or the first time a widget is shown, the widget is resized. - QCOMPARE(lout->m_count, 1); + QCOMPARE(lout->functionCount[SetGeometry], 1); } +static void clearAllCounters(TestGraphicsWidget *widget) +{ + if (!widget) + return; + widget->clearCounters(); + TestLayout *layout = static_cast(widget->layout()); + if (layout) { + layout->clearCounters(); + for (int i = layout->count() - 1; i >=0; --i) { + QGraphicsLayoutItem *item = layout->itemAt(i); + if (item->isLayout()) { + // ### Not used ATM + //TestLayout *lay = static_cast(static_cast(item)); + //clearAllCounters(lay); + } else { + TestGraphicsWidget *wid = static_cast(item); + clearAllCounters(wid); + } + } + } +} + +static void activateAndReset(TestGraphicsWidget *widget) +{ + QApplication::sendPostedEvents(); + QApplication::processEvents(); + if (widget->layout()) + widget->layout()->activate(); + clearAllCounters(widget); +} + + void tst_QGraphicsLayout::invalidate() { QGraphicsLayout::setInstantInvalidatePropagation(true); @@ -265,76 +330,228 @@ void tst_QGraphicsLayout::invalidate() QGraphicsView view(&scene); TestGraphicsWidget *a = new TestGraphicsWidget; + a->setData(0, QString("a")); scene.addItem(a); TestLayout *alay = new TestLayout(a); TestGraphicsWidget *b = new TestGraphicsWidget; + b->setData(0, QString("b")); alay->addItem(b); TestLayout *blay = new TestLayout(b); TestGraphicsWidget *e = new TestGraphicsWidget; + e->setData(0, QString("e")); blay->addItem(e); TestGraphicsWidget *c = new TestGraphicsWidget; + c->setData(0, QString("c")); alay->addItem(c); TestLayout *clay = new TestLayout(c); TestGraphicsWidget *f = new TestGraphicsWidget; + f->setData(0, QString("f")); clay->addItem(f); TestGraphicsWidget *d = new TestGraphicsWidget; + d->setData(0, QString("d")); alay->addItem(d); TestLayout *dlay = new TestLayout(d); TestGraphicsWidget *g = new TestGraphicsWidget; + g->setData(0, QString("g")); dlay->addItem(g); view.show(); - alay->m_invalidateCount = 0; - blay->m_invalidateCount = 0; - clay->m_invalidateCount = 0; - dlay->m_invalidateCount = 0; + { + clearAllCounters(a); - QCoreApplication::sendPostedEvents(); - QCoreApplication::processEvents(); + QCoreApplication::sendPostedEvents(); + QCoreApplication::processEvents(); - alay->activate(); - QCOMPARE(alay->isActivated(), true); - QCOMPARE(blay->isActivated(), true); - QCOMPARE(clay->isActivated(), true); - qDebug() << "alay->m_invalidateCount:" << alay->m_invalidateCount; - qDebug() << "blay->m_invalidateCount:" << blay->m_invalidateCount; - qDebug() << "clay->m_invalidateCount:" << clay->m_invalidateCount; - qDebug() << "dlay->m_invalidateCount:" << dlay->m_invalidateCount; + alay->activate(); + QCOMPARE(alay->isActivated(), true); + QCOMPARE(blay->isActivated(), true); + QCOMPARE(clay->isActivated(), true); + QCOMPARE(dlay->isActivated(), true); + } - a->clearEventCount(); - b->clearEventCount(); - c->clearEventCount(); + { + clearAllCounters(a); + e->callUpdateGeometry(); + QCOMPARE(alay->isActivated(), false); + QCOMPARE(blay->isActivated(), false); + QCOMPARE(clay->isActivated(), true); + QCOMPARE(dlay->isActivated(), true); + QCOMPARE(a->eventCount(QEvent::LayoutRequest), 0); + QCOMPARE(b->eventCount(QEvent::LayoutRequest), 0); + QCOMPARE(c->eventCount(QEvent::LayoutRequest), 0); + QCOMPARE(d->eventCount(QEvent::LayoutRequest), 0); - blay->invalidate(); - QCOMPARE(alay->isActivated(), false); - QCOMPARE(blay->isActivated(), false); - QCOMPARE(clay->isActivated(), true); - QCOMPARE(a->eventCount(QEvent::LayoutRequest), 0); - QCOMPARE(b->eventCount(QEvent::LayoutRequest), 0); - QCOMPARE(c->eventCount(QEvent::LayoutRequest), 0); + // should only invalidate ascendants of e + QCOMPARE(blay->functionCount[Invalidate], 1); + QCOMPARE(alay->functionCount[Invalidate], 1); + // not siblings + QCOMPARE(clay->functionCount[Invalidate], 0); + QCOMPARE(dlay->functionCount[Invalidate], 0); + + QApplication::sendPostedEvents(); + QCOMPARE(a->eventCount(QEvent::LayoutRequest), 1); + QCOMPARE(b->eventCount(QEvent::LayoutRequest), 1); + QCOMPARE(c->eventCount(QEvent::LayoutRequest), 0); + QCOMPARE(d->eventCount(QEvent::LayoutRequest), 0); + } - alay->m_invalidateCount = 0; - blay->m_invalidateCount = 0; - clay->m_invalidateCount = 0; - dlay->m_invalidateCount = 0; - clay->invalidate(); - QCOMPARE(alay->isActivated(), false); - QCOMPARE(blay->isActivated(), false); - QCOMPARE(clay->isActivated(), false); + { + activateAndReset(a); + f->callUpdateGeometry(); + QCOMPARE(alay->isActivated(), false); + QCOMPARE(blay->isActivated(), true); + QCOMPARE(clay->isActivated(), false); + QCOMPARE(dlay->isActivated(), true); - QCoreApplication::sendPostedEvents(); - QCOMPARE(a->eventCount(QEvent::LayoutRequest), 1); - QCOMPARE(b->eventCount(QEvent::LayoutRequest), 0); - QCOMPARE(c->eventCount(QEvent::LayoutRequest), 0); - qDebug() << "alay->m_invalidateCount:" << alay->m_invalidateCount; - qDebug() << "blay->m_invalidateCount:" << blay->m_invalidateCount; - qDebug() << "clay->m_invalidateCount:" << clay->m_invalidateCount; - qDebug() << "dlay->m_invalidateCount:" << dlay->m_invalidateCount; + QCoreApplication::sendPostedEvents(); + QCOMPARE(a->eventCount(QEvent::LayoutRequest), 1); + QCOMPARE(b->eventCount(QEvent::LayoutRequest), 0); + QCOMPARE(c->eventCount(QEvent::LayoutRequest), 1); + QCOMPARE(d->eventCount(QEvent::LayoutRequest), 0); + + QCOMPARE(a->functionCount[SetGeometry], 1); + QCOMPARE(alay->functionCount[SetGeometry], 1); + + QCOMPARE(b->functionCount[SetGeometry], 1); + QCOMPARE(c->functionCount[SetGeometry], 1); + QCOMPARE(d->functionCount[SetGeometry], 1); + // Since nothing really changed, blay and dlay don't need + // to be resized. + QCOMPARE(blay->functionCount[SetGeometry], 0); + QCOMPARE(clay->functionCount[SetGeometry], 1); + QCOMPARE(dlay->functionCount[SetGeometry], 0); + + QCOMPARE(f->functionCount[SetGeometry], 1); + + QCOMPARE(a->size(), QSizeF(150, 50)); + } + + { + activateAndReset(a); + f->setPreferredSize(QSizeF(60,50)); + QCOMPARE(alay->isActivated(), false); + QCOMPARE(blay->isActivated(), true); + QCOMPARE(clay->isActivated(), false); + QCOMPARE(dlay->isActivated(), true); + + QCOMPARE(c->eventCount(QEvent::LayoutRequest), 0); + QCoreApplication::sendPostedEvents(); + QCOMPARE(a->eventCount(QEvent::LayoutRequest), 1); + QCOMPARE(b->eventCount(QEvent::LayoutRequest), 0); + QCOMPARE(c->eventCount(QEvent::LayoutRequest), 1); + QCOMPARE(d->eventCount(QEvent::LayoutRequest), 0); + + QCOMPARE(a->functionCount[SetGeometry], 1); + QCOMPARE(alay->functionCount[SetGeometry], 1); + + QCOMPARE(b->functionCount[SetGeometry], 1); + QCOMPARE(c->functionCount[SetGeometry], 1); + QCOMPARE(d->functionCount[SetGeometry], 1); + // f actually got wider, need to rearrange its siblings + QCOMPARE(blay->functionCount[SetGeometry], 1); + QCOMPARE(clay->functionCount[SetGeometry], 1); + QCOMPARE(dlay->functionCount[SetGeometry], 1); + + QCOMPARE(e->functionCount[SetGeometry], 1); + QCOMPARE(f->functionCount[SetGeometry], 1); + QCOMPARE(g->functionCount[SetGeometry], 1); + + QVERIFY(e->size().width() < f->size().width()); + QVERIFY(g->size().width() < f->size().width()); + } + + { + // resize f so much that it'll force a resize of the top widget + // this will currently generate two setGeometry() calls on the child layout + // of the top widget. + activateAndReset(a); + f->setPreferredSize(QSizeF()); + f->setMinimumSize(QSizeF(200,50)); + QCOMPARE(alay->isActivated(), false); + QCOMPARE(blay->isActivated(), true); + QCOMPARE(clay->isActivated(), false); + QCOMPARE(dlay->isActivated(), true); + + QCOMPARE(c->eventCount(QEvent::LayoutRequest), 0); + QCoreApplication::sendPostedEvents(); + QCOMPARE(a->eventCount(QEvent::LayoutRequest), 1); + QCOMPARE(b->eventCount(QEvent::LayoutRequest), 0); + QCOMPARE(c->eventCount(QEvent::LayoutRequest), 1); + QCOMPARE(d->eventCount(QEvent::LayoutRequest), 0); + + QCOMPARE(a->functionCount[SetGeometry], 1); + + /* well, ideally one call to setGeometry(), but it will currently + * get two calls to setGeometry(): + * 1. The first LayoutRequest will call activate() - that will call + * setGeometry() on the layout. This geometry will be based on + * the widget geometry which is not correct at this moment. + * (it is still 150 wide) + * 2. Next, we check if the widget is top level, and then we call + * parentWidget->resize(parentWidget->size()); + * This will be adjusted to be minimum 200 pixels wide. + * The new size will then be propagated down to the layout + * + */ + QCOMPARE(alay->functionCount[SetGeometry], 2); + + QCOMPARE(b->functionCount[SetGeometry], 2); + QCOMPARE(c->functionCount[SetGeometry], 2); + QCOMPARE(d->functionCount[SetGeometry], 2); + // f actually got wider, need to rearrange its siblings + QCOMPARE(blay->functionCount[SetGeometry], 1); + QCOMPARE(clay->functionCount[SetGeometry], 1); + QCOMPARE(dlay->functionCount[SetGeometry], 1); + + QCOMPARE(e->functionCount[SetGeometry], 1); + QCOMPARE(f->functionCount[SetGeometry], 1); + QCOMPARE(g->functionCount[SetGeometry], 1); + + QVERIFY(e->size().width() < f->size().width()); + QVERIFY(g->size().width() < f->size().width()); + } + + { + f->setPreferredSize(QSizeF()); + f->setMinimumSize(QSizeF()); + a->adjustSize(); + activateAndReset(a); + // update two different leaf widgets, + // eventCount and functionCount should never be >= 2 + e->callUpdateGeometry(); + g->callUpdateGeometry(); + QCOMPARE(alay->isActivated(), false); + QCOMPARE(blay->isActivated(), false); + QCOMPARE(clay->isActivated(), true); + QCOMPARE(dlay->isActivated(), false); + + QCoreApplication::sendPostedEvents(); + QCOMPARE(a->eventCount(QEvent::LayoutRequest), 1); + QCOMPARE(b->eventCount(QEvent::LayoutRequest), 1); + QCOMPARE(c->eventCount(QEvent::LayoutRequest), 0); + QCOMPARE(d->eventCount(QEvent::LayoutRequest), 1); + + QCOMPARE(a->functionCount[SetGeometry], 1); + QCOMPARE(alay->functionCount[SetGeometry], 1); + + QCOMPARE(b->functionCount[SetGeometry], 1); + QCOMPARE(c->functionCount[SetGeometry], 1); + QCOMPARE(d->functionCount[SetGeometry], 1); + // f actually got wider, need to rearrange its siblings + QCOMPARE(blay->functionCount[SetGeometry], 1); + QCOMPARE(clay->functionCount[SetGeometry], 0); + QCOMPARE(dlay->functionCount[SetGeometry], 1); + + QCOMPARE(e->functionCount[SetGeometry], 1); + QCOMPARE(f->functionCount[SetGeometry], 0); + QCOMPARE(g->functionCount[SetGeometry], 1); + + } QGraphicsLayout::setInstantInvalidatePropagation(false); } From 446a7ba4ff1bbb3aeafb86eb318aa5f34f327edd Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Thu, 14 Apr 2011 15:30:34 +0200 Subject: [PATCH 04/21] Fix licence headers again for MR 900 See commit b00089261eafbdf5f92ed94d7fb20b402bfcaeb2 Reviewed-by: Gabriel de Dietrich (cherry picked from commit bc16ebdb7aeff70fe8149297183636ea7fd14ed1) --- .../code/src_gui_itemviews_qidentityproxymodel.cpp | 4 +--- src/gui/itemviews/qidentityproxymodel.cpp | 14 +++++++++----- src/gui/itemviews/qidentityproxymodel.h | 13 +++++++++---- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/doc/src/snippets/code/src_gui_itemviews_qidentityproxymodel.cpp b/doc/src/snippets/code/src_gui_itemviews_qidentityproxymodel.cpp index 8bd65208cb..6bf6c895f6 100644 --- a/doc/src/snippets/code/src_gui_itemviews_qidentityproxymodel.cpp +++ b/doc/src/snippets/code/src_gui_itemviews_qidentityproxymodel.cpp @@ -1,8 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Klarälvdalens Datakonsult AB, -** a KDAB Group company, info@kdab.com, -** author Stephen Kelly +** Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/src/gui/itemviews/qidentityproxymodel.cpp b/src/gui/itemviews/qidentityproxymodel.cpp index fcc0504388..60f7d98bd8 100644 --- a/src/gui/itemviews/qidentityproxymodel.cpp +++ b/src/gui/itemviews/qidentityproxymodel.cpp @@ -1,13 +1,18 @@ /**************************************************************************** ** -** Copyright (C) 2011 Klarälvdalens Datakonsult AB, -** a KDAB Group company, info@kdab.com, -** author Stephen Kelly +** Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly ** All rights reserved. -** Contact: Nokia Corporation (info@qt.nokia.com) +** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the QtGui module of the Qt Toolkit. ** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software @@ -34,7 +39,6 @@ ** ****************************************************************************/ - #include "qidentityproxymodel.h" #ifndef QT_NO_IDENTITYPROXYMODEL diff --git a/src/gui/itemviews/qidentityproxymodel.h b/src/gui/itemviews/qidentityproxymodel.h index 9845533b15..4b3176a5b5 100644 --- a/src/gui/itemviews/qidentityproxymodel.h +++ b/src/gui/itemviews/qidentityproxymodel.h @@ -1,13 +1,18 @@ /**************************************************************************** ** -** Copyright (C) 2011 Klarälvdalens Datakonsult AB, -** a KDAB Group company, info@kdab.com, -** author Stephen Kelly +** Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly ** All rights reserved. -** Contact: Nokia Corporation (info@qt.nokia.com) +** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the QtGui module of the Qt Toolkit. ** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software From 1625b25a9f172254c9121a66df9f9e9acaaf89fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Thu, 28 Apr 2011 13:58:12 +0200 Subject: [PATCH 05/21] Revert "Fix double painting when adding an item into a linear layout" (It did not really fix the issue.) This reverts commit 33f525e636ef8fa64a15d3e66c56adaea0075bda. Conflicts: src/gui/graphicsview/qgraphicslinearlayout.cpp tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp (cherry picked from commit fee052e3e37b3335fe563cb8a1881bf59f9e25d0) --- .../graphicsview/qgraphicslinearlayout.cpp | 5 +-- .../qgraphicswidget/tst_qgraphicswidget.cpp | 41 ------------------- 2 files changed, 1 insertion(+), 45 deletions(-) diff --git a/src/gui/graphicsview/qgraphicslinearlayout.cpp b/src/gui/graphicsview/qgraphicslinearlayout.cpp index 1229379ee8..40f9b1de71 100644 --- a/src/gui/graphicsview/qgraphicslinearlayout.cpp +++ b/src/gui/graphicsview/qgraphicslinearlayout.cpp @@ -275,15 +275,12 @@ void QGraphicsLinearLayout::insertItem(int index, QGraphicsLayoutItem *item) qWarning("QGraphicsLinearLayout::insertItem: cannot insert itself"); return; } - d->addChildLayoutItem(item); + Q_ASSERT(item); d->fixIndex(&index); d->engine.insertRow(index, d->orientation); new QGridLayoutItem(&d->engine, item, d->gridRow(index), d->gridColumn(index), 1, 1, 0, index); - //the order of the following instructions is very important because - //invalidating the layout before adding the child item will make the layout happen - //before we try to paint the item invalidate(); } diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp index e8e2e23a9e..887026caf4 100644 --- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp +++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp @@ -186,7 +186,6 @@ private slots: void task250119_shortcutContext(); void QT_BUG_6544_tabFocusFirstUnsetWhenRemovingItems(); void QT_BUG_12056_tabFocusFirstUnsetWhenRemovingItems(); - void QT_BUG_13865_doublePaintWhenAddingASubItem(); }; @@ -3367,46 +3366,6 @@ void tst_QGraphicsWidget::QT_BUG_12056_tabFocusFirstUnsetWhenRemovingItems() //This should not crash } - -struct GreenWidget : public QGraphicsWidget -{ - GreenWidget() : count(0) - { - } - - void paint ( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * ) - { - count++; - painter->setPen(Qt::green); - painter->drawRect(option->rect.adjusted(0,0,-1,-1)); - } - - int count; -}; - -void tst_QGraphicsWidget::QT_BUG_13865_doublePaintWhenAddingASubItem() -{ - QGraphicsScene scene; - QGraphicsView view(&scene); - QGraphicsWidget *widget = new QGraphicsWidget; - widget->resize(100, 100); - scene.addItem(widget); - QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(widget); - - view.show(); - QTest::qWaitForWindowShown(&view); - QApplication::processEvents(); - - - GreenWidget *sub = new GreenWidget; - layout->addItem(sub); - - QTest::qWait(100); - QCOMPARE(sub->count, 1); //it should only be painted once - -} - - QTEST_MAIN(tst_QGraphicsWidget) #include "tst_qgraphicswidget.moc" From 38ed8c2dddfe55c4a940adb534fa41ecae02af69 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Tue, 26 Apr 2011 18:41:15 +0200 Subject: [PATCH 06/21] Make QLineControl send accessibility updates. To make it emit the signals for the right object, it needs its parent to be the QGraphicsItem/SGItem/QLineEdit. According to IA2 it should emit TextUpdated and CursorMoved signals. TextChanged is deprecated. More fine grained signals would be desireable but this makes changes work at all. Reviewed-by: Morten Sorvig --- src/gui/accessible/qaccessible.h | 4 ++-- src/gui/widgets/qlinecontrol.cpp | 10 +++++++++- src/gui/widgets/qlinecontrol_p.h | 2 +- src/gui/widgets/qlineedit_p.cpp | 1 + src/gui/widgets/qlineedit_p.h | 1 - 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h index 871ca58995..1e9e55e16f 100644 --- a/src/gui/accessible/qaccessible.h +++ b/src/gui/accessible/qaccessible.h @@ -111,8 +111,8 @@ public: TableSummaryChanged, TextAttributeChanged, TextCaretMoved, - TextChanged, - TextColumnChanged, + // TextChanged, deprecated, use TextUpdated + TextColumnChanged = TextCaretMoved + 2, TextInserted, TextRemoved, TextUpdated, diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp index 40ebb65d0a..2a15555b89 100644 --- a/src/gui/widgets/qlinecontrol.cpp +++ b/src/gui/widgets/qlinecontrol.cpp @@ -651,7 +651,12 @@ void QLineControl::internalSetText(const QString &txt, int pos, bool edited) m_modifiedState = m_undoState = 0; m_cursor = (pos < 0 || pos > m_text.length()) ? m_text.length() : pos; m_textDirty = (oldText != m_text); - finishChange(-1, true, edited); + bool changed = finishChange(-1, true, edited); + +#ifndef QT_NO_ACCESSIBILITY + if (changed) + QAccessible::updateAccessibility(parent(), 0, QAccessible::TextUpdated); +#endif } @@ -1238,6 +1243,9 @@ void QLineControl::emitCursorPositionChanged() const int oldLast = m_lastCursorPos; m_lastCursorPos = m_cursor; cursorPositionChanged(oldLast, m_cursor); +#ifndef QT_NO_ACCESSIBILITY + QAccessible::updateAccessibility(parent(), 0, QAccessible::TextCaretMoved); +#endif } } diff --git a/src/gui/widgets/qlinecontrol_p.h b/src/gui/widgets/qlinecontrol_p.h index 6918b83b90..9764ba9c59 100644 --- a/src/gui/widgets/qlinecontrol_p.h +++ b/src/gui/widgets/qlinecontrol_p.h @@ -61,10 +61,10 @@ #include "QtGui/qtextlayout.h" #include "QtGui/qstyleoption.h" #include "QtCore/qpointer.h" -#include "QtGui/qlineedit.h" #include "QtGui/qclipboard.h" #include "QtCore/qpoint.h" #include "QtGui/qcompleter.h" +#include "QtGui/qaccessible.h" QT_BEGIN_HEADER diff --git a/src/gui/widgets/qlineedit_p.cpp b/src/gui/widgets/qlineedit_p.cpp index 23ac61384f..03716d4c66 100644 --- a/src/gui/widgets/qlineedit_p.cpp +++ b/src/gui/widgets/qlineedit_p.cpp @@ -153,6 +153,7 @@ void QLineEditPrivate::init(const QString& txt) { Q_Q(QLineEdit); control = new QLineControl(txt); + control->setParent(q); control->setFont(q->font()); QObject::connect(control, SIGNAL(textChanged(QString)), q, SIGNAL(textChanged(QString))); diff --git a/src/gui/widgets/qlineedit_p.h b/src/gui/widgets/qlineedit_p.h index 32f6077438..31697764e9 100644 --- a/src/gui/widgets/qlineedit_p.h +++ b/src/gui/widgets/qlineedit_p.h @@ -84,7 +84,6 @@ public: ~QLineEditPrivate() { - delete control; } QLineControl *control; From 4214ddc1d9c9662ab646f2ab4ba0bccb0ead6b64 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 12 May 2011 16:21:03 +0200 Subject: [PATCH 07/21] Fix compilation with namespaces enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Samuel Rødal (cherry picked from commit bff68fc7094a50af57f7da23ecf9b25cab00f188) --- src/gui/painting/qcosmeticstroker.cpp | 4 ++++ src/gui/painting/qcosmeticstroker_p.h | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp index 498b1546e2..24d625e933 100644 --- a/src/gui/painting/qcosmeticstroker.cpp +++ b/src/gui/painting/qcosmeticstroker.cpp @@ -3,6 +3,8 @@ #include #include +QT_BEGIN_NAMESPACE + #if 0 inline QString capString(int caps) { @@ -952,3 +954,5 @@ static void drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx } } } + +QT_END_NAMESPACE diff --git a/src/gui/painting/qcosmeticstroker_p.h b/src/gui/painting/qcosmeticstroker_p.h index bc6dd76829..1355a5ad13 100644 --- a/src/gui/painting/qcosmeticstroker_p.h +++ b/src/gui/painting/qcosmeticstroker_p.h @@ -6,6 +6,12 @@ #include #include +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + class QCosmeticStroker; @@ -98,4 +104,8 @@ public: bool clipLine(qreal &x1, qreal &y1, qreal &x2, qreal &y2); }; +QT_END_NAMESPACE + +QT_END_HEADER + #endif // QCOSMETICLINE_H From 1a1471718d6c99a52211ab060f3627c2478bb738 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 12 May 2011 19:00:15 +0200 Subject: [PATCH 08/21] fix compilation with namespaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Bjørn Erik Nilsen (cherry picked from commit 7a1c29f101b95c9cc2cb53f8b80d231b5a994a9a) --- src/gui/painting/qcosmeticstroker.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp index 24d625e933..3ee262fcf1 100644 --- a/src/gui/painting/qcosmeticstroker.cpp +++ b/src/gui/painting/qcosmeticstroker.cpp @@ -150,28 +150,28 @@ static StrokeLine strokeLine(int strokeSelection) switch (strokeSelection) { case Aliased|Solid|RegularDraw: - stroke = &::drawLine; + stroke = &QT_PREPEND_NAMESPACE(drawLine); break; case Aliased|Solid|FastDraw: - stroke = &::drawLine; + stroke = &QT_PREPEND_NAMESPACE(drawLine); break; case Aliased|Dashed|RegularDraw: - stroke = &::drawLine; + stroke = &QT_PREPEND_NAMESPACE(drawLine); break; case Aliased|Dashed|FastDraw: - stroke = &::drawLine; + stroke = &QT_PREPEND_NAMESPACE(drawLine); break; case AntiAliased|Solid|RegularDraw: - stroke = &drawLineAA; + stroke = &QT_PREPEND_NAMESPACE(drawLineAA); break; case AntiAliased|Solid|FastDraw: - stroke = &drawLineAA; + stroke = &QT_PREPEND_NAMESPACE(drawLineAA); break; case AntiAliased|Dashed|RegularDraw: - stroke = &drawLineAA; + stroke = &QT_PREPEND_NAMESPACE(drawLineAA); break; case AntiAliased|Dashed|FastDraw: - stroke = &drawLineAA; + stroke = &QT_PREPEND_NAMESPACE(drawLineAA); break; default: Q_ASSERT(false); From 152a10012ce3582ee64d38eca991aae975cffd24 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Thu, 12 May 2011 17:45:55 +1000 Subject: [PATCH 09/21] Ensure that recursive QMAKE_EXTRA_TARGETS use the correct makefile Recursive QMAKE_EXTRA_TARGETS were omitting the `-f' option to make. This would break in the case where the correct makefile was not named `Makefile'. The included autotest demonstrates the problem. Note that this was fixed for normal targets back in 2005 by faac7bd178654fd67a6f3f9cf4f6f2605071448d (p4 202370), but was not fixed for extra targets. Reviewed-by: ossi (cherry picked from commit 96a3bf7a8bbc1e5361e16cbeeceb4be674b88c30) --- qmake/generators/makefile.cpp | 5 +---- .../simple/main.cpp | 3 +++ .../simple/simple.pro | 5 +++++ .../subdir_via_pro_file_extra_target/subdir.pro | 7 +++++++ .../subdir_via_pro_file_extra_target.pro | 7 +++++++ tests/auto/qmake/tst_qmake.cpp | 14 ++++++++++++++ 6 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 tests/auto/qmake/testdata/subdir_via_pro_file_extra_target/simple/main.cpp create mode 100644 tests/auto/qmake/testdata/subdir_via_pro_file_extra_target/simple/simple.pro create mode 100644 tests/auto/qmake/testdata/subdir_via_pro_file_extra_target/subdir.pro create mode 100644 tests/auto/qmake/testdata/subdir_via_pro_file_extra_target/subdir_via_pro_file_extra_target.pro diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index ace3531374..94661a8205 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2647,10 +2647,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QListmakefile != "$(MAKEFILE)") - makefilein = " -f " + subtarget->makefile; + QString makefilein = " -f " + subtarget->makefile; //write the rule/depends if(flags & SubTargetOrdered) { diff --git a/tests/auto/qmake/testdata/subdir_via_pro_file_extra_target/simple/main.cpp b/tests/auto/qmake/testdata/subdir_via_pro_file_extra_target/simple/main.cpp new file mode 100644 index 0000000000..3c850d486b --- /dev/null +++ b/tests/auto/qmake/testdata/subdir_via_pro_file_extra_target/simple/main.cpp @@ -0,0 +1,3 @@ +int main(int,char**) +{ +} diff --git a/tests/auto/qmake/testdata/subdir_via_pro_file_extra_target/simple/simple.pro b/tests/auto/qmake/testdata/subdir_via_pro_file_extra_target/simple/simple.pro new file mode 100644 index 0000000000..2db08a29af --- /dev/null +++ b/tests/auto/qmake/testdata/subdir_via_pro_file_extra_target/simple/simple.pro @@ -0,0 +1,5 @@ +TEMPLATE = app +SOURCES = main.cpp + +extratarget.commands = @echo extra target worked OK +QMAKE_EXTRA_TARGETS += extratarget diff --git a/tests/auto/qmake/testdata/subdir_via_pro_file_extra_target/subdir.pro b/tests/auto/qmake/testdata/subdir_via_pro_file_extra_target/subdir.pro new file mode 100644 index 0000000000..be0d80adf0 --- /dev/null +++ b/tests/auto/qmake/testdata/subdir_via_pro_file_extra_target/subdir.pro @@ -0,0 +1,7 @@ +TEMPLATE = subdirs +SUBDIRS = simple + +extratarget.CONFIG = recursive +extratarget.recurse = $$SUBDIRS +extratarget.recurse_target = extratarget +QMAKE_EXTRA_TARGETS += extratarget diff --git a/tests/auto/qmake/testdata/subdir_via_pro_file_extra_target/subdir_via_pro_file_extra_target.pro b/tests/auto/qmake/testdata/subdir_via_pro_file_extra_target/subdir_via_pro_file_extra_target.pro new file mode 100644 index 0000000000..7c07859ae4 --- /dev/null +++ b/tests/auto/qmake/testdata/subdir_via_pro_file_extra_target/subdir_via_pro_file_extra_target.pro @@ -0,0 +1,7 @@ +TEMPLATE = subdirs +SUBDIRS = subdir.pro + +extratarget.CONFIG = recursive +extratarget.recurse = $$SUBDIRS +extratarget.recurse_target = extratarget +QMAKE_EXTRA_TARGETS += extratarget diff --git a/tests/auto/qmake/tst_qmake.cpp b/tests/auto/qmake/tst_qmake.cpp index 81a51e10f3..afd28e10f4 100644 --- a/tests/auto/qmake/tst_qmake.cpp +++ b/tests/auto/qmake/tst_qmake.cpp @@ -69,6 +69,7 @@ private slots: void simple_lib(); void simple_dll(); void subdirs(); + void subdir_via_pro_file_extra_target(); void functions(); void operators(); void variables(); @@ -234,6 +235,19 @@ void tst_qmake::subdirs() QVERIFY( test_compiler.removeMakefile( workDir ) ); } +void tst_qmake::subdir_via_pro_file_extra_target() +{ + QString workDir = base_path + "/testdata/subdir_via_pro_file_extra_target"; + + QDir D; + D.remove( workDir + "/Makefile"); + D.remove( workDir + "/Makefile.subdir"); + D.remove( workDir + "/simple/Makefile"); + D.remove( workDir + "/simple/Makefile.subdir"); + QVERIFY( test_compiler.qmake( workDir, "subdir_via_pro_file_extra_target" )); + QVERIFY( test_compiler.make( workDir, "extratarget" )); +} + void tst_qmake::functions() { QString workDir = base_path + "/testdata/functions"; From bef27c48ef49b6a5b511da47ab0d78fc254bcd07 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Fri, 13 May 2011 09:14:09 +1000 Subject: [PATCH 10/21] tests: add bug numbers to a few FIXMEs Change-Id: Idd01ce127859516dbab10644b97b281cb5218720 --- tests/auto/gui.pro | 2 +- tests/auto/host.pro | 2 +- tests/auto/other.pro | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/auto/gui.pro b/tests/auto/gui.pro index afa6ad3a55..df161f1fb2 100644 --- a/tests/auto/gui.pro +++ b/tests/auto/gui.pro @@ -103,7 +103,7 @@ SUBDIRS=\ qlistview \ qlistwidget \ qlocale \ - #qlocalsocket \ # FIXME: uses qtscript, shouldn't be in qtbase + #qlocalsocket \ # FIXME: uses qtscript (QTBUG-19242) qmacstyle \ qmainwindow \ qmatrixnxn \ diff --git a/tests/auto/host.pro b/tests/auto/host.pro index 2b862d2447..18d0009b8f 100644 --- a/tests/auto/host.pro +++ b/tests/auto/host.pro @@ -3,7 +3,7 @@ SUBDIRS=\ compiler \ headersclean \ maketestselftest \ - #moc \ # FIXME: cannot be built as part of qtbase, since it depends on qtsvg + #moc \ # FIXME: uses qtsvg (QTBUG-19243) uic \ qmake \ rcc \ diff --git a/tests/auto/other.pro b/tests/auto/other.pro index c52014a192..a84ab05104 100644 --- a/tests/auto/other.pro +++ b/tests/auto/other.pro @@ -10,8 +10,7 @@ SUBDIRS=\ qalgorithms \ qcombobox \ qcssparser \ - #qdatastream \ # FIXME: cannot be enabled by default in qtbase, - # since it depends on qtsvg + #qdatastream \ # FIXME: uses qtsvg (QTBUG-19244) qdir \ qfocusevent \ qimage \ From d9119535a2e3fcb977998ab1f7006f8a15b5a140 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Thu, 12 May 2011 17:23:14 +1000 Subject: [PATCH 11/21] Make error checking in QSignalSpy consistent QSignalSpy's constructor failed gracefully for some problems with the parameters, but not for null parameters, for which there was only a Q_ASSERT. This commit makes the handling of null parameters consistent with the handling of other errors -- output a meaningful error message with qWarning() and return, so that isValid() will subsequently return false. Change-Id: I7f5677a4c10185e30403ce3e12a022de8c13bc1c Task-number: QTBUG-14283 Reviewed-by: Rohan McGovern --- src/testlib/qsignalspy.h | 11 +++++++++-- src/testlib/qsignalspy.qdoc | 6 +++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/testlib/qsignalspy.h b/src/testlib/qsignalspy.h index b0b48c5025..fce5aad56a 100644 --- a/src/testlib/qsignalspy.h +++ b/src/testlib/qsignalspy.h @@ -68,8 +68,15 @@ public: #else static const int memberOffset = QObject::staticMetaObject.methodCount(); #endif - Q_ASSERT(obj); - Q_ASSERT(aSignal); + if (!obj) { + qWarning("QSignalSpy: Cannot spy on a null object"); + return; + } + + if (!aSignal) { + qWarning("QSignalSpy: Null signal name is not valid"); + return; + } if (((aSignal[0] - '0') & 0x03) != QSIGNAL_CODE) { qWarning("QSignalSpy: Not a valid signal, use the SIGNAL macro"); diff --git a/src/testlib/qsignalspy.qdoc b/src/testlib/qsignalspy.qdoc index 0c22868852..83dcccede2 100644 --- a/src/testlib/qsignalspy.qdoc +++ b/src/testlib/qsignalspy.qdoc @@ -62,7 +62,11 @@ /*! \fn QSignalSpy::QSignalSpy(QObject *object, const char *signal) Constructs a new QSignalSpy that listens for emissions of the \a signal - from the QObject \a object. Neither \a signal nor \a object can be null. + from the QObject \a object. If QSignalSpy is not able to listen for a + valid signal (for example, because \a object is null or \a signal does + not denote a valid signal of \a object), an explanatory warning message + will be output using qWarning() and subsequent calls to \c isValid() will + return false. Example: \snippet doc/src/snippets/code/doc_src_qsignalspy.cpp 4 From 542ba35f2f0dfd265435f32ee79e498226989e6c Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 12 May 2011 16:20:03 +0200 Subject: [PATCH 12/21] Fix deadlocks in wayland clipboard that can occur in special scenarios. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit setMimeData() emits the changed signal always so to prevent duplicated signals keyboardFocus() must only emit when the change came from another wayland client. However direct connection may cause issues when invoking the slot from a wayland callback, so use a metacall to make sure we return from the callback. Unnecessary data transfer and potential deadlock is now also avoided when a client is requesting the mime data from itself. Reviewed-by: Jørgen Lind --- .../platforms/wayland/qwaylandclipboard.cpp | 25 ++++++++++++------- .../platforms/wayland/qwaylandclipboard.h | 9 ++++++- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/plugins/platforms/wayland/qwaylandclipboard.cpp b/src/plugins/platforms/wayland/qwaylandclipboard.cpp index 47ca22865b..cf9c5a7591 100644 --- a/src/plugins/platforms/wayland/qwaylandclipboard.cpp +++ b/src/plugins/platforms/wayland/qwaylandclipboard.cpp @@ -96,7 +96,6 @@ public: QWaylandSelection(QWaylandDisplay *display, QMimeData *data); ~QWaylandSelection(); -private: static uint32_t getTime(); static void send(void *data, struct wl_selection *selection, const char *mime_type, int fd); static void cancelled(void *data, struct wl_selection *selection); @@ -164,7 +163,7 @@ void QWaylandSelection::cancelled(void *data, struct wl_selection *selection) } QWaylandClipboard::QWaylandClipboard(QWaylandDisplay *display) - : mDisplay(display), mSelection(0), mMimeDataIn(0), mOffer(0) + : mDisplay(display), mMimeDataIn(0), mOffer(0) { clipboard = this; } @@ -222,6 +221,8 @@ QVariant QWaylandClipboard::retrieveData(const QString &mimeType, QVariant::Type QMimeData *QWaylandClipboard::mimeData(QClipboard::Mode mode) { Q_ASSERT(mode == QClipboard::Clipboard); + if (!mSelections.isEmpty()) + return mSelections.last()->mMimeData; if (!mMimeDataIn) mMimeDataIn = new QWaylandMimeData; mMimeDataIn->clearAll(); @@ -236,7 +237,7 @@ void QWaylandClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode) if (!mDisplay->inputDevices().isEmpty()) { if (!data) data = new QMimeData; - mSelection = new QWaylandSelection(mDisplay, data); + mSelections.append(new QWaylandSelection(mDisplay, data)); } else { qWarning("QWaylandClipboard::setMimeData: No input devices"); } @@ -266,21 +267,27 @@ void QWaylandClipboard::offer(void *data, struct wl_selection_offer *selection_offer, const char *type) { + Q_UNUSED(data); Q_UNUSED(selection_offer); - QWaylandClipboard *self = static_cast(data); - self->mOfferedMimeTypes.append(QString::fromLatin1(type)); + clipboard->mOfferedMimeTypes.append(QString::fromLatin1(type)); } void QWaylandClipboard::keyboardFocus(void *data, struct wl_selection_offer *selection_offer, wl_input_device *input_device) { - QWaylandClipboard *self = static_cast(data); + Q_UNUSED(data); if (!input_device) { wl_selection_offer_destroy(selection_offer); - self->mOffer = 0; + clipboard->mOffer = 0; return; } - self->mOffer = selection_offer; - self->emitChanged(QClipboard::Clipboard); + clipboard->mOffer = selection_offer; + if (clipboard->mSelections.isEmpty()) + QMetaObject::invokeMethod(&clipboard->mEmitter, "emitChanged", Qt::QueuedConnection); +} + +void QWaylandClipboardSignalEmitter::emitChanged() +{ + clipboard->emitChanged(QClipboard::Clipboard); } diff --git a/src/plugins/platforms/wayland/qwaylandclipboard.h b/src/plugins/platforms/wayland/qwaylandclipboard.h index 6a02254cae..db436b890a 100644 --- a/src/plugins/platforms/wayland/qwaylandclipboard.h +++ b/src/plugins/platforms/wayland/qwaylandclipboard.h @@ -51,6 +51,13 @@ class QWaylandSelection; class QWaylandMimeData; struct wl_selection_offer; +class QWaylandClipboardSignalEmitter : public QObject +{ + Q_OBJECT +public slots: + void emitChanged(); +}; + class QWaylandClipboard : public QPlatformClipboard { public: @@ -80,11 +87,11 @@ private: static void forceRoundtrip(struct wl_display *display); QWaylandDisplay *mDisplay; - QWaylandSelection *mSelection; QWaylandMimeData *mMimeDataIn; QList mSelections; QStringList mOfferedMimeTypes; struct wl_selection_offer *mOffer; + QWaylandClipboardSignalEmitter mEmitter; }; #endif // QWAYLANDCLIPBOARD_H From bcc7ddff9f9a6cccc6425133140d9781abf32059 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 13 May 2011 11:11:55 +0200 Subject: [PATCH 13/21] tst_moc: remove QtSvg dependency The test for no keyword of every header should be done by the tst_CompilerWarnings test --- tests/auto/host.pro | 2 +- tests/auto/moc/moc.pro | 2 +- tests/auto/moc/no-keywords.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/auto/host.pro b/tests/auto/host.pro index 18d0009b8f..44216ae101 100644 --- a/tests/auto/host.pro +++ b/tests/auto/host.pro @@ -3,7 +3,7 @@ SUBDIRS=\ compiler \ headersclean \ maketestselftest \ - #moc \ # FIXME: uses qtsvg (QTBUG-19243) + moc \ uic \ qmake \ rcc \ diff --git a/tests/auto/moc/moc.pro b/tests/auto/moc/moc.pro index 4fb9ac4f5a..e150d37619 100644 --- a/tests/auto/moc/moc.pro +++ b/tests/auto/moc/moc.pro @@ -20,7 +20,7 @@ HEADERS += using-namespaces.h no-keywords.h task87883.h c-comments.h backslash-n if(*-g++*|*-icc*|*-clang|*-llvm):!irix-*:!win32-*: HEADERS += os9-newlines.h win-newlines.h SOURCES += tst_moc.cpp -QT += sql network svg +QT += sql network contains(QT_CONFIG, script): QT += script contains(QT_CONFIG, qt3support): QT += qt3support contains(QT_CONFIG, dbus){ diff --git a/tests/auto/moc/no-keywords.h b/tests/auto/moc/no-keywords.h index 06e2006669..1ebc4062c2 100644 --- a/tests/auto/moc/no-keywords.h +++ b/tests/auto/moc/no-keywords.h @@ -51,7 +51,7 @@ #include #include #include -#include +//#include #if defined(QT3_SUPPORT) #include #endif From 7d756ed7186f80d700eac5b963b63d4290d08fcd Mon Sep 17 00:00:00 2001 From: Eckhart Koppen Date: Fri, 13 May 2011 13:15:04 +0300 Subject: [PATCH 14/21] Updated data stream version for Qt 4.9 and 5.0 For now, using the same version as 4.8. This needs to be corrected when the actual data stream version is known. --- src/corelib/io/qdatastream.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/corelib/io/qdatastream.h b/src/corelib/io/qdatastream.h index d19fcc5377..6a14e7c410 100644 --- a/src/corelib/io/qdatastream.h +++ b/src/corelib/io/qdatastream.h @@ -86,10 +86,11 @@ public: Qt_4_5 = 11, Qt_4_6 = 12, Qt_4_7 = Qt_4_6, - Qt_4_8 = Qt_4_7 -#if QT_VERSION >= 0x040900 + Qt_4_8 = Qt_4_7, + Qt_4_9 = Qt_4_8, + Qt_5_0 = Qt_4_8 +#if QT_VERSION >= 0x050100 #error Add the datastream version for this Qt version - Qt_4_9 = Qt_4_8 #endif }; From 23d98f70b9303777c880e5caf1e2c1a30ec1885e Mon Sep 17 00:00:00 2001 From: Eckhart Koppen Date: Fri, 13 May 2011 13:22:30 +0300 Subject: [PATCH 15/21] Updated Qt and QtBase module version number to 5.0.0 Updated version in qglobal.h as well as the module version itself --- src/corelib/global/qglobal.h | 4 ++-- src/modules/qt_core.pri | 6 +++--- src/modules/qt_dbus.pri | 6 +++--- src/modules/qt_gui.pri | 6 +++--- src/modules/qt_network.pri | 6 +++--- src/modules/qt_opengl.pri | 6 +++--- src/modules/qt_openvg.pri | 6 +++--- src/modules/qt_sql.pri | 6 +++--- src/modules/qt_testlib.pri | 6 +++--- src/modules/qt_uilib.pri | 6 +++--- src/modules/qt_uitools.pri | 6 +++--- src/modules/qt_xml.pri | 6 +++--- 12 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 35edcdb1a1..a16bf2599d 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -44,11 +44,11 @@ #include -#define QT_VERSION_STR "4.8.0" +#define QT_VERSION_STR "5.0.0" /* QT_VERSION is (major << 16) + (minor << 8) + patch. */ -#define QT_VERSION 0x040800 +#define QT_VERSION 0x050000 /* can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0)) */ diff --git a/src/modules/qt_core.pri b/src/modules/qt_core.pri index bf013432a5..e6e5df9d27 100644 --- a/src/modules/qt_core.pri +++ b/src/modules/qt_core.pri @@ -1,6 +1,6 @@ -QT.core.VERSION = 4.8.0 -QT.core.MAJOR_VERSION = 4 -QT.core.MINOR_VERSION = 8 +QT.core.VERSION = 5.0.0 +QT.core.MAJOR_VERSION = 5 +QT.core.MINOR_VERSION = 0 QT.core.PATCH_VERSION = 0 QT.core.name = QtCore diff --git a/src/modules/qt_dbus.pri b/src/modules/qt_dbus.pri index 9aefab9b82..d57160eb77 100644 --- a/src/modules/qt_dbus.pri +++ b/src/modules/qt_dbus.pri @@ -1,6 +1,6 @@ -QT.dbus.VERSION = 4.8.0 -QT.dbus.MAJOR_VERSION = 4 -QT.dbus.MINOR_VERSION = 8 +QT.dbus.VERSION = 5.0.0 +QT.dbus.MAJOR_VERSION = 5 +QT.dbus.MINOR_VERSION = 0 QT.dbus.PATCH_VERSION = 0 QT.dbus.name = QtDBus diff --git a/src/modules/qt_gui.pri b/src/modules/qt_gui.pri index 1ef3697db6..0d1b2109f8 100644 --- a/src/modules/qt_gui.pri +++ b/src/modules/qt_gui.pri @@ -1,6 +1,6 @@ -QT.gui.VERSION = 4.8.0 -QT.gui.MAJOR_VERSION = 4 -QT.gui.MINOR_VERSION = 8 +QT.gui.VERSION = 5.0.0 +QT.gui.MAJOR_VERSION = 5 +QT.gui.MINOR_VERSION = 0 QT.gui.PATCH_VERSION = 0 QT.gui.name = QtGui diff --git a/src/modules/qt_network.pri b/src/modules/qt_network.pri index 44326c2b2d..76b462286f 100644 --- a/src/modules/qt_network.pri +++ b/src/modules/qt_network.pri @@ -1,6 +1,6 @@ -QT.network.VERSION = 4.8.0 -QT.network.MAJOR_VERSION = 4 -QT.network.MINOR_VERSION = 8 +QT.network.VERSION = 5.0.0 +QT.network.MAJOR_VERSION = 5 +QT.network.MINOR_VERSION = 0 QT.network.PATCH_VERSION = 0 QT.network.name = QtNetwork diff --git a/src/modules/qt_opengl.pri b/src/modules/qt_opengl.pri index b767a3ce12..2cc9b8682c 100644 --- a/src/modules/qt_opengl.pri +++ b/src/modules/qt_opengl.pri @@ -1,6 +1,6 @@ -QT.opengl.VERSION = 4.8.0 -QT.opengl.MAJOR_VERSION = 4 -QT.opengl.MINOR_VERSION = 8 +QT.opengl.VERSION = 5.0.0 +QT.opengl.MAJOR_VERSION = 5 +QT.opengl.MINOR_VERSION = 0 QT.opengl.PATCH_VERSION = 0 QT.opengl.name = QtOpenGL diff --git a/src/modules/qt_openvg.pri b/src/modules/qt_openvg.pri index 2ff477c013..a773eb0cca 100644 --- a/src/modules/qt_openvg.pri +++ b/src/modules/qt_openvg.pri @@ -1,6 +1,6 @@ -QT.openvg.VERSION = 4.8.0 -QT.openvg.MAJOR_VERSION = 4 -QT.openvg.MINOR_VERSION = 8 +QT.openvg.VERSION = 5.0.0 +QT.openvg.MAJOR_VERSION = 5 +QT.openvg.MINOR_VERSION = 0 QT.openvg.PATCH_VERSION = 0 QT.openvg.name = QtOpenVG diff --git a/src/modules/qt_sql.pri b/src/modules/qt_sql.pri index 14d2422989..02f48d2a6b 100644 --- a/src/modules/qt_sql.pri +++ b/src/modules/qt_sql.pri @@ -1,6 +1,6 @@ -QT.sql.VERSION = 4.8.0 -QT.sql.MAJOR_VERSION = 4 -QT.sql.MINOR_VERSION = 8 +QT.sql.VERSION = 5.0.0 +QT.sql.MAJOR_VERSION = 5 +QT.sql.MINOR_VERSION = 0 QT.sql.PATCH_VERSION = 0 QT.sql.name = QtSql diff --git a/src/modules/qt_testlib.pri b/src/modules/qt_testlib.pri index 9fd9b2e446..923fb27df3 100644 --- a/src/modules/qt_testlib.pri +++ b/src/modules/qt_testlib.pri @@ -1,6 +1,6 @@ -QT.testlib.VERSION = 4.8.0 -QT.testlib.MAJOR_VERSION = 4 -QT.testlib.MINOR_VERSION = 8 +QT.testlib.VERSION = 5.0.0 +QT.testlib.MAJOR_VERSION = 5 +QT.testlib.MINOR_VERSION = 0 QT.testlib.PATCH_VERSION = 0 QT.testlib.name = QtTest diff --git a/src/modules/qt_uilib.pri b/src/modules/qt_uilib.pri index 5973216921..04616ac6af 100644 --- a/src/modules/qt_uilib.pri +++ b/src/modules/qt_uilib.pri @@ -1,6 +1,6 @@ -QT.uilib.VERSION = 4.8.0 -QT.uilib.MAJOR_VERSION = 4 -QT.uilib.MINOR_VERSION = 8 +QT.uilib.VERSION = 5.0.0 +QT.uilib.MAJOR_VERSION = 5 +QT.uilib.MINOR_VERSION = 0 QT.uilib.PATCH_VERSION = 0 QT.uilib.name = QtUiLib diff --git a/src/modules/qt_uitools.pri b/src/modules/qt_uitools.pri index d30c8b845b..128a20cfd7 100644 --- a/src/modules/qt_uitools.pri +++ b/src/modules/qt_uitools.pri @@ -1,6 +1,6 @@ -QT.uitools.VERSION = 4.8.0 -QT.uitools.MAJOR_VERSION = 4 -QT.uitools.MINOR_VERSION = 8 +QT.uitools.VERSION = 5.0.0 +QT.uitools.MAJOR_VERSION = 5 +QT.uitools.MINOR_VERSION = 0 QT.uitools.PATCH_VERSION = 0 QT.uitools.name = QtUiTools diff --git a/src/modules/qt_xml.pri b/src/modules/qt_xml.pri index e7db6365eb..ea831236e6 100644 --- a/src/modules/qt_xml.pri +++ b/src/modules/qt_xml.pri @@ -1,6 +1,6 @@ -QT.xml.VERSION = 4.8.0 -QT.xml.MAJOR_VERSION = 4 -QT.xml.MINOR_VERSION = 8 +QT.xml.VERSION = 5.0.0 +QT.xml.MAJOR_VERSION = 5 +QT.xml.MINOR_VERSION = 0 QT.xml.PATCH_VERSION = 0 QT.xml.name = QtXml From 36c29abc0dee755366c327bb68166c0b1877b4ff Mon Sep 17 00:00:00 2001 From: Eckhart Koppen Date: Fri, 13 May 2011 13:47:56 +0300 Subject: [PATCH 16/21] Removed deprecated functions in QList Removed detach, detach2, detach3 and append which were marked as required only up to 4.5.x --- src/corelib/tools/qlist.cpp | 91 ------------------------------------- 1 file changed, 91 deletions(-) diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp index 1501daf5a9..90ed7293fd 100644 --- a/src/corelib/tools/qlist.cpp +++ b/src/corelib/tools/qlist.cpp @@ -113,64 +113,6 @@ QListData::Data *QListData::detach_grow(int *idx, int num) return x; } -#if QT_VERSION >= 0x050000 -# error "Remove QListData::detach(), it is only required for binary compatibility for 4.0.x to 4.2.x" -#endif -QListData::Data *QListData::detach() -{ - Data *x = static_cast(qMalloc(DataHeaderSize + d->alloc * sizeof(void *))); - Q_CHECK_PTR(x); - - x->ref = 1; - x->sharable = true; - x->alloc = d->alloc; - if (!x->alloc) { - x->begin = 0; - x->end = 0; - } else { - x->begin = d->begin; - x->end = d->end; - } - - qSwap(d, x); - if (!x->ref.deref()) - return x; - return 0; -} - -/*! - * Detaches the QListData by reallocating new memory. - * Returns the old (shared) data, it is up to the caller to deref() and free() - * For the new data node_copy needs to be called. - * - * \internal - */ -#if QT_VERSION >= 0x050000 -# error "Remove QListData::detach2(), it is only required for binary compatibility for 4.3.x to 4.5.x" -#endif -QListData::Data *QListData::detach2() -{ - Data *x = d; - Data* t = static_cast(qMalloc(DataHeaderSize + x->alloc * sizeof(void *))); - Q_CHECK_PTR(t); - - ::memcpy(t, d, DataHeaderSize + d->alloc * sizeof(void *)); - - t->ref = 1; - t->sharable = true; - t->alloc = x->alloc; - if (!t->alloc) { - t->begin = 0; - t->end = 0; - } else { - t->begin = x->begin; - t->end = x->end; - } - d = t; - - return x; -} - /*! * Detaches the QListData by allocating new memory for a list which possibly * has a different size than the copied one. @@ -200,21 +142,6 @@ QListData::Data *QListData::detach(int alloc) return x; } -/*! - * Detaches the QListData by reallocating new memory. - * Returns the old (shared) data, it is up to the caller to deref() and free() - * For the new data node_copy needs to be called. - * - * \internal - */ -#if QT_VERSION >= 0x050000 -# error "Remove QListData::detach3(), it is only required for binary compatibility for 4.5.x to 4.6.x" -#endif -QListData::Data *QListData::detach3() -{ - return detach(d->alloc); -} - void QListData::realloc(int alloc) { Q_ASSERT(d->ref == 1); @@ -253,24 +180,6 @@ void **QListData::append() return append(1); } -// ensures that enough space is available to append the list -#if QT_VERSION >= 0x050000 -# error "Remove QListData::append(), it is only required for binary compatibility up to 4.5.x" -#endif -void **QListData::append(const QListData& l) -{ - Q_ASSERT(d->ref == 1); - int e = d->end; - int n = l.d->end - l.d->begin; - if (n) { - if (e + n > d->alloc) - realloc(grow(e + n)); - ::memcpy(d->array + d->end, l.d->array + l.d->begin, n*sizeof(void*)); - d->end += n; - } - return d->array + e; -} - // ensures that enough space is available to append the list void **QListData::append2(const QListData& l) { From a9c2c15487d634796c8c9041c156f59ad6131fe9 Mon Sep 17 00:00:00 2001 From: Eckhart Koppen Date: Fri, 13 May 2011 15:38:00 +0300 Subject: [PATCH 17/21] Updated default Qt version to 5.0.0 Changed default version in qbase.pri and qpluginbase.pri in case no version is given at all. --- src/plugins/qpluginbase.pri | 2 +- src/qbase.pri | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/qpluginbase.pri b/src/plugins/qpluginbase.pri index bcf473f1fe..2dd96bf7f2 100644 --- a/src/plugins/qpluginbase.pri +++ b/src/plugins/qpluginbase.pri @@ -1,6 +1,6 @@ TEMPLATE = lib isEmpty(QT_MAJOR_VERSION) { - VERSION=4.8.0 + VERSION=5.0.0 } else { VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} } diff --git a/src/qbase.pri b/src/qbase.pri index 6336aa9f5c..03f85cf931 100644 --- a/src/qbase.pri +++ b/src/qbase.pri @@ -12,7 +12,7 @@ INCLUDEPATH *= $$MODULE_INCLUDES $$MODULE_INCLUDES/.. #just for today to have so isEmpty(QT_ARCH):!isEmpty(ARCH):QT_ARCH=$$ARCH #another compat that will rot for change #215700 TEMPLATE = lib isEmpty(QT_MAJOR_VERSION) { - VERSION=4.8.0 + VERSION=5.0.0 } else { VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} } From f3341fd555b19ddfaf9484b84a366fa12c966f6a Mon Sep 17 00:00:00 2001 From: Eckhart Koppen Date: Fri, 13 May 2011 15:38:50 +0300 Subject: [PATCH 18/21] Updated version references in autotests Tests now refer to version 5.0.0 --- tests/arthur/baselineserver/src/baselineserver.cpp | 2 +- tests/auto/selftests/expected_cmptest.txt | 2 +- tests/auto/selftests/expected_crashes_3.txt | 2 +- tests/auto/selftests/expected_longstring.txt | 2 +- tests/auto/selftests/expected_maxwarnings.txt | 2 +- tests/auto/selftests/expected_skip.txt | 2 +- tests/auto/uic/baseline/gridalignment.ui.h | 2 +- tests/auto/uic/baseline/icontheme.ui.h | 2 +- tests/benchmarks/corelib/tools/qhash/qhash_string.cpp | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/arthur/baselineserver/src/baselineserver.cpp b/tests/arthur/baselineserver/src/baselineserver.cpp index 97ee80ce7c..d546f1c9dd 100644 --- a/tests/arthur/baselineserver/src/baselineserver.cpp +++ b/tests/arthur/baselineserver/src/baselineserver.cpp @@ -512,7 +512,7 @@ void BaselineHandler::testPathMapping() item.imageChecksums << 0x0123456789abcdefULL; item.itemChecksum = 0x0123; - plat.insert(PI_QtVersion, QLS("4.8.0")); + plat.insert(PI_QtVersion, QLS("5.0.0")); plat.insert(PI_BuildKey, QLS("(nobuildkey)")); plat.insert(PI_QMakeSpec, QLS("linux-g++")); plat.insert(PI_PulseGitBranch, QLS("somebranch")); diff --git a/tests/auto/selftests/expected_cmptest.txt b/tests/auto/selftests/expected_cmptest.txt index 0beb46b26c..df46703afa 100644 --- a/tests/auto/selftests/expected_cmptest.txt +++ b/tests/auto/selftests/expected_cmptest.txt @@ -1,5 +1,5 @@ ********* Start testing of tst_Cmptest ********* -Config: Using QTest library 4.8.0, Qt 4.8.0 +Config: Using QTest library 5.0.0, Qt 5.0.0 PASS : tst_Cmptest::initTestCase() PASS : tst_Cmptest::compare_boolfuncs() PASS : tst_Cmptest::compare_pointerfuncs() diff --git a/tests/auto/selftests/expected_crashes_3.txt b/tests/auto/selftests/expected_crashes_3.txt index b7f462a1eb..1735aeba23 100644 --- a/tests/auto/selftests/expected_crashes_3.txt +++ b/tests/auto/selftests/expected_crashes_3.txt @@ -1,5 +1,5 @@ ********* Start testing of tst_Crashes ********* -Config: Using QTest library 4.8.0, Qt 4.8.0 +Config: Using QTest library 5.0.0, Qt 5.0.0 PASS : tst_Crashes::initTestCase() QFATAL : tst_Crashes::crash() Received signal 11 FAIL! : tst_Crashes::crash() Received a fatal error. diff --git a/tests/auto/selftests/expected_longstring.txt b/tests/auto/selftests/expected_longstring.txt index 99809a8f9e..443c6572b0 100644 --- a/tests/auto/selftests/expected_longstring.txt +++ b/tests/auto/selftests/expected_longstring.txt @@ -1,5 +1,5 @@ ********* Start testing of tst_LongString ********* -Config: Using QTest library 4.8.0, Qt 4.8.0 +Config: Using QTest library 5.0.0, Qt 5.0.0 PASS : tst_LongString::initTestCase() FAIL! : tst_LongString::failWithLongString() Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. diff --git a/tests/auto/selftests/expected_maxwarnings.txt b/tests/auto/selftests/expected_maxwarnings.txt index 165bdda81f..901350b741 100644 --- a/tests/auto/selftests/expected_maxwarnings.txt +++ b/tests/auto/selftests/expected_maxwarnings.txt @@ -1,5 +1,5 @@ ********* Start testing of MaxWarnings ********* -Config: Using QTest library 4.8.0, Qt 4.8.0 +Config: Using QTest library 5.0.0, Qt 5.0.0 PASS : MaxWarnings::initTestCase() QWARN : MaxWarnings::warn() 0 QWARN : MaxWarnings::warn() 1 diff --git a/tests/auto/selftests/expected_skip.txt b/tests/auto/selftests/expected_skip.txt index 4b53a43543..42f89a7cda 100644 --- a/tests/auto/selftests/expected_skip.txt +++ b/tests/auto/selftests/expected_skip.txt @@ -1,5 +1,5 @@ ********* Start testing of tst_Skip ********* -Config: Using QTest library 4.8.0, Qt 4.8.0 +Config: Using QTest library 5.0.0, Qt 5.0.0 PASS : tst_Skip::initTestCase() SKIP : tst_Skip::test() skipping all Loc: [/home/user/depot/qt-git/mainline/tests/auto/selftests/skip/tst_skip.cpp(68)] diff --git a/tests/auto/uic/baseline/gridalignment.ui.h b/tests/auto/uic/baseline/gridalignment.ui.h index 8386190eb0..b49a5aa74d 100644 --- a/tests/auto/uic/baseline/gridalignment.ui.h +++ b/tests/auto/uic/baseline/gridalignment.ui.h @@ -2,7 +2,7 @@ ** Form generated from reading UI file 'gridalignment.ui' ** ** Created: Fri Oct 22 14:33:59 2010 -** by: Qt User Interface Compiler version 4.8.0 +** by: Qt User Interface Compiler version 5.0.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ diff --git a/tests/auto/uic/baseline/icontheme.ui.h b/tests/auto/uic/baseline/icontheme.ui.h index 946fff9f49..e51be85bfb 100644 --- a/tests/auto/uic/baseline/icontheme.ui.h +++ b/tests/auto/uic/baseline/icontheme.ui.h @@ -2,7 +2,7 @@ ** Form generated from reading UI file 'icontheme.ui' ** ** Created: Thu Sep 2 10:28:19 2010 -** by: Qt User Interface Compiler version 4.8.0 +** by: Qt User Interface Compiler version 5.0.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ diff --git a/tests/benchmarks/corelib/tools/qhash/qhash_string.cpp b/tests/benchmarks/corelib/tools/qhash/qhash_string.cpp index d9e62cca00..9bbea300ea 100644 --- a/tests/benchmarks/corelib/tools/qhash/qhash_string.cpp +++ b/tests/benchmarks/corelib/tools/qhash/qhash_string.cpp @@ -51,7 +51,7 @@ string is a good idea. //////////////////////////////////////////////////////////////////// ********* Start testing of tst_QHash ********* -Config: Using QTest library 4.8.0, Qt 4.8.0 +Config: Using QTest library 5.0.0, Qt 5.0.0 PASS : tst_QHash::initTestCase() RESULT : tst_QHash::qhash_qt4(): 0.041 msecs per iteration (total: 85, iterations: 2048) From bf6534bad54e5d1a4f15b933f3c08ebbda74881f Mon Sep 17 00:00:00 2001 From: Eckhart Koppen Date: Fri, 13 May 2011 17:28:20 +0300 Subject: [PATCH 19/21] Temporarily changed autotest behaviour to ignore Qt version Version past 5.0.0 was checked, but the test failed to compile in that configuration. --- tests/auto/qset/tst_qset.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/auto/qset/tst_qset.cpp b/tests/auto/qset/tst_qset.cpp index c28b68320e..2c3403ae33 100644 --- a/tests/auto/qset/tst_qset.cpp +++ b/tests/auto/qset/tst_qset.cpp @@ -715,12 +715,12 @@ void tst_QSet::stlMutableIterator() QVERIFY(set2.isEmpty()); QVERIFY(set3.isEmpty()); -#if QT_VERSION >= 0x050000 - i = set2.insert("foo"); -#else +// #if QT_VERSION >= 0x050000 +// i = set2.insert("foo"); +// #else QSet::const_iterator k = set2.insert("foo"); i = reinterpret_cast::iterator &>(k); -#endif +// #endif QVERIFY(*i == "foo"); } } From 73e1f35fa39d64aa5f048df44382bd193f1aad44 Mon Sep 17 00:00:00 2001 From: Eckhart Koppen Date: Fri, 13 May 2011 18:36:12 +0300 Subject: [PATCH 20/21] Removed duplicate setting of QT dependencies Reviewed-by: TrustMe --- src/plugins/platforms/xcb/xcb.pro | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/plugins/platforms/xcb/xcb.pro b/src/plugins/platforms/xcb/xcb.pro index 83d7eb4d1f..139f5c9591 100644 --- a/src/plugins/platforms/xcb/xcb.pro +++ b/src/plugins/platforms/xcb/xcb.pro @@ -5,8 +5,6 @@ QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/platforms QT += core-private gui-private -QT+=gui-private core-private - SOURCES = \ qxcbconnection.cpp \ qxcbintegration.cpp \ From 173099696f44073441975febfa35ddfb3585e8c5 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Mon, 16 May 2011 10:43:14 +1000 Subject: [PATCH 21/21] tests: clean up usage of QT_CONFIG to fix circular dependencies With modularized Qt, using QT_CONFIG is dangerous, because the behavior changes depending on the order in which modules are qmake'd. For example, an autotest doing: contains(QT_CONFIG,svg):QT += svg ...will depend on libQtSvg if (and only if) the autotest is qmake'd _after_ qtsvg is qmake'd. This makes the tested functionality unpredictable. Also, if the above example occurs within qtbase, it causes the test to sometimes have a circular dependency: if qtsvg is qmake'd before the test is qmake'd, the test in qtbase depends on qtsvg which depends on qtbase. Tests must avoid functionality tests via QT_CONFIG except where all the tested modules are dependencies of the current module. Usage of QT_CONFIG with qt3support was entirely removed since Qt5 will not retain qt3support. Reviewed-by: Jason McDonald Change-Id: I5a5013b3ec7e1f38fb78864763c9e7586c15e70b --- tests/auto/atwrapper/atWrapper.pro | 1 - tests/auto/host.pro | 2 -- tests/auto/moc/moc.pro | 2 -- tests/auto/qaccessibility/qaccessibility.pro | 3 +-- tests/auto/qalgorithms/qalgorithms.pro | 1 - tests/auto/qcombobox/qcombobox.pro | 1 - tests/auto/qdatastream/qdatastream.pro | 1 - tests/auto/qdir/qdir.pro | 1 - tests/auto/qfileinfo/qfileinfo.pro | 2 -- tests/auto/qfocusevent/qfocusevent.pro | 4 ---- tests/auto/qimage/qimage.pro | 1 - tests/auto/qinputcontext/qinputcontext.pro | 2 -- tests/auto/qiodevice/qiodevice.pro | 1 - tests/auto/qlayout/qlayout.pro | 1 - tests/auto/qlineedit/qlineedit.pro | 4 ---- tests/auto/qlocalsocket/lackey/lackey.pro | 2 +- tests/auto/qmenu/qmenu.pro | 5 ----- tests/auto/qmenubar/qmenubar.pro | 4 ---- tests/auto/qmouseevent/qmouseevent.pro | 3 --- tests/auto/qobject/tst_qobject.pro | 1 - tests/auto/qpainter/qpainter.pro | 1 - tests/auto/qpixmap/qpixmap.pro | 1 - tests/auto/qprinter/qprinter.pro | 6 ------ tests/auto/qsettings/qsettings.pro | 1 - tests/auto/qsplitter/qsplitter.pro | 2 -- tests/auto/qsql/qsql.pro | 2 -- tests/auto/qsqldatabase/qsqldatabase.pro | 2 -- tests/auto/qtabwidget/qtabwidget.pro | 1 - tests/auto/qtcpsocket/stressTest/stressTest.pro | 1 - tests/auto/qtextbrowser/qtextbrowser.pro | 2 -- tests/auto/qtextedit/qtextedit.pro | 2 -- tests/auto/qtextstream/test/test.pro | 1 - tests/auto/qtoolbutton/qtoolbutton.pro | 9 --------- tests/auto/qvariant/qvariant.pro | 2 -- tests/auto/qwidget/qwidget.pro | 3 --- tests/auto/qworkspace/qworkspace.pro | 4 ---- tests/auto/uiloader/uiloader/uiloader.pro | 1 - 37 files changed, 2 insertions(+), 81 deletions(-) diff --git a/tests/auto/atwrapper/atWrapper.pro b/tests/auto/atwrapper/atWrapper.pro index 02218833a9..323ca1bf5f 100644 --- a/tests/auto/atwrapper/atWrapper.pro +++ b/tests/auto/atwrapper/atWrapper.pro @@ -9,7 +9,6 @@ DEFINES += SRCDIR=\\\"$$PWD\\\" QT += xml svg network -contains(QT_CONFIG, qt3support): QT += qt3support contains(QT_CONFIG, opengl):QT += opengl include($$ARTHUR/datagenerator/datagenerator.pri) diff --git a/tests/auto/host.pro b/tests/auto/host.pro index 44216ae101..fe65940789 100644 --- a/tests/auto/host.pro +++ b/tests/auto/host.pro @@ -10,5 +10,3 @@ SUBDIRS=\ #atwrapper \ # These tests need significant updating, #uiloader \ # they have hardcoded machine names etc. -#contains(QT_CONFIG,qt3support):SUBDIRS+=uic3 - diff --git a/tests/auto/moc/moc.pro b/tests/auto/moc/moc.pro index e150d37619..3aa4655ad0 100644 --- a/tests/auto/moc/moc.pro +++ b/tests/auto/moc/moc.pro @@ -21,8 +21,6 @@ if(*-g++*|*-icc*|*-clang|*-llvm):!irix-*:!win32-*: HEADERS += os9-newlines.h win SOURCES += tst_moc.cpp QT += sql network -contains(QT_CONFIG, script): QT += script -contains(QT_CONFIG, qt3support): QT += qt3support contains(QT_CONFIG, dbus){ DEFINES += WITH_DBUS QT += dbus diff --git a/tests/auto/qaccessibility/qaccessibility.pro b/tests/auto/qaccessibility/qaccessibility.pro index a4f606c672..21e286baea 100644 --- a/tests/auto/qaccessibility/qaccessibility.pro +++ b/tests/auto/qaccessibility/qaccessibility.pro @@ -2,10 +2,9 @@ load(qttest_p4) SOURCES += tst_qaccessibility.cpp unix:!mac:LIBS+=-lm -contains(QT_CONFIG, qt3support): QT += qt3support wince*: { accessneeded.files = $$QT_BUILD_TREE\\plugins\\accessible\\*.dll accessneeded.path = accessible DEPLOYMENT += accessneeded -} \ No newline at end of file +} diff --git a/tests/auto/qalgorithms/qalgorithms.pro b/tests/auto/qalgorithms/qalgorithms.pro index 02af317f60..9143da658d 100644 --- a/tests/auto/qalgorithms/qalgorithms.pro +++ b/tests/auto/qalgorithms/qalgorithms.pro @@ -2,4 +2,3 @@ load(qttest_p4) SOURCES += tst_qalgorithms.cpp QT = core -contains(QT_CONFIG, qt3support): QT += qt3support diff --git a/tests/auto/qcombobox/qcombobox.pro b/tests/auto/qcombobox/qcombobox.pro index f36a6fe622..2ac5c7c53b 100644 --- a/tests/auto/qcombobox/qcombobox.pro +++ b/tests/auto/qcombobox/qcombobox.pro @@ -1,4 +1,3 @@ load(qttest_p4) SOURCES += tst_qcombobox.cpp -contains(QT_CONFIG, qt3support): QT += qt3support diff --git a/tests/auto/qdatastream/qdatastream.pro b/tests/auto/qdatastream/qdatastream.pro index eba7c006e5..39bd09ef86 100644 --- a/tests/auto/qdatastream/qdatastream.pro +++ b/tests/auto/qdatastream/qdatastream.pro @@ -7,7 +7,6 @@ else: DEFINES += SVGFILE=\\\"gearflowers.svg\\\" } # for qpaintdevicemetrics.h -contains(QT_CONFIG, qt3support):QT += qt3support QT += svg diff --git a/tests/auto/qdir/qdir.pro b/tests/auto/qdir/qdir.pro index 384c048f61..fc266a2a97 100644 --- a/tests/auto/qdir/qdir.pro +++ b/tests/auto/qdir/qdir.pro @@ -18,7 +18,6 @@ wince* { LIBS += -lefsrv INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE } else { - contains(QT_CONFIG, qt3support):QT += qt3support DEFINES += SRCDIR=\\\"$$PWD/\\\" } diff --git a/tests/auto/qfileinfo/qfileinfo.pro b/tests/auto/qfileinfo/qfileinfo.pro index b35b1e0028..6f01f6705f 100644 --- a/tests/auto/qfileinfo/qfileinfo.pro +++ b/tests/auto/qfileinfo/qfileinfo.pro @@ -30,6 +30,4 @@ wince* { DEFINES += SRCDIR=\\\"$$PWD/\\\" } -contains(QT_CONFIG, qt3support): QT += qt3support - CONFIG += parallel_test diff --git a/tests/auto/qfocusevent/qfocusevent.pro b/tests/auto/qfocusevent/qfocusevent.pro index 83ed9eb93c..17431cf5a1 100644 --- a/tests/auto/qfocusevent/qfocusevent.pro +++ b/tests/auto/qfocusevent/qfocusevent.pro @@ -1,6 +1,2 @@ load(qttest_p4) SOURCES += tst_qfocusevent.cpp - - -contains(QT_CONFIG, qt3support): QT += qt3support - diff --git a/tests/auto/qimage/qimage.pro b/tests/auto/qimage/qimage.pro index f845ad7b1c..b517bc1237 100644 --- a/tests/auto/qimage/qimage.pro +++ b/tests/auto/qimage/qimage.pro @@ -19,6 +19,5 @@ wince*: { DEPLOYMENT += imagePlugins } } else { - contains(QT_CONFIG, qt3support): QT += qt3support DEFINES += SRCDIR=\\\"$$PWD\\\" } diff --git a/tests/auto/qinputcontext/qinputcontext.pro b/tests/auto/qinputcontext/qinputcontext.pro index 4b3ab96653..ec6831e5cf 100644 --- a/tests/auto/qinputcontext/qinputcontext.pro +++ b/tests/auto/qinputcontext/qinputcontext.pro @@ -1,8 +1,6 @@ load(qttest_p4) SOURCES += tst_qinputcontext.cpp -contains(QT_CONFIG, webkit):QT += webkit - symbian { LIBS += -lws32 -lcone } diff --git a/tests/auto/qiodevice/qiodevice.pro b/tests/auto/qiodevice/qiodevice.pro index 29b0a05ddc..08996e8cd4 100644 --- a/tests/auto/qiodevice/qiodevice.pro +++ b/tests/auto/qiodevice/qiodevice.pro @@ -17,7 +17,6 @@ wince*: { TARGET.CAPABILITY = NetworkServices } else { DEFINES += SRCDIR=\\\"$$PWD/\\\" - contains(QT_CONFIG, qt3support):QT += qt3support } MOC_DIR=tmp diff --git a/tests/auto/qlayout/qlayout.pro b/tests/auto/qlayout/qlayout.pro index 3fbc580d5c..e84018f0a1 100644 --- a/tests/auto/qlayout/qlayout.pro +++ b/tests/auto/qlayout/qlayout.pro @@ -3,7 +3,6 @@ load(qttest_p4) QT += gui-private SOURCES += tst_qlayout.cpp -contains(QT_CONFIG, qt3support): QT += qt3support wince*|symbian: { addFiles.files = baseline addFiles.path = . diff --git a/tests/auto/qlineedit/qlineedit.pro b/tests/auto/qlineedit/qlineedit.pro index 1f862b414b..bb6d95027b 100644 --- a/tests/auto/qlineedit/qlineedit.pro +++ b/tests/auto/qlineedit/qlineedit.pro @@ -1,6 +1,2 @@ load(qttest_p4) -contains(QT_CONFIG,qt3support) QT += qt3support SOURCES += tst_qlineedit.cpp - - - diff --git a/tests/auto/qlocalsocket/lackey/lackey.pro b/tests/auto/qlocalsocket/lackey/lackey.pro index 8182394dd3..6af58b122a 100644 --- a/tests/auto/qlocalsocket/lackey/lackey.pro +++ b/tests/auto/qlocalsocket/lackey/lackey.pro @@ -17,4 +17,4 @@ DEFINES += QLOCALSOCKET_DEBUG SOURCES += main.cpp TARGET = lackey -symbian:TARGET.CAPABILITY = ALL -TCB \ No newline at end of file +symbian:TARGET.CAPABILITY = ALL -TCB diff --git a/tests/auto/qmenu/qmenu.pro b/tests/auto/qmenu/qmenu.pro index e1fcb884d5..3a32920b14 100644 --- a/tests/auto/qmenu/qmenu.pro +++ b/tests/auto/qmenu/qmenu.pro @@ -1,7 +1,2 @@ load(qttest_p4) SOURCES += tst_qmenu.cpp - -contains(QT_CONFIG, qt3support): QT += qt3support - - - diff --git a/tests/auto/qmenubar/qmenubar.pro b/tests/auto/qmenubar/qmenubar.pro index adce164209..ba2dea8eb7 100644 --- a/tests/auto/qmenubar/qmenubar.pro +++ b/tests/auto/qmenubar/qmenubar.pro @@ -1,6 +1,2 @@ load(qttest_p4) -HEADERS += SOURCES += tst_qmenubar.cpp - -contains(QT_CONFIG, qt3support):!symbian:QT += qt3support - diff --git a/tests/auto/qmouseevent/qmouseevent.pro b/tests/auto/qmouseevent/qmouseevent.pro index f162c1130a..0e5ddadc1f 100644 --- a/tests/auto/qmouseevent/qmouseevent.pro +++ b/tests/auto/qmouseevent/qmouseevent.pro @@ -1,5 +1,2 @@ load(qttest_p4) SOURCES += tst_qmouseevent.cpp - -contains(QT_CONFIG, qt3support): QT += qt3support - diff --git a/tests/auto/qobject/tst_qobject.pro b/tests/auto/qobject/tst_qobject.pro index 5745e671c2..e31fed5d10 100644 --- a/tests/auto/qobject/tst_qobject.pro +++ b/tests/auto/qobject/tst_qobject.pro @@ -8,7 +8,6 @@ SOURCES += moc_oldnormalizeobject.cpp QT = core \ network \ gui -contains(QT_CONFIG, qt3support):DEFINES += QT_HAS_QT3SUPPORT wince*: { addFiles.files = signalbug.exe addFiles.path = . diff --git a/tests/auto/qpainter/qpainter.pro b/tests/auto/qpainter/qpainter.pro index 2db6ff381e..0a1bebcfb6 100644 --- a/tests/auto/qpainter/qpainter.pro +++ b/tests/auto/qpainter/qpainter.pro @@ -2,7 +2,6 @@ load(qttest_p4) QT += gui-private -contains(QT_CONFIG, qt3support): QT += qt3support SOURCES += tst_qpainter.cpp wince*|symbian: { addFiles.files = drawEllipse drawLine_rop_bitmap drawPixmap_rop drawPixmap_rop_bitmap task217400.png diff --git a/tests/auto/qpixmap/qpixmap.pro b/tests/auto/qpixmap/qpixmap.pro index 9f8e2f4166..f5df30cc1d 100644 --- a/tests/auto/qpixmap/qpixmap.pro +++ b/tests/auto/qpixmap/qpixmap.pro @@ -3,7 +3,6 @@ load(qttest_p4) QT += core-private gui-private SOURCES += tst_qpixmap.cpp -contains(QT_CONFIG, qt3support): QT += qt3support wince*|symbian: { task31722_0.files = convertFromImage/task31722_0/*.png diff --git a/tests/auto/qprinter/qprinter.pro b/tests/auto/qprinter/qprinter.pro index 1df29748cc..ef310b82c8 100644 --- a/tests/auto/qprinter/qprinter.pro +++ b/tests/auto/qprinter/qprinter.pro @@ -1,8 +1,2 @@ load(qttest_p4) SOURCES += tst_qprinter.cpp - - -contains(QT_CONFIG, qt3support): QT += qt3support - - - diff --git a/tests/auto/qsettings/qsettings.pro b/tests/auto/qsettings/qsettings.pro index 151660d21c..35bb56cc98 100644 --- a/tests/auto/qsettings/qsettings.pro +++ b/tests/auto/qsettings/qsettings.pro @@ -5,7 +5,6 @@ QT += core-private SOURCES += tst_qsettings.cpp RESOURCES += qsettings.qrc -contains(QT_CONFIG, qt3support):QT += qt3support CONFIG -= debug CONFIG += release win32-msvc*:LIBS += advapi32.lib diff --git a/tests/auto/qsplitter/qsplitter.pro b/tests/auto/qsplitter/qsplitter.pro index 5422fae00c..bca4fc40fd 100644 --- a/tests/auto/qsplitter/qsplitter.pro +++ b/tests/auto/qsplitter/qsplitter.pro @@ -2,8 +2,6 @@ load(qttest_p4) SOURCES += tst_qsplitter.cpp -contains(QT_CONFIG, qt3support): QT += qt3support - wince*|symbian: { addFiles.files = extradata.txt setSizes3.dat addFiles.path = . diff --git a/tests/auto/qsql/qsql.pro b/tests/auto/qsql/qsql.pro index 6d132f5b68..e367a8e1c1 100644 --- a/tests/auto/qsql/qsql.pro +++ b/tests/auto/qsql/qsql.pro @@ -3,8 +3,6 @@ SOURCES += tst_qsql.cpp QT += sql sql-private -contains(QT_CONFIG, qt3support): QT += qt3support - wince*: { DEPLOYMENT_PLUGIN += qsqlite } diff --git a/tests/auto/qsqldatabase/qsqldatabase.pro b/tests/auto/qsqldatabase/qsqldatabase.pro index 066c24f395..ee78b79c36 100644 --- a/tests/auto/qsqldatabase/qsqldatabase.pro +++ b/tests/auto/qsqldatabase/qsqldatabase.pro @@ -3,8 +3,6 @@ SOURCES += tst_qsqldatabase.cpp QT += sql -contains(QT_CONFIG, qt3support): QT += qt3support - win32: { !wince*: LIBS += -lws2_32 else: LIBS += -lws2 diff --git a/tests/auto/qtabwidget/qtabwidget.pro b/tests/auto/qtabwidget/qtabwidget.pro index 37aec5fc2a..69296cae2b 100644 --- a/tests/auto/qtabwidget/qtabwidget.pro +++ b/tests/auto/qtabwidget/qtabwidget.pro @@ -6,7 +6,6 @@ INCLUDEPATH += ../ HEADERS += SOURCES += tst_qtabwidget.cpp -contains(QT_CONFIG, qt3support): QT += qt3support win32:!wince*:LIBS += -luser32 diff --git a/tests/auto/qtcpsocket/stressTest/stressTest.pro b/tests/auto/qtcpsocket/stressTest/stressTest.pro index adf021783b..f6215f80a0 100644 --- a/tests/auto/qtcpsocket/stressTest/stressTest.pro +++ b/tests/auto/qtcpsocket/stressTest/stressTest.pro @@ -1,7 +1,6 @@ HEADERS += Test.h SOURCES += main.cpp Test.cpp QT += network -contains(QT_CONFIG, qt3support): QT += qt3support CONFIG -= app_bundle CONFIG += console diff --git a/tests/auto/qtextbrowser/qtextbrowser.pro b/tests/auto/qtextbrowser/qtextbrowser.pro index 773fb975a8..415f9cace2 100644 --- a/tests/auto/qtextbrowser/qtextbrowser.pro +++ b/tests/auto/qtextbrowser/qtextbrowser.pro @@ -2,8 +2,6 @@ load(qttest_p4) SOURCES += tst_qtextbrowser.cpp !symbian:DEFINES += SRCDIR=\\\"$$PWD\\\" -contains(QT_CONFIG, qt3support): QT += qt3support - wince*|symbian: { addFiles.files = *.html diff --git a/tests/auto/qtextedit/qtextedit.pro b/tests/auto/qtextedit/qtextedit.pro index e7d6c039a6..cef2b300d7 100644 --- a/tests/auto/qtextedit/qtextedit.pro +++ b/tests/auto/qtextedit/qtextedit.pro @@ -16,5 +16,3 @@ wince* { } else:!symbian { DEFINES += SRCDIR=\\\"$$PWD/\\\" } - -contains(QT_CONFIG, qt3support): QT += qt3support diff --git a/tests/auto/qtextstream/test/test.pro b/tests/auto/qtextstream/test/test.pro index 8805fb9f61..e0eb4ef193 100644 --- a/tests/auto/qtextstream/test/test.pro +++ b/tests/auto/qtextstream/test/test.pro @@ -13,7 +13,6 @@ win32 { RESOURCES += ../qtextstream.qrc -contains(QT_CONFIG, qt3support):QT += qt3support QT = core network diff --git a/tests/auto/qtoolbutton/qtoolbutton.pro b/tests/auto/qtoolbutton/qtoolbutton.pro index 4ee0d3745a..d30d092670 100644 --- a/tests/auto/qtoolbutton/qtoolbutton.pro +++ b/tests/auto/qtoolbutton/qtoolbutton.pro @@ -1,11 +1,2 @@ -############################################################ -# Project file for autotest for file qtoolbutton.h -############################################################ - load(qttest_p4) - SOURCES += tst_qtoolbutton.cpp -contains(QT_CONFIG, qt3support): QT += qt3support - - - diff --git a/tests/auto/qvariant/qvariant.pro b/tests/auto/qvariant/qvariant.pro index 2c9c8d76b1..4824c11078 100644 --- a/tests/auto/qvariant/qvariant.pro +++ b/tests/auto/qvariant/qvariant.pro @@ -1,5 +1,3 @@ load(qttest_p4) SOURCES += tst_qvariant.cpp QT += network - -contains(QT_CONFIG, qt3support): QT += qt3support diff --git a/tests/auto/qwidget/qwidget.pro b/tests/auto/qwidget/qwidget.pro index fbbed3d8fa..dfb7358127 100644 --- a/tests/auto/qwidget/qwidget.pro +++ b/tests/auto/qwidget/qwidget.pro @@ -5,9 +5,6 @@ QT += core-private gui-private SOURCES += tst_qwidget.cpp RESOURCES = qwidget.qrc -contains(QT_CONFIG, qt3support): QT += qt3support -contains(QT_CONFIG, qt3support):DEFINES+=QT_HAS_QT3SUPPORT - aix-g++*:QMAKE_CXXFLAGS+=-fpermissive CONFIG += x11inc diff --git a/tests/auto/qworkspace/qworkspace.pro b/tests/auto/qworkspace/qworkspace.pro index 0d2c261f17..de4d29a229 100644 --- a/tests/auto/qworkspace/qworkspace.pro +++ b/tests/auto/qworkspace/qworkspace.pro @@ -1,6 +1,2 @@ load(qttest_p4) SOURCES += tst_qworkspace.cpp - - - -contains(QT_CONFIG, qt3support): QT += qt3support diff --git a/tests/auto/uiloader/uiloader/uiloader.pro b/tests/auto/uiloader/uiloader/uiloader.pro index 4e95956522..b959d438b7 100644 --- a/tests/auto/uiloader/uiloader/uiloader.pro +++ b/tests/auto/uiloader/uiloader/uiloader.pro @@ -14,7 +14,6 @@ win32 { } QT += xml svg network -contains(QT_CONFIG, qt3support): QT += qt3support wince*|symbian: { configuration.files = ../*.ini