diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-04-21 17:30:01 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-04-24 09:01:21 +0000 |
commit | 46cd10b3a5be2557d40336ca5cc236690ce8398a (patch) | |
tree | 80f080b7584a0565f6b69dd94666f21a7f9f3fc5 /src/quicktemplates2/qquickabstractbutton.cpp | |
parent | 2aa0c5015e26e1374f6b24ee7023adc58e380403 (diff) |
QQuickIcon: fix the type of the source property
For example, something like:
Button {
icon.source: "../images/drawer.png"
}
did not work in the Gallery example, even though it works fine for
Image elements etc. The URL needs to be resolved relative to the
caller. By making the property an URL instead of a plain string,
the QML engine does the correct thing automatically.
Note: icon.source.length no longer works in auto tests, so it got
replaced by a compare().
Change-Id: I5fdb3aa55003d2f04e5458b7636e4dae3fa9857c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickabstractbutton.cpp')
-rw-r--r-- | src/quicktemplates2/qquickabstractbutton.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quicktemplates2/qquickabstractbutton.cpp b/src/quicktemplates2/qquickabstractbutton.cpp index a308834c..9ce26990 100644 --- a/src/quicktemplates2/qquickabstractbutton.cpp +++ b/src/quicktemplates2/qquickabstractbutton.cpp @@ -625,7 +625,7 @@ void QQuickAbstractButton::setIndicator(QQuickItem *indicator) /*! \qmlpropertygroup QtQuick.Controls::AbstractButton::icon \qmlproperty string QtQuick.Controls::AbstractButton::icon.name - \qmlproperty string QtQuick.Controls::AbstractButton::icon.source + \qmlproperty url QtQuick.Controls::AbstractButton::icon.source \qmlproperty int QtQuick.Controls::AbstractButton::icon.width \qmlproperty int QtQuick.Controls::AbstractButton::icon.height \qmlproperty color QtQuick.Controls::AbstractButton::icon.color @@ -738,7 +738,7 @@ void QQuickAbstractButton::setAction(QQuickAction *action) if (!name.isEmpty()) buttonIcon->setName(name); - QString source = actionIcon->source(); + QUrl source = actionIcon->source(); if (!source.isEmpty()) buttonIcon->setSource(source); |