[Interest] Accessing attached properties from C++

Oleg Shparber trollixx at gmail.com
Thu Oct 2 23:54:32 CEST 2014


OK, I've managed to access QQmlComponentAttached:

QQmlComponentAttached *attached =
QQmlComponent::qmlAttachedProperties(item);

Still don't know how to make it work with QQuickKeyNavigationAttached. Any
ideas?

Thanks!

Best,
Oleg

On Wed, Oct 1, 2014 at 2:43 PM, Oleg Shparber <trollixx at gmail.com> wrote:

> Hi all,
>
> I am trying to get access to attached properties of QQuickItems. I have
> faced to problems.
>
> 1. Attempt to get or create a new Component property on any item returns
> zero pointer:
>
> qDebug() <<
> qobject_cast<QQmlComponentAttached*>(qmlAttachedPropertiesObject<QQmlComponentAttached>(item));
>
> 2. When I am trying to access KeyNavigation property
>
> qDebug() <<
> qobject_cast<QQuickKeyNavigationAttached*>(qmlAttachedPropertiesObject<QQuickKeyNavigationAttached>(item));
>
> results in unloadable plugin because of unmet reference:
>
> undefined symbol: _ZN27QQuickKeyNavigationAttached16staticMetaObjectE)
>
> In my .pro file I've added: QT += qml qml-private quick quick-private
> core-private gui-private
>
> I don't understand what I am doing wrong. According to qtdeclarative
> sources I do everything properly.
>
> Thanks,
> Oleg
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20141002/62f5ef52/attachment.html>


More information about the Interest mailing list