diff --git a/doc/src/snippets/code/src_gui_itemviews_qidentityproxymodel.cpp b/doc/src/snippets/code/src_gui_itemviews_qidentityproxymodel.cpp index 8bd65208cb5..6bf6c895f6f 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/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index ace35313741..94661a8205c 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/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 35edcdb1a18..a16bf2599d3 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/corelib/io/qdatastream.h b/src/corelib/io/qdatastream.h index d19fcc53771..6a14e7c4109 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 }; diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp index 1501daf5a9a..90ed7293fdb 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) { diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp index 498b1546e28..3ee262fcf1f 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) { @@ -148,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); @@ -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 bc6dd768294..1355a5ad134 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 diff --git a/src/modules/qt_core.pri b/src/modules/qt_core.pri index bf013432a5c..e6e5df9d27f 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 9aefab9b82a..d57160eb772 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 1ef3697db6c..0d1b2109f89 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 44326c2b2db..76b462286f9 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 a1080cb5a52..22476cf9495 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_sql.pri b/src/modules/qt_sql.pri index 14d2422989f..02f48d2a6be 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 9fd9b2e446f..923fb27df36 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 5973216921e..04616ac6afb 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 d30c8b845b2..128a20cfd79 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 e7db6365eb8..ea831236e62 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 diff --git a/src/plugins/platforms/wayland/qwaylandclipboard.cpp b/src/plugins/platforms/wayland/qwaylandclipboard.cpp index e463af5d471..77c9990d9e4 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 6a02254cae9..db436b890a3 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 diff --git a/src/plugins/platforms/xcb/xcb.pro b/src/plugins/platforms/xcb/xcb.pro index 175bdd8451b..93a226bd067 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 \ diff --git a/src/plugins/qpluginbase.pri b/src/plugins/qpluginbase.pri index bcf473f1fe9..2dd96bf7f27 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 6336aa9f5c1..03f85cf9312 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} } diff --git a/src/testlib/qsignalspy.h b/src/testlib/qsignalspy.h index b0b48c5025a..fce5aad56a2 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 0c228688528..83dcccede2e 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 diff --git a/src/widgets/accessible/qaccessible.h b/src/widgets/accessible/qaccessible.h index 33e76a7ad24..c1b9afbcd58 100644 --- a/src/widgets/accessible/qaccessible.h +++ b/src/widgets/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/widgets/graphicsview/qgraphicslayout.cpp b/src/widgets/graphicsview/qgraphicslayout.cpp index 5bd298061da..a67ae48cc7c 100644 --- a/src/widgets/graphicsview/qgraphicslayout.cpp +++ b/src/widgets/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/widgets/graphicsview/qgraphicslayout.h b/src/widgets/graphicsview/qgraphicslayout.h index 113e6b9b7fa..afe6682c90c 100644 --- a/src/widgets/graphicsview/qgraphicslayout.h +++ b/src/widgets/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/widgets/graphicsview/qgraphicslayout_p.cpp b/src/widgets/graphicsview/qgraphicslayout_p.cpp index c325602cc61..05e6cdf599a 100644 --- a/src/widgets/graphicsview/qgraphicslayout_p.cpp +++ b/src/widgets/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/widgets/graphicsview/qgraphicslinearlayout.cpp b/src/widgets/graphicsview/qgraphicslinearlayout.cpp index 5591638395b..40f9b1de71a 100644 --- a/src/widgets/graphicsview/qgraphicslinearlayout.cpp +++ b/src/widgets/graphicsview/qgraphicslinearlayout.cpp @@ -275,17 +275,13 @@ 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); + 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); + invalidate(); } /*! diff --git a/src/widgets/graphicsview/qgraphicswidget.cpp b/src/widgets/graphicsview/qgraphicswidget.cpp index 60a80fc8b88..06f7013c467 100644 --- a/src/widgets/graphicsview/qgraphicswidget.cpp +++ b/src/widgets/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/src/widgets/itemviews/qidentityproxymodel.cpp b/src/widgets/itemviews/qidentityproxymodel.cpp index 9396e6199a3..60f7d98bd82 100644 --- a/src/widgets/itemviews/qidentityproxymodel.cpp +++ b/src/widgets/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 @@ -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$ ** ****************************************************************************/ diff --git a/src/widgets/itemviews/qidentityproxymodel.h b/src/widgets/itemviews/qidentityproxymodel.h index 9e38e747eae..0c96e7f5bd0 100644 --- a/src/widgets/itemviews/qidentityproxymodel.h +++ b/src/widgets/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 @@ -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$ ** ****************************************************************************/ diff --git a/src/widgets/to_be_moved/qlinecontrol.cpp b/src/widgets/to_be_moved/qlinecontrol.cpp index 40ebb65d0ad..2a15555b897 100644 --- a/src/widgets/to_be_moved/qlinecontrol.cpp +++ b/src/widgets/to_be_moved/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/widgets/to_be_moved/qlinecontrol_p.h b/src/widgets/to_be_moved/qlinecontrol_p.h index 9e1adb67926..088a6e83d8b 100644 --- a/src/widgets/to_be_moved/qlinecontrol_p.h +++ b/src/widgets/to_be_moved/qlinecontrol_p.h @@ -61,7 +61,6 @@ #include "QtGui/qtextlayout.h" #include "QtWidgets/qstyleoption.h" #include "QtCore/qpointer.h" -#include "QtWidgets/qlineedit.h" #include "QtGui/qclipboard.h" #include "QtCore/qpoint.h" #include "QtWidgets/qcompleter.h" diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp index 816689019d7..0a3773c8af4 100644 --- a/src/widgets/widgets/qlineedit_p.cpp +++ b/src/widgets/widgets/qlineedit_p.cpp @@ -154,6 +154,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/widgets/widgets/qlineedit_p.h b/src/widgets/widgets/qlineedit_p.h index b3ec575c862..afb4aa6f0bf 100644 --- a/src/widgets/widgets/qlineedit_p.h +++ b/src/widgets/widgets/qlineedit_p.h @@ -84,7 +84,6 @@ public: ~QLineEditPrivate() { - delete control; } QLineControl *control; diff --git a/tests/arthur/baselineserver/src/baselineserver.cpp b/tests/arthur/baselineserver/src/baselineserver.cpp index 97ee80ce7c6..d546f1c9ddb 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/atwrapper/atWrapper.pro b/tests/auto/atwrapper/atWrapper.pro index 02218833a94..323ca1bf5fe 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/gui.pro b/tests/auto/gui.pro index afa6ad3a55b..df161f1fb2d 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 2b862d2447b..fe659407897 100644 --- a/tests/auto/host.pro +++ b/tests/auto/host.pro @@ -3,12 +3,10 @@ SUBDIRS=\ compiler \ headersclean \ maketestselftest \ - #moc \ # FIXME: cannot be built as part of qtbase, since it depends on qtsvg + moc \ uic \ qmake \ rcc \ #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 4fb9ac4f5ac..3aa4655ad0e 100644 --- a/tests/auto/moc/moc.pro +++ b/tests/auto/moc/moc.pro @@ -20,9 +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 -contains(QT_CONFIG, script): QT += script -contains(QT_CONFIG, qt3support): QT += qt3support +QT += sql network contains(QT_CONFIG, dbus){ DEFINES += WITH_DBUS QT += dbus diff --git a/tests/auto/moc/no-keywords.h b/tests/auto/moc/no-keywords.h index 06e20066694..1ebc4062c24 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 diff --git a/tests/auto/other.pro b/tests/auto/other.pro index c52014a1927..a84ab051046 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 \ diff --git a/tests/auto/qaccessibility/qaccessibility.pro b/tests/auto/qaccessibility/qaccessibility.pro index a4f606c6724..21e286baeaa 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 02af317f601..9143da658d7 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 f36a6fe622f..2ac5c7c53b6 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 eba7c006e5e..39bd09ef866 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 384c048f612..fc266a2a971 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 b35b1e0028c..6f01f6705f2 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 83ed9eb93cc..17431cf5a1b 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/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp index e7c63d540e9..447385a7d85 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 979f03df648..29ea07460eb 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(); @@ -95,6 +96,14 @@ void tst_QGraphicsLayout::sizeHints() } +enum FunctionType { + SetGeometry = 0, + Invalidate, + NumFunctionTypes +}; + + + class TestGraphicsWidget : public QGraphicsWidget { public: TestGraphicsWidget(QGraphicsWidget *parent = 0) : QGraphicsWidget(parent) @@ -108,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; }; @@ -122,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); @@ -217,17 +247,27 @@ class TestLayout : public QGraphicsLinearLayout TestLayout(QGraphicsLayoutItem *parent = 0) : QGraphicsLinearLayout(parent) { - m_count = 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() + { + ++(functionCount[Invalidate]); + QGraphicsLinearLayout::invalidate(); + } - int m_count; + void clearCounters() { + functionCount.clear(); + } + + QMap functionCount; }; void tst_QGraphicsLayout::verifyActivate() @@ -242,15 +282,280 @@ 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); + QGraphicsScene scene; + 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(); + + { + clearAllCounters(a); + + QCoreApplication::sendPostedEvents(); + QCoreApplication::processEvents(); + + alay->activate(); + QCOMPARE(alay->isActivated(), true); + QCOMPARE(blay->isActivated(), true); + QCOMPARE(clay->isActivated(), true); + QCOMPARE(dlay->isActivated(), true); + } + + { + 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); + + // 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); + } + + + { + 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), 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); +} + class Layout : public QGraphicsLayout { public: diff --git a/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp b/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp index 62ba1b4981e..8f8ac67d09a 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"); diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp index e8e2e23a9ea..887026caf40 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" diff --git a/tests/auto/qidentityproxymodel/tst_qidentityproxymodel.cpp b/tests/auto/qidentityproxymodel/tst_qidentityproxymodel.cpp index bbcdb4c0a7b..cfc3f1a6a8f 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$ ** ****************************************************************************/ diff --git a/tests/auto/qimage/qimage.pro b/tests/auto/qimage/qimage.pro index f845ad7b1c0..b517bc12378 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 4b3ab966538..ec6831e5cfb 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 29b0a05ddc7..08996e8cd4e 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 3fbc580d5cd..e84018f0a15 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 1f862b414bd..bb6d95027b1 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 8182394dd30..6af58b122ad 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/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 00000000000..3c850d486b8 --- /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 00000000000..2db08a29afd --- /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 00000000000..be0d80adf02 --- /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 00000000000..7c07859ae4e --- /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 81a51e10f38..afd28e10f4e 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"; diff --git a/tests/auto/qmenu/qmenu.pro b/tests/auto/qmenu/qmenu.pro index e1fcb884d51..3a32920b140 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 adce1642091..ba2dea8eb77 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 f162c1130a3..0e5ddadc1f7 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 5745e671c2b..e31fed5d107 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 2db6ff381e3..0a1bebcfb6f 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 9f8e2f4166e..f5df30cc1d3 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 1df29748cc5..ef310b82c89 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/qset/tst_qset.cpp b/tests/auto/qset/tst_qset.cpp index c28b68320e7..2c3403ae337 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"); } } diff --git a/tests/auto/qsettings/qsettings.pro b/tests/auto/qsettings/qsettings.pro index 151660d21c9..35bb56cc98d 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 5422fae00c9..bca4fc40fd4 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 6d132f5b68b..e367a8e1c14 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 066c24f3950..ee78b79c36d 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 37aec5fc2a0..69296cae2b9 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 adf021783b8..f6215f80a0b 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 773fb975a86..415f9cace2e 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 e7d6c039a63..cef2b300d76 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 8805fb9f616..e0eb4ef1936 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 4ee0d3745a5..d30d0926705 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 2c9c8d76b19..4824c11078f 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 fbbed3d8fa5..dfb7358127f 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 0d2c261f172..de4d29a2290 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/selftests/expected_cmptest.txt b/tests/auto/selftests/expected_cmptest.txt index 0beb46b26c2..df46703afa2 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 b7f462a1eb3..1735aeba23e 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 99809a8f9e7..443c6572b0c 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 165bdda81fd..901350b741e 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 4b53a435430..42f89a7cda9 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 8386190eb02..b49a5aa74d1 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 946fff9f493..e51be85bfb2 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/auto/uiloader/uiloader/uiloader.pro b/tests/auto/uiloader/uiloader/uiloader.pro index 4e95956522c..b959d438b7a 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 diff --git a/tests/benchmarks/corelib/tools/qhash/qhash_string.cpp b/tests/benchmarks/corelib/tools/qhash/qhash_string.cpp index d9e62cca00b..9bbea300ea2 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)