diff options
Diffstat (limited to 'src/quicktemplates2/qquicktooltip.cpp')
-rw-r--r-- | src/quicktemplates2/qquicktooltip.cpp | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/quicktemplates2/qquicktooltip.cpp b/src/quicktemplates2/qquicktooltip.cpp index 3ce4c762..bf83a725 100644 --- a/src/quicktemplates2/qquicktooltip.cpp +++ b/src/quicktemplates2/qquicktooltip.cpp @@ -107,7 +107,7 @@ QT_BEGIN_NAMESPACE Should one need more fine-grained control over the tool tip position, or multiple simultaneous tool tip instances are needed, it is also possible to create local tool tip instances. This way, it is possible to - \l {Customizing ToolTip}{customize} the tool tip, and the whole \l Popup + \l {Customizing ToolTip}{customize} the tool tip, and the whole \l Popup API is available. The following example presents a tool tip that presents the value of a slider when the handle is dragged. @@ -123,7 +123,11 @@ class QQuickToolTipPrivate : public QQuickPopupPrivate Q_DECLARE_PUBLIC(QQuickToolTip) public: - QQuickToolTipPrivate() : delay(0), timeout(-1) { } + QQuickToolTipPrivate() + : delay(0), + timeout(-1) + { + } void startDelay(); void stopDelay(); @@ -162,8 +166,8 @@ void QQuickToolTipPrivate::stopTimeout() timeoutTimer.stop(); } -QQuickToolTip::QQuickToolTip(QQuickItem *parent) : - QQuickPopup(*(new QQuickToolTipPrivate), parent) +QQuickToolTip::QQuickToolTip(QQuickItem *parent) + : QQuickPopup(*(new QQuickToolTipPrivate), parent) { Q_D(QQuickToolTip); d->allowVerticalFlip = true; @@ -265,7 +269,7 @@ QQuickToolTipAttached *QQuickToolTip::qmlAttachedProperties(QObject *object) { QQuickItem *item = qobject_cast<QQuickItem *>(object); if (!item) - qmlInfo(object) << "ToolTip must be attached to an Item"; + qmlWarning(object) << "ToolTip must be attached to an Item"; return new QQuickToolTipAttached(object); } @@ -303,7 +307,7 @@ void QQuickToolTip::timerEvent(QTimerEvent *event) } } -#ifndef QT_NO_ACCESSIBILITY +#if QT_CONFIG(accessibility) QAccessible::Role QQuickToolTip::accessibleRole() const { return QAccessible::ToolTip; @@ -324,7 +328,11 @@ class QQuickToolTipAttachedPrivate : public QObjectPrivate Q_DECLARE_PUBLIC(QQuickToolTipAttached) public: - QQuickToolTipAttachedPrivate() : delay(0), timeout(-1) { } + QQuickToolTipAttachedPrivate() + : delay(0), + timeout(-1) + { + } QQuickToolTip *instance(bool create) const; @@ -345,7 +353,7 @@ QQuickToolTip *QQuickToolTipAttachedPrivate::instance(bool create) const if (!tip && create) { // TODO: a cleaner way to create the instance? QQml(Meta)Type? QQmlComponent component(engine); - component.setData("import QtQuick.Controls 2.1; ToolTip { }", QUrl()); + component.setData("import QtQuick.Controls 2.2; ToolTip { }", QUrl()); QObject *object = component.create(); if (object) @@ -360,8 +368,8 @@ QQuickToolTip *QQuickToolTipAttachedPrivate::instance(bool create) const return tip; } -QQuickToolTipAttached::QQuickToolTipAttached(QObject *parent) : - QObject(*(new QQuickToolTipAttachedPrivate), parent) +QQuickToolTipAttached::QQuickToolTipAttached(QObject *parent) + : QObject(*(new QQuickToolTipAttachedPrivate), parent) { } |