From 1ce725cb60358a31b1107ab5c892abb7ceca8453 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Thu, 14 Apr 2011 13:58:25 +0200 Subject: 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 ++++++++++---------- 2 files changed, 21 insertions(+), 20 deletions(-) (limited to 'src') 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$ ** ****************************************************************************/ -- cgit v1.2.3 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: 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 +- src/gui/graphicsview/qgraphicslinearlayout.cpp | 9 +- src/gui/graphicsview/qgraphicswidget.cpp | 105 +++++++++++++------ 5 files changed, 190 insertions(+), 76 deletions(-) (limited to 'src') 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); } } -- cgit v1.2.3 From 446a7ba4ff1bbb3aeafb86eb318aa5f34f327edd Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Thu, 14 Apr 2011 15:30:34 +0200 Subject: Fix licence headers again for MR 900 See commit b00089261eafbdf5f92ed94d7fb20b402bfcaeb2 Reviewed-by: Gabriel de Dietrich (cherry picked from commit bc16ebdb7aeff70fe8149297183636ea7fd14ed1) --- src/gui/itemviews/qidentityproxymodel.cpp | 14 +++++++++----- src/gui/itemviews/qidentityproxymodel.h | 13 +++++++++---- 2 files changed, 18 insertions(+), 9 deletions(-) (limited to 'src') 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 -- cgit v1.2.3 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: 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) --- src/gui/graphicsview/qgraphicslinearlayout.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src') 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(); } -- cgit v1.2.3 From 38ed8c2dddfe55c4a940adb534fa41ecae02af69 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Tue, 26 Apr 2011 18:41:15 +0200 Subject: 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(-) (limited to 'src') 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; -- cgit v1.2.3 From 4214ddc1d9c9662ab646f2ab4ba0bccb0ead6b64 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 12 May 2011 16:21:03 +0200 Subject: 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(+) (limited to 'src') 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 -- cgit v1.2.3 From 1a1471718d6c99a52211ab060f3627c2478bb738 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 12 May 2011 19:00:15 +0200 Subject: 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(-) (limited to 'src') 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); -- cgit v1.2.3 From d9119535a2e3fcb977998ab1f7006f8a15b5a140 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Thu, 12 May 2011 17:23:14 +1000 Subject: 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(-) (limited to 'src') 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 -- cgit v1.2.3 From 542ba35f2f0dfd265435f32ee79e498226989e6c Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 12 May 2011 16:20:03 +0200 Subject: 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 ++++++++++++++-------- src/plugins/platforms/wayland/qwaylandclipboard.h | 9 +++++++- 2 files changed, 24 insertions(+), 10 deletions(-) (limited to 'src') 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 -- cgit v1.2.3 From 7d756ed7186f80d700eac5b963b63d4290d08fcd Mon Sep 17 00:00:00 2001 From: Eckhart Koppen Date: Fri, 13 May 2011 13:15:04 +0300 Subject: 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(-) (limited to 'src') 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 }; -- cgit v1.2.3 From 23d98f70b9303777c880e5caf1e2c1a30ec1885e Mon Sep 17 00:00:00 2001 From: Eckhart Koppen Date: Fri, 13 May 2011 13:22:30 +0300 Subject: 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(-) (limited to 'src') 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 -- cgit v1.2.3 From 36c29abc0dee755366c327bb68166c0b1877b4ff Mon Sep 17 00:00:00 2001 From: Eckhart Koppen Date: Fri, 13 May 2011 13:47:56 +0300 Subject: 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(-) (limited to 'src') 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) { -- cgit v1.2.3 From a9c2c15487d634796c8c9041c156f59ad6131fe9 Mon Sep 17 00:00:00 2001 From: Eckhart Koppen Date: Fri, 13 May 2011 15:38:00 +0300 Subject: 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(-) (limited to 'src') 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} } -- cgit v1.2.3 From 73e1f35fa39d64aa5f048df44382bd193f1aad44 Mon Sep 17 00:00:00 2001 From: Eckhart Koppen Date: Fri, 13 May 2011 18:36:12 +0300 Subject: Removed duplicate setting of QT dependencies Reviewed-by: TrustMe --- src/plugins/platforms/xcb/xcb.pro | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') 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 \ -- cgit v1.2.3