[Interest] Accessing attached properties from C++

Oleg Shparber trollixx at gmail.com
Wed Oct 1 23:43:22 CEST 2014


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/20141001/46e52a4c/attachment.html>


More information about the Interest mailing list