From b3ff342d327dc00d99281dca4fbfe6c4300aa6c6 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 20 Feb 2020 16:00:05 +0100 Subject: Revert "QQuickItemView: do not set parent to nullptr upon destruction" This reverts commit 5445fcac36d7122d533a2bdf0fcfe6206b7f3ff4. The original commit avoids a warning generated for a dubious use case and breaks controls2 in a non-trivial way as a side effect. We should rather live with the warning. Task-number: QTBUG-82368 Change-Id: I6197bb63036cb25ec3e88f549667519b8f3ff13a Reviewed-by: Mitch Curtis Reviewed-by: Fabian Kosmale --- src/quick/items/qquickitemview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/quick') diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp index 3e3a2c262b..7fb392233e 100644 --- a/src/quick/items/qquickitemview.cpp +++ b/src/quick/items/qquickitemview.cpp @@ -2419,7 +2419,7 @@ void QQuickItemView::destroyingItem(QObject *object) Q_D(QQuickItemView); QQuickItem* item = qmlobject_cast(object); if (item) { - QQuickItemPrivate::get(item)->setCulled(true); + item->setParentItem(nullptr); d->unrequestedItems.remove(item); } } -- cgit v1.2.3 From dd481a2bb4f858178b984a38cd8c3621d46446b7 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 19 Feb 2020 16:40:31 -0600 Subject: Fix texture coords for the compressed texture atlas The texture coords should be based on the actual image size, and not on the padded size. Change-Id: I262b7ca93e26c48324ec892a988f2fc62132175e Reviewed-by: Laszlo Agocs --- .../scenegraph/compressedtexture/qsgcompressedatlastexture.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/quick') diff --git a/src/quick/scenegraph/compressedtexture/qsgcompressedatlastexture.cpp b/src/quick/scenegraph/compressedtexture/qsgcompressedatlastexture.cpp index e981921c69..7c98e2c1e1 100644 --- a/src/quick/scenegraph/compressedtexture/qsgcompressedatlastexture.cpp +++ b/src/quick/scenegraph/compressedtexture/qsgcompressedatlastexture.cpp @@ -136,12 +136,12 @@ Texture::Texture(Atlas *atlas, const QRect &textureRect, const QByteArray &data, { float w = atlas->size().width(); float h = atlas->size().height(); - QRect nopad = atlasSubRect(); + const QRect &r = atlasSubRect(); // offset by half-pixel to prevent bleeding when scaling - m_texture_coords_rect = QRectF((nopad.x() + .5) / w, - (nopad.y() + .5) / h, - (nopad.width() - 1.) / w, - (nopad.height() - 1.) / h); + m_texture_coords_rect = QRectF((r.x() + .5) / w, + (r.y() + .5) / h, + (size.width() - 1.) / w, + (size.height() - 1.) / h); } Texture::~Texture() -- cgit v1.2.3 From 40cb674800e0ba90876e982160c3c5bcd2f0e929 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 17 Feb 2020 14:35:26 +0100 Subject: Doc: Fix QQuickTableView snippet Use static registration, provide a .pro file, and make it load and show the right file. Change-Id: I949831a399ce00cd8b3d012d8bd4e95a1efcdeb5 Reviewed-by: Simon Hausmann --- .../doc/snippets/qml/tableview/cpp-tablemodel.cpp | 47 ++--------- .../doc/snippets/qml/tableview/cpp-tablemodel.h | 94 ++++++++++++++++++++++ src/quick/doc/snippets/qml/tableview/tableview.pro | 20 +++++ src/quick/items/qquicktableview.cpp | 2 +- 4 files changed, 120 insertions(+), 43 deletions(-) create mode 100644 src/quick/doc/snippets/qml/tableview/cpp-tablemodel.h create mode 100644 src/quick/doc/snippets/qml/tableview/tableview.pro (limited to 'src/quick') diff --git a/src/quick/doc/snippets/qml/tableview/cpp-tablemodel.cpp b/src/quick/doc/snippets/qml/tableview/cpp-tablemodel.cpp index ea9f76f131..a8a37f80af 100644 --- a/src/quick/doc/snippets/qml/tableview/cpp-tablemodel.cpp +++ b/src/quick/doc/snippets/qml/tableview/cpp-tablemodel.cpp @@ -48,56 +48,19 @@ ** ****************************************************************************/ -//![0] +#include "cpp-tablemodel.h" #include -#include -#include - -class TableModel : public QAbstractTableModel -{ - Q_OBJECT - -public: - - int rowCount(const QModelIndex & = QModelIndex()) const override - { - return 200; - } - - int columnCount(const QModelIndex & = QModelIndex()) const override - { - return 200; - } - - QVariant data(const QModelIndex &index, int role) const override - { - switch (role) { - case Qt::DisplayRole: - return QString("%1, %2").arg(index.column()).arg(index.row()); - default: - break; - } - - return QVariant(); - } - - QHash roleNames() const override - { - return { {Qt::DisplayRole, "display"} }; - } -}; +#include int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); - qmlRegisterType("TableModel", 0, 1, "TableModel"); - - QQmlApplicationEngine engine; - engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); + QQuickView view; + view.setSource(QStringLiteral("qrc:/cpp-tablemodel.qml")); + view.show(); return app.exec(); } -#include "main.moc" //![0] diff --git a/src/quick/doc/snippets/qml/tableview/cpp-tablemodel.h b/src/quick/doc/snippets/qml/tableview/cpp-tablemodel.h new file mode 100644 index 0000000000..4a3c46b573 --- /dev/null +++ b/src/quick/doc/snippets/qml/tableview/cpp-tablemodel.h @@ -0,0 +1,94 @@ +/**************************************************************************** + ** + ** Copyright (C) 2020 The Qt Company Ltd. + ** Contact: https://www.qt.io/licensing/ + ** + ** This file is part of the documentation of the Qt Toolkit. + ** + ** $QT_BEGIN_LICENSE:BSD$ + ** Commercial License Usage + ** Licensees holding valid commercial Qt licenses may use this file in + ** accordance with the commercial license agreement provided with the + ** Software or, alternatively, in accordance with the terms contained in + ** a written agreement between you and The Qt Company. For licensing terms + ** and conditions see https://www.qt.io/terms-conditions. For further + ** information use the contact form at https://www.qt.io/contact-us. + ** + ** BSD License Usage + ** Alternatively, you may use this file under the terms of the BSD license + ** as follows: + ** + ** "Redistribution and use in source and binary forms, with or without + ** modification, are permitted provided that the following conditions are + ** met: + ** * Redistributions of source code must retain the above copyright + ** notice, this list of conditions and the following disclaimer. + ** * Redistributions in binary form must reproduce the above copyright + ** notice, this list of conditions and the following disclaimer in + ** the documentation and/or other materials provided with the + ** distribution. + ** * Neither the name of The Qt Company Ltd nor the names of its + ** contributors may be used to endorse or promote products derived + ** from this software without specific prior written permission. + ** + ** + ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." + ** + ** $QT_END_LICENSE$ + ** + ****************************************************************************/ + +#ifndef CPPTABLEMODEL_H +#define CPPTABLEMODEL_H + +//![0] +#include +#include + +class TableModel : public QAbstractTableModel +{ + Q_OBJECT + QML_ELEMENT + QML_ADDED_IN_MINOR_VERSION(1) + +public: + int rowCount(const QModelIndex & = QModelIndex()) const override + { + return 200; + } + + int columnCount(const QModelIndex & = QModelIndex()) const override + { + return 200; + } + + QVariant data(const QModelIndex &index, int role) const override + { + switch (role) { + case Qt::DisplayRole: + return QString("%1, %2").arg(index.column()).arg(index.row()); + default: + break; + } + + return QVariant(); + } + + QHash roleNames() const override + { + return { {Qt::DisplayRole, "display"} }; + } +}; +//![0] + +#endif // CPPTABLEMODEL_H diff --git a/src/quick/doc/snippets/qml/tableview/tableview.pro b/src/quick/doc/snippets/qml/tableview/tableview.pro new file mode 100644 index 0000000000..0821f1b5d3 --- /dev/null +++ b/src/quick/doc/snippets/qml/tableview/tableview.pro @@ -0,0 +1,20 @@ +TEMPLATE = app + +QT += qml quick + +CONFIG += qmltypes +QML_IMPORT_NAME = TableModel +QML_IMPORT_MAJOR_VERSION = 0 + +SOURCES += \ + cpp-tablemodel.cpp + +HEADERS += \ + cpp-tablemodel.h + +RESOURCES += \ + cpp-tablemodel.qml \ + qml-tablemodel.qml \ + reusabledelegate.qml \ + tableviewwithheader.qml \ + tableviewwithprovider.qml diff --git a/src/quick/items/qquicktableview.cpp b/src/quick/items/qquicktableview.cpp index 403801b7ae..6124c8304b 100644 --- a/src/quick/items/qquicktableview.cpp +++ b/src/quick/items/qquicktableview.cpp @@ -82,7 +82,7 @@ The following example shows how to create a model from C++ with multiple columns: - \snippet qml/tableview/cpp-tablemodel.cpp 0 + \snippet qml/tableview/cpp-tablemodel.h 0 And then how to use it from QML: -- cgit v1.2.3 From 033154229442e19bc675ab69015d460fe3aee775 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Mon, 13 Jan 2020 11:14:12 +0100 Subject: Warn when requesting unknown RHI backend When QSG_RHI_BACKEND is set to something we don't recognize. Change-Id: Ifa18cf38bc110e3a96b94fa89abac5bdfd70ba8a Reviewed-by: Laszlo Agocs --- src/quick/scenegraph/qsgrhisupport.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/quick') diff --git a/src/quick/scenegraph/qsgrhisupport.cpp b/src/quick/scenegraph/qsgrhisupport.cpp index 9194d3e730..cf30cb3f9a 100644 --- a/src/quick/scenegraph/qsgrhisupport.cpp +++ b/src/quick/scenegraph/qsgrhisupport.cpp @@ -157,6 +157,8 @@ void QSGRhiSupport::applySettings() } else if (rhiBackend == QByteArrayLiteral("null")) { m_rhiBackend = QRhi::Null; } else { + if (!rhiBackend.isEmpty()) + qWarning("Unknown key \"%s\" for QSG_RHI_BACKEND, falling back to default backend.", qPrintable(rhiBackend)); #if defined(Q_OS_WIN) m_rhiBackend = QRhi::D3D11; #elif defined(Q_OS_MACOS) || defined(Q_OS_IOS) -- cgit v1.2.3 From 8dcd51b63d26fcac466d80dc90942ae2cf3b4f4e Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Mon, 24 Feb 2020 17:26:41 +0000 Subject: Revert "Replace call to deprecated QNetworkReply::error method" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e5a4ba4a5573ace08def218b985dde83de0805fb. Reason for revert: it was decided to re-name a signal instead, like it's done in QProcess. Change-Id: I0f393c482d8be506430258d7afd4a0056611831f Reviewed-by: MÃ¥rten Nordheim --- src/quick/items/qquickborderimage.cpp | 2 +- src/quick/util/qquickfontloader.cpp | 2 +- src/quick/util/qquickpixmapcache.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/quick') diff --git a/src/quick/items/qquickborderimage.cpp b/src/quick/items/qquickborderimage.cpp index 32407a474f..3679df37d1 100644 --- a/src/quick/items/qquickborderimage.cpp +++ b/src/quick/items/qquickborderimage.cpp @@ -478,7 +478,7 @@ void QQuickBorderImage::sciRequestFinished() } d->redirectCount=0; - if (d->sciReply->networkError() != QNetworkReply::NoError) { + if (d->sciReply->error() != QNetworkReply::NoError) { d->status = Error; d->sciReply->deleteLater(); d->sciReply = nullptr; diff --git a/src/quick/util/qquickfontloader.cpp b/src/quick/util/qquickfontloader.cpp index 505c70df7c..2de9768243 100644 --- a/src/quick/util/qquickfontloader.cpp +++ b/src/quick/util/qquickfontloader.cpp @@ -121,7 +121,7 @@ void QQuickFontObject::replyFinished() } redirectCount = 0; - if (!reply->networkError()) { + if (!reply->error()) { id = QFontDatabase::addApplicationFontFromData(reply->readAll()); if (id != -1) emit fontDownloaded(QFontDatabase::applicationFontFamilies(id).at(0), QQuickFontLoader::Ready); diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp index 8846edcd44..d96ebe70b2 100644 --- a/src/quick/util/qquickpixmapcache.cpp +++ b/src/quick/util/qquickpixmapcache.cpp @@ -578,7 +578,7 @@ void QQuickPixmapReader::networkRequestDone(QNetworkReply *reply) QQuickPixmapReply::ReadError error = QQuickPixmapReply::NoError; QString errorString; QSize readSize; - if (reply->networkError()) { + if (reply->error()) { error = QQuickPixmapReply::Loading; errorString = reply->errorString(); } else { -- cgit v1.2.3 From 94901065ddd0c0c65e0db7c2151c0eb9eb3f64c5 Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Tue, 25 Feb 2020 09:33:15 +0100 Subject: QQuickColorSpaceValueType: Version import Change-Id: I9396157f4b85ac075343426b22fff98b436e80d6 Reviewed-by: Ulf Hermann --- src/quick/util/qquickvaluetypes_p.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/quick') diff --git a/src/quick/util/qquickvaluetypes_p.h b/src/quick/util/qquickvaluetypes_p.h index b6cbc37adb..638fdd2773 100644 --- a/src/quick/util/qquickvaluetypes_p.h +++ b/src/quick/util/qquickvaluetypes_p.h @@ -420,6 +420,7 @@ class QQuickColorSpaceValueType Q_PROPERTY(float gamma READ gamma WRITE setGamma FINAL) QML_NAMED_ELEMENT(ColorSpace) + QML_ADDED_IN_MINOR_VERSION(15) Q_CLASSINFO("RegisterEnumClassesUnscoped", "false") public: -- cgit v1.2.3 From bbe3f976c3426fea5dd305feff79288b9719fcd5 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 25 Feb 2020 11:14:36 +0100 Subject: Export QQuickRootItem to QML It was exported in 5.14, so we should probably still do so. Change-Id: Id44783c72fff50aee63d7c5a72f12ff9ca895a6b Reviewed-by: Fabian Kosmale --- src/quick/items/qquickwindow_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/quick') diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h index 86bdaf6396..e1ee7daf1c 100644 --- a/src/quick/items/qquickwindow_p.h +++ b/src/quick/items/qquickwindow_p.h @@ -88,7 +88,7 @@ class QRhiRenderBuffer; class QRhiRenderPassDescriptor; //Make it easy to identify and customize the root item if needed -class QQuickRootItem : public QQuickItem +class Q_QUICK_PRIVATE_EXPORT QQuickRootItem : public QQuickItem { Q_OBJECT public: -- cgit v1.2.3 From 685d2ca3c7a9f221ac12f6db61e02bab40371f5f Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 14 Feb 2020 13:56:59 +0100 Subject: Propagate the LanguageChange events from the QQuickWindow to the items Fixes: QTBUG-78141 Task-number: QTBUG-82020 Change-Id: Id47f8efe77cd3f6bfd330c8759059e19de5a86d2 Reviewed-by: Shawn Rutledge --- src/quick/items/qquickitem.cpp | 4 ++++ src/quick/items/qquickwindow.cpp | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'src/quick') diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index fe8df6fb64..bc68d46075 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -8254,6 +8254,10 @@ bool QQuickItem::event(QEvent *ev) ev->ignore(); break; #endif // gestures + case QEvent::LanguageChange: + for (QQuickItem *item : d->childItems) + QCoreApplication::sendEvent(item, ev); + break; default: return QObject::event(ev); } diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 426a30dfca..55292d2157 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -1767,6 +1767,10 @@ bool QQuickWindow::event(QEvent *e) if (d->activeFocusItem) QCoreApplication::sendEvent(d->activeFocusItem, e); return true; + case QEvent::LanguageChange: + if (d->contentItem) + QCoreApplication::sendEvent(d->contentItem, e); + break; default: break; } -- cgit v1.2.3 From 8dd18850714b9a8e7a51891a2c48f8ca94ffe014 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 25 Feb 2020 13:32:55 +0100 Subject: Revision properties and methods added in 5.15 Change-Id: I00e3f9535e819d9d0d547c9d3cf50be469cf9339 Reviewed-by: Fabian Kosmale --- src/quick/items/qquickanimatedsprite_p.h | 2 +- src/quick/items/qquickitemview_p.h | 4 ++-- src/quick/items/qquicktext_p.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/quick') diff --git a/src/quick/items/qquickanimatedsprite_p.h b/src/quick/items/qquickanimatedsprite_p.h index c28b6ce3af..546598a409 100644 --- a/src/quick/items/qquickanimatedsprite_p.h +++ b/src/quick/items/qquickanimatedsprite_p.h @@ -124,6 +124,7 @@ public: bool paused() const; int currentFrame() const; FinishBehavior finishBehavior() const; + void setFinishBehavior(FinishBehavior arg); Q_SIGNALS: @@ -172,7 +173,6 @@ public Q_SLOTS: void resetFrameDuration(); void setLoops(int arg); void setCurrentFrame(int arg); - void setFinishBehavior(FinishBehavior arg); private Q_SLOTS: void createEngine(); diff --git a/src/quick/items/qquickitemview_p.h b/src/quick/items/qquickitemview_p.h index 521580d292..3f83383cd5 100644 --- a/src/quick/items/qquickitemview_p.h +++ b/src/quick/items/qquickitemview_p.h @@ -303,8 +303,8 @@ protected Q_SLOTS: virtual void initItem(int index, QObject *item); void modelUpdated(const QQmlChangeSet &changeSet, bool reset); void destroyingItem(QObject *item); - void onItemPooled(int modelIndex, QObject *object); - void onItemReused(int modelIndex, QObject *object); + Q_REVISION(15) void onItemPooled(int modelIndex, QObject *object); + Q_REVISION(15) void onItemReused(int modelIndex, QObject *object); void animStopped(); void trackedPositionChanged(); diff --git a/src/quick/items/qquicktext_p.h b/src/quick/items/qquicktext_p.h index d310db508e..b64751b6f4 100644 --- a/src/quick/items/qquicktext_p.h +++ b/src/quick/items/qquicktext_p.h @@ -330,8 +330,8 @@ class QQuickTextLine : public QObject Q_PROPERTY(qreal height READ height WRITE setHeight) Q_PROPERTY(qreal x READ x WRITE setX) Q_PROPERTY(qreal y READ y WRITE setY) - Q_PROPERTY(qreal implicitWidth READ implicitWidth) - Q_PROPERTY(bool isLast READ isLast) + Q_PROPERTY(qreal implicitWidth READ implicitWidth REVISION 15) + Q_PROPERTY(bool isLast READ isLast REVISION 15) QML_ANONYMOUS public: -- cgit v1.2.3 From 46162c304195db2376706f2e1a9da2b2c938e97b Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 19 Feb 2020 14:00:46 +0100 Subject: QQuickTableView: Immediately delete delegates when possible In the dtor we don't need to care about any side effects a direct delete may have. Rather, any deleteLater() may not take effect anymore as the event loop may be gone already. Task-number: QTBUG-82000 Change-Id: I97935dc47fbbfd0c050e80c333c36a05f685c45d Reviewed-by: Joni Poikelin Reviewed-by: Simon Hausmann Reviewed-by: Ulf Hermann --- src/quick/items/qquicktableview.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/quick') diff --git a/src/quick/items/qquicktableview.cpp b/src/quick/items/qquicktableview.cpp index 4b34e3b2c1..4105996b31 100644 --- a/src/quick/items/qquicktableview.cpp +++ b/src/quick/items/qquicktableview.cpp @@ -441,7 +441,16 @@ QQuickTableViewPrivate::QQuickTableViewPrivate() QQuickTableViewPrivate::~QQuickTableViewPrivate() { - releaseLoadedItems(QQmlTableInstanceModel::NotReusable); + for (auto *fxTableItem : loadedItems) { + if (auto item = fxTableItem->item) { + if (fxTableItem->ownItem) + delete item; + else if (tableModel) + tableModel->dispose(item); + } + delete fxTableItem; + } + if (tableModel) delete tableModel; } -- cgit v1.2.3 From 8319597ae30219c71aef9d2086e8e8294802686c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Arve=20S=C3=A6ther?= Date: Tue, 25 Feb 2020 16:42:15 +0100 Subject: Properly deprecate QQuickText::doLayout() and get rid of it for Qt6 It was only deprecated through its documentation. Change-Id: I0b7bdeec4ed965c3df627a03ab0e539c4e9c2018 Reviewed-by: Shawn Rutledge --- src/quick/items/qquicktext.cpp | 4 ++++ src/quick/items/qquicktext_p.h | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src/quick') diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp index 1c7f1ca6aa..f39e8e0316 100644 --- a/src/quick/items/qquicktext.cpp +++ b/src/quick/items/qquicktext.cpp @@ -2969,6 +2969,8 @@ void QQuickText::setRenderType(QQuickText::RenderType renderType) d->updateLayout(); } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) +#if QT_DEPRECATED_SINCE(5, 15) /*! \qmlmethod QtQuick::Text::doLayout() \deprecated @@ -2980,6 +2982,8 @@ void QQuickText::doLayout() forceLayout(); } +#endif +#endif /*! \qmlmethod QtQuick::Text::forceLayout() \since 5.9 diff --git a/src/quick/items/qquicktext_p.h b/src/quick/items/qquicktext_p.h index b64751b6f4..0fffc1fb9a 100644 --- a/src/quick/items/qquicktext_p.h +++ b/src/quick/items/qquicktext_p.h @@ -223,7 +223,12 @@ public: QRectF boundingRect() const override; QRectF clipRect() const override; - Q_INVOKABLE void doLayout(); // ### Qt 6: remove +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) +#if QT_DEPRECATED_SINCE(5, 15) + QT_DEPRECATED_X("Use forceLayout() instead") + Q_INVOKABLE void doLayout(); +#endif +#endif Q_REVISION(9) Q_INVOKABLE void forceLayout(); RenderType renderType() const; -- cgit v1.2.3 From d8f6f41c334d14c4712b1dc16554f80bb1290e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Arve=20S=C3=A6ther?= Date: Wed, 26 Feb 2020 09:35:10 +0100 Subject: Deprecate non-const version of saveToFile() It will be removed in Qt 6 Change-Id: I7d8853ce3008bb2c594caa5a23e2964158717fe4 Reviewed-by: Shawn Rutledge --- src/quick/items/qquickitemgrabresult.cpp | 2 ++ src/quick/items/qquickitemgrabresult.h | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src/quick') diff --git a/src/quick/items/qquickitemgrabresult.cpp b/src/quick/items/qquickitemgrabresult.cpp index f298803c7f..00e84536e9 100644 --- a/src/quick/items/qquickitemgrabresult.cpp +++ b/src/quick/items/qquickitemgrabresult.cpp @@ -195,6 +195,7 @@ bool QQuickItemGrabResult::saveToFile(const QString &fileName) const } #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) +#if QT_DEPRECATED_SINCE(5, 15) /*! * \overload * \internal @@ -203,6 +204,7 @@ bool QQuickItemGrabResult::saveToFile(const QString &fileName) { return qAsConst(*this).saveToFile(fileName); } +#endif #endif // < Qt 6 QUrl QQuickItemGrabResult::url() const diff --git a/src/quick/items/qquickitemgrabresult.h b/src/quick/items/qquickitemgrabresult.h index c92a8c52f4..a45ed62ed5 100644 --- a/src/quick/items/qquickitemgrabresult.h +++ b/src/quick/items/qquickitemgrabresult.h @@ -68,7 +68,10 @@ public: QUrl url() const; #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - Q_INVOKABLE bool saveToFile(const QString &fileName); // ### Qt 6: remove +#if QT_DEPRECATED_SINCE(5, 15) + QT_DEPRECATED_X("This overload is deprecated. Use the const member function instead") + Q_INVOKABLE bool saveToFile(const QString &fileName); +#endif #endif Q_INVOKABLE bool saveToFile(const QString &fileName) const; -- cgit v1.2.3 From be2c7864983b23b6337305b4653987b1efa8718e Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Mon, 2 Mar 2020 12:05:07 +0100 Subject: doc: fix typo in signal name Change-Id: I19b3a78ddbde481af8847a3d340e62d56240de29 Reviewed-by: Ulf Hermann --- src/quick/items/qquickwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/quick') diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 55292d2157..acc1df7496 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -4438,7 +4438,7 @@ QQmlIncubationController *QQuickWindow::incubationController() const OpenGL context is actually created. QQuickWindow::openglContext() will still return 0 for this window - until after the QQuickWindow::sceneGraphInitialize() has been + until after the QQuickWindow::sceneGraphInitialized() has been emitted. \note -- cgit v1.2.3 From b760d972459fd3b0c41e4c85076fa933ba5c0d1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Sun, 1 Mar 2020 15:14:34 +0100 Subject: Fix building qtdeclarative without QMovie support Change-Id: Id8e8b04e722bd9fc84b6b78530f75cf8d6d96da7 Reviewed-by: Ulf Hermann Reviewed-by: Shawn Rutledge --- src/quick/items/qquickitemsmodule_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/quick') diff --git a/src/quick/items/qquickitemsmodule_p.h b/src/quick/items/qquickitemsmodule_p.h index 28dff65dff..815c5ae644 100644 --- a/src/quick/items/qquickitemsmodule_p.h +++ b/src/quick/items/qquickitemsmodule_p.h @@ -78,7 +78,7 @@ struct QQuickAnimatedImageNotAvailable Q_GADGET QML_UNAVAILABLE QML_NAMED_ELEMENT(AnimatedImage) - QML_ADDED_IN_VERSION(2, 0) + QML_ADDED_IN_MINOR_VERSION(0) QML_UNCREATABLE("Qt was built without support for QMovie.") }; #endif -- cgit v1.2.3 From 254a56252874b63430701351dcd8c9bef8507353 Mon Sep 17 00:00:00 2001 From: Wang Chuan Date: Wed, 26 Feb 2020 21:14:50 +0800 Subject: QQuickItem: prevent endless loop in focus tab chain Since the commit a18ab2a3822e0d, we promote the [startItem] in focus tab chain when it is invisible to prevent endless loop. However the problem still happen if the [startItem] is equal to [firstFromItem] Fixes it by compare the [current] item with the original start item Fixes: QTBUG-81510 Change-Id: Iae0207f39e2b8c4fc6ed0cf36f0a855668accfba Reviewed-by: Mitch Curtis Reviewed-by: Liang Qi Reviewed-by: Shawn Rutledge --- src/quick/items/qquickitem.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/quick') diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 3785abc450..11c1f12e75 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -2568,6 +2568,7 @@ QQuickItem* QQuickItemPrivate::nextPrevItemInTabFocusChain(QQuickItem *item, boo bool skip = false; QQuickItem *startItem = item; + QQuickItem *originalStartItem = startItem; // Protect from endless loop: // If we start on an invisible item we will not find it again. // If there is no other item which can become the focus item, we have a forever loop, @@ -2643,7 +2644,12 @@ QQuickItem* QQuickItemPrivate::nextPrevItemInTabFocusChain(QQuickItem *item, boo } } from = last; - if (current == startItem && from == firstFromItem) { + // if [from] item is equal to [firstFromItem], means we have traversed one path and + // jump back to parent of the chain, and then we have to check whether we have + // traversed all of the chain (by compare the [current] item with [startItem]) + // Since the [startItem] might be promoted to its parent if it is invisible, + // we still have to check [current] item with original start item + if ((current == startItem || current == originalStartItem) && from == firstFromItem) { // wrapped around, avoid endless loops if (item == contentItem) { qCDebug(DBG_FOCUS) << "QQuickItemPrivate::nextPrevItemInTabFocusChain: looped, return contentItem"; -- cgit v1.2.3 From ec33541cf3873bc311522d3ae24c75cf6aa28a6b Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 6 Mar 2020 08:07:56 +0100 Subject: Doc: clarify the fontSizeMode property in terms of Rich and Styled text Fixes: QTBUG-56650 Change-Id: I7b750031f3af368de7f7cebe64a5d1ce77f68408 Reviewed-by: Paul Wicking --- src/quick/items/qquicktext.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/quick') diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp index f39e8e0316..216914197f 100644 --- a/src/quick/items/qquicktext.cpp +++ b/src/quick/items/qquicktext.cpp @@ -2650,6 +2650,12 @@ void QQuickText::setLineHeightMode(LineHeightMode mode) If the text does not fit within the item bounds with the minimum font size the text will be elided as per the \l elide property. + + If the \l textFormat property is set to \l Text.RichText, this will have no effect at all as the + property will be ignored completely. If \l textFormat is set to \l Text.StyledText, then the + property will be respected provided there is no font size tags inside the text. If there are + font size tags, the property will still respect those. This can cause it to not fully comply with + the fontSizeMode setting. */ QQuickText::FontSizeMode QQuickText::fontSizeMode() const -- cgit v1.2.3 From 12ddd8da1b2dcfbbca10a6915547456601a726c0 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 6 Mar 2020 11:11:32 +0100 Subject: Avoid using deprecated QTabletEvent::device() That member was removed in qtbase dev. Change-Id: Ia2e69ee53e154fdb9b8b4c707ac5a463011cf0c1 Reviewed-by: Shawn Rutledge --- src/quick/items/qquickevents.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/quick') diff --git a/src/quick/items/qquickevents.cpp b/src/quick/items/qquickevents.cpp index 2b3ea7d63d..15f138583f 100644 --- a/src/quick/items/qquickevents.cpp +++ b/src/quick/items/qquickevents.cpp @@ -680,7 +680,7 @@ QQuickPointerDevice *QQuickPointerDevice::tabletDevice(const QTabletEvent *event // TODO Qt 6: we can't know for sure about XTilt or YTilt until we have a // QTabletDevice populated with capabilities provided by QPA plugins - switch (event->device()) { + switch (event->deviceType()) { case QTabletEvent::Stylus: type = QQuickPointerDevice::Stylus; buttonCount = 3; -- cgit v1.2.3