diff options
Diffstat (limited to 'src/quick/util')
-rw-r--r-- | src/quick/util/qquickanimation.cpp | 18 | ||||
-rw-r--r-- | src/quick/util/qquickanimationcontroller.cpp | 2 | ||||
-rw-r--r-- | src/quick/util/qquickanimator.cpp | 1 | ||||
-rw-r--r-- | src/quick/util/qquickbehavior.cpp | 2 | ||||
-rw-r--r-- | src/quick/util/qquickfontloader.cpp | 2 | ||||
-rw-r--r-- | src/quick/util/qquickimageprovider.cpp | 2 | ||||
-rw-r--r-- | src/quick/util/qquickpath.cpp | 14 | ||||
-rw-r--r-- | src/quick/util/qquickpath_p.h | 1 | ||||
-rw-r--r-- | src/quick/util/qquickpixmapcache.cpp | 9 | ||||
-rw-r--r-- | src/quick/util/qquickpixmapcache_p.h | 4 | ||||
-rw-r--r-- | src/quick/util/qquickpropertychanges.cpp | 4 | ||||
-rw-r--r-- | src/quick/util/qquickstatechangescript.cpp | 2 | ||||
-rw-r--r-- | src/quick/util/qquickstategroup.cpp | 2 | ||||
-rw-r--r-- | src/quick/util/qquickutilmodule.cpp | 9 | ||||
-rw-r--r-- | src/quick/util/util.pri | 9 |
15 files changed, 35 insertions, 46 deletions
diff --git a/src/quick/util/qquickanimation.cpp b/src/quick/util/qquickanimation.cpp index 9de474ac36..1a2441171d 100644 --- a/src/quick/util/qquickanimation.cpp +++ b/src/quick/util/qquickanimation.cpp @@ -192,14 +192,14 @@ QQmlProperty QQuickAbstractAnimationPrivate::createProperty(QObject *obj, const if (errorMessage) *errorMessage = message; else - qmlInfo(infoObj) << message; + qmlWarning(infoObj) << message; return QQmlProperty(); } else if (!prop.isWritable()) { const QString message = QQuickAbstractAnimation::tr("Cannot animate read-only property \"%1\"").arg(str); if (errorMessage) *errorMessage = message; else - qmlInfo(infoObj) << message; + qmlWarning(infoObj) << message; return QQmlProperty(); } return prop; @@ -256,7 +256,7 @@ void QQuickAbstractAnimation::setRunning(bool r) return; if (d->group || d->disableUserControl) { - qmlInfo(this) << "setRunning() cannot be used on non-root animation nodes."; + qmlWarning(this) << "setRunning() cannot be used on non-root animation nodes."; return; } @@ -322,12 +322,12 @@ void QQuickAbstractAnimation::setPaused(bool p) return; if (!d->running) { - qmlInfo(this) << "setPaused() cannot be used when animation isn't running."; + qmlWarning(this) << "setPaused() cannot be used when animation isn't running."; return; } if (d->group || d->disableUserControl) { - qmlInfo(this) << "setPaused() cannot be used on non-root animation nodes."; + qmlWarning(this) << "setPaused() cannot be used on non-root animation nodes."; return; } @@ -709,7 +709,7 @@ int QQuickPauseAnimation::duration() const void QQuickPauseAnimation::setDuration(int duration) { if (duration < 0) { - qmlInfo(this) << tr("Cannot set a duration of < 0"); + qmlWarning(this) << tr("Cannot set a duration of < 0"); return; } @@ -1004,7 +1004,7 @@ void QQuickScriptActionPrivate::execute() QQmlExpression expr(scriptStr); expr.evaluate(); if (expr.hasError()) - qmlInfo(q) << expr.error(); + qmlWarning(q) << expr.error(); } } @@ -2077,7 +2077,7 @@ int QQuickPropertyAnimation::duration() const void QQuickPropertyAnimation::setDuration(int duration) { if (duration < 0) { - qmlInfo(this) << tr("Cannot set a duration of < 0"); + qmlWarning(this) << tr("Cannot set a duration of < 0"); return; } @@ -2644,7 +2644,7 @@ QQuickStateActions QQuickPropertyAnimation::createTransitionActions(QQuickStateA if (!successfullyCreatedDefaultProperty) { for (const QString &errorMessage : qAsConst(errorMessages)) - qmlInfo(this) << errorMessage; + qmlWarning(this) << errorMessage; } } diff --git a/src/quick/util/qquickanimationcontroller.cpp b/src/quick/util/qquickanimationcontroller.cpp index 4bc2d6319e..fa1ade50d1 100644 --- a/src/quick/util/qquickanimationcontroller.cpp +++ b/src/quick/util/qquickanimationcontroller.cpp @@ -169,7 +169,7 @@ void QQuickAnimationController::setAnimation(QQuickAbstractAnimation *animation) if (animation != d->animation) { if (animation) { if (animation->userControlDisabled()) { - qmlInfo(this) << "QQuickAnimationController::setAnimation: the animation is controlled by others, can't be used in AnimationController."; + qmlWarning(this) << "QQuickAnimationController::setAnimation: the animation is controlled by others, can't be used in AnimationController."; return; } animation->setDisableUserControl(); diff --git a/src/quick/util/qquickanimator.cpp b/src/quick/util/qquickanimator.cpp index 5d2af0f940..c3b5865369 100644 --- a/src/quick/util/qquickanimator.cpp +++ b/src/quick/util/qquickanimator.cpp @@ -50,6 +50,7 @@ QT_BEGIN_NAMESPACE \inqmlmodule QtQuick \since 5.2 \ingroup qtquick-transitions-animations + \inherits Animation \brief Is the base of all QML animators. Animator types are a special type of animation which operate diff --git a/src/quick/util/qquickbehavior.cpp b/src/quick/util/qquickbehavior.cpp index 9af1d41b29..1b2d9afb7c 100644 --- a/src/quick/util/qquickbehavior.cpp +++ b/src/quick/util/qquickbehavior.cpp @@ -129,7 +129,7 @@ void QQuickBehavior::setAnimation(QQuickAbstractAnimation *animation) { Q_D(QQuickBehavior); if (d->animation) { - qmlInfo(this) << tr("Cannot change the animation assigned to a Behavior."); + qmlWarning(this) << tr("Cannot change the animation assigned to a Behavior."); return; } diff --git a/src/quick/util/qquickfontloader.cpp b/src/quick/util/qquickfontloader.cpp index d13291c30a..3761a37a6d 100644 --- a/src/quick/util/qquickfontloader.cpp +++ b/src/quick/util/qquickfontloader.cpp @@ -307,7 +307,7 @@ void QQuickFontLoader::updateFontInfo(const QString& name, QQuickFontLoader::Sta } if (status != d->status) { if (status == Error) - qmlInfo(this) << "Cannot load font: \"" << d->url.toString() << '"'; + qmlWarning(this) << "Cannot load font: \"" << d->url.toString() << '"'; d->status = status; emit statusChanged(); } diff --git a/src/quick/util/qquickimageprovider.cpp b/src/quick/util/qquickimageprovider.cpp index c4182d9f93..7788635e3e 100644 --- a/src/quick/util/qquickimageprovider.cpp +++ b/src/quick/util/qquickimageprovider.cpp @@ -514,9 +514,9 @@ public: /*! \class QQuickImageProviderOptions - \since 5.9 \brief The QQuickImageProviderOptions class provides options for QQuickImageProviderWithOptions image requests. \inmodule QtQuick + \internal \sa QQuickImageProviderWithOptions */ diff --git a/src/quick/util/qquickpath.cpp b/src/quick/util/qquickpath.cpp index 25a4433a9b..e31aed7b6d 100644 --- a/src/quick/util/qquickpath.cpp +++ b/src/quick/util/qquickpath.cpp @@ -149,20 +149,6 @@ bool QQuickPath::isClosed() const return d->closed; } -bool QQuickPath::hasEnd() const -{ - Q_D(const QQuickPath); - for (int i = d->_pathElements.count() - 1; i > -1; --i) { - if (QQuickCurve *curve = qobject_cast<QQuickCurve *>(d->_pathElements.at(i))) { - if ((!curve->hasX() && !curve->hasRelativeX()) || (!curve->hasY() && !curve->hasRelativeY())) - return false; - else - return true; - } - } - return hasStartX() && hasStartY(); -} - /*! \qmlproperty list<PathElement> QtQuick::Path::pathElements This property holds the objects composing the path. diff --git a/src/quick/util/qquickpath_p.h b/src/quick/util/qquickpath_p.h index 06ad389b49..c0a96cad4f 100644 --- a/src/quick/util/qquickpath_p.h +++ b/src/quick/util/qquickpath_p.h @@ -390,7 +390,6 @@ public: bool hasStartY() const; bool isClosed() const; - bool hasEnd() const; QPainterPath path() const; QStringList attributes() const; diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp index 7b369a2d0f..1c6b2afb54 100644 --- a/src/quick/util/qquickpixmapcache.cpp +++ b/src/quick/util/qquickpixmapcache.cpp @@ -695,15 +695,6 @@ void QQuickPixmapReader::processJob(QQuickPixmapReply *runningJob, const QUrl &u QQuickImageProviderWithOptions *providerV2 = provider->d->isProviderWithOptions ? static_cast<QQuickImageProviderWithOptions *>(provider) : nullptr; - if (!provider->d->isProviderWithOptions && - (providerOptions.autoTransform() != QQuickImageProviderOptions::UsePluginDefaultTransform - || providerOptions.preserveAspectRatioCrop() - || providerOptions.preserveAspectRatioFit()) - ) - { - qWarning() << "Trying to pass extra request flags to provider but it is not a QQuickImageProviderWithOptions"; - } - switch (imageType) { case QQuickImageProvider::Invalid: { diff --git a/src/quick/util/qquickpixmapcache_p.h b/src/quick/util/qquickpixmapcache_p.h index eea6a7a454..f7cdfa7d07 100644 --- a/src/quick/util/qquickpixmapcache_p.h +++ b/src/quick/util/qquickpixmapcache_p.h @@ -91,7 +91,7 @@ public: }; // ### Qt 6: Make public moving to qquickimageprovider.h -class Q_QUICK_EXPORT QQuickImageProviderOptions +class Q_QUICK_PRIVATE_EXPORT QQuickImageProviderOptions { public: enum AutoTransform { @@ -188,7 +188,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickPixmap::Options) // This class will disappear with Qt6 and will just be the regular QQuickImageProvider // ### Qt 6: Remove this class and fold it with QQuickImageProvider -class Q_QUICK_EXPORT QQuickImageProviderWithOptions : public QQuickAsyncImageProvider +class Q_QUICK_PRIVATE_EXPORT QQuickImageProviderWithOptions : public QQuickAsyncImageProvider { public: QQuickImageProviderWithOptions(ImageType type, Flags flags = Flags()); diff --git a/src/quick/util/qquickpropertychanges.cpp b/src/quick/util/qquickpropertychanges.cpp index fafa2edd0b..20aa52e472 100644 --- a/src/quick/util/qquickpropertychanges.cpp +++ b/src/quick/util/qquickpropertychanges.cpp @@ -397,10 +397,10 @@ QQuickPropertyChangesPrivate::property(const QString &property) Q_Q(QQuickPropertyChanges); QQmlProperty prop(object, property, qmlContext(q)); if (!prop.isValid()) { - qmlInfo(q) << QQuickPropertyChanges::tr("Cannot assign to non-existent property \"%1\"").arg(property); + qmlWarning(q) << QQuickPropertyChanges::tr("Cannot assign to non-existent property \"%1\"").arg(property); return QQmlProperty(); } else if (!(prop.type() & QQmlProperty::SignalProperty) && !prop.isWritable()) { - qmlInfo(q) << QQuickPropertyChanges::tr("Cannot assign to read-only property \"%1\"").arg(property); + qmlWarning(q) << QQuickPropertyChanges::tr("Cannot assign to read-only property \"%1\"").arg(property); return QQmlProperty(); } return prop; diff --git a/src/quick/util/qquickstatechangescript.cpp b/src/quick/util/qquickstatechangescript.cpp index 86b70fe879..a70fa1a676 100644 --- a/src/quick/util/qquickstatechangescript.cpp +++ b/src/quick/util/qquickstatechangescript.cpp @@ -131,7 +131,7 @@ void QQuickStateChangeScript::execute() QQmlExpression expr(d->script); expr.evaluate(); if (expr.hasError()) - qmlInfo(this, expr.error()); + qmlWarning(this, expr.error()); } } diff --git a/src/quick/util/qquickstategroup.cpp b/src/quick/util/qquickstategroup.cpp index 200f243a1b..f2cd4638fc 100644 --- a/src/quick/util/qquickstategroup.cpp +++ b/src/quick/util/qquickstategroup.cpp @@ -438,7 +438,7 @@ void QQuickStateGroupPrivate::setCurrentStateInternal(const QString &state, } if (applyingState) { - qmlInfo(q) << "Can't apply a state change as part of a state definition."; + qmlWarning(q) << "Can't apply a state change as part of a state definition."; return; } diff --git a/src/quick/util/qquickutilmodule.cpp b/src/quick/util/qquickutilmodule.cpp index 77dae0d001..b2e5b84cf4 100644 --- a/src/quick/util/qquickutilmodule.cpp +++ b/src/quick/util/qquickutilmodule.cpp @@ -54,7 +54,9 @@ #include "qquicktextmetrics_p.h" #include "qquicktransition_p.h" #include "qquickanimator_p.h" +#if QT_CONFIG(shortcut) #include "qquickshortcut_p.h" +#endif #include "qquickvalidator_p.h" #include <qqmlinfo.h> #include <private/qqmltypenotavailable_p.h> @@ -63,7 +65,9 @@ #include <QtGui/QInputMethod> #include <QtGui/QKeySequence> +#if QT_CONFIG(shortcut) Q_DECLARE_METATYPE(QKeySequence::StandardKey) +#endif void QQuickUtilModule::defineModule() { @@ -114,15 +118,18 @@ void QQuickUtilModule::defineModule() qmlRegisterCustomType<QQuickPropertyChanges>("QtQuick",2,0,"PropertyChanges", new QQuickPropertyChangesParser); +#if QT_CONFIG(shortcut) qRegisterMetaType<QKeySequence::StandardKey>(); qmlRegisterUncreatableType<QKeySequence, 2>("QtQuick", 2, 2, "StandardKey", QStringLiteral("Cannot create an instance of StandardKey.")); +#endif qmlRegisterType<QQuickFontMetrics>("QtQuick", 2, 4, "FontMetrics"); qmlRegisterType<QQuickTextMetrics>("QtQuick", 2, 4, "TextMetrics"); +#if QT_CONFIG(shortcut) qmlRegisterType<QQuickShortcut>("QtQuick", 2, 5, "Shortcut"); - qmlRegisterType<QQuickShortcut,1>("QtQuick", 2, 6, "Shortcut"); qmlRegisterType<QQuickShortcut,9>("QtQuick", 2, 9, "Shortcut"); +#endif } diff --git a/src/quick/util/util.pri b/src/quick/util/util.pri index 1ef1018a31..b53b132cce 100644 --- a/src/quick/util/util.pri +++ b/src/quick/util/util.pri @@ -26,7 +26,6 @@ SOURCES += \ $$PWD/qquickanimatorcontroller.cpp \ $$PWD/qquickfontmetrics.cpp \ $$PWD/qquicktextmetrics.cpp \ - $$PWD/qquickshortcut.cpp \ $$PWD/qquickvalidator.cpp !contains(QT_CONFIG, no-qml-debug): SOURCES += $$PWD/qquickprofiler.cpp @@ -63,9 +62,15 @@ HEADERS += \ $$PWD/qquickprofiler_p.h \ $$PWD/qquickfontmetrics_p.h \ $$PWD/qquicktextmetrics_p.h \ - $$PWD/qquickshortcut_p.h \ $$PWD/qquickvalidator_p.h +qtConfig(shortcut) { + SOURCES += \ + $$PWD/qquickshortcut.cpp + HEADERS += \ + $$PWD/qquickshortcut_p.h +} + qtConfig(quick-path) { SOURCES += \ $$PWD/qquickpath.cpp \ |