[Qt5-feedback] C++ api to use for UI in addition to QML
Alan Ezust
alan.ezust at gmail.com
Mon May 16 22:58:51 CEST 2011
On Mon, May 16, 2011 at 5:57 AM, Andre Somers <andre at familiesomers.nl> wrote:
> Op Ma, 16 mei, 2011 2:43 pm, schreef Thiago Macieira:
>> On Monday, 16 de May de 2011 12:03:30 Serhiy wrote:
>>> So my point is that since QT itself uses C++ why not to have C++ api
>>> for new features as well.
>>
>> Because we lock ourselves to that API, due to C++'s binary compatibility
>> requirements.
>>
>> We like to have a minimal API that addresses the use-cases. We'll be doing
>> it
>> once in QML. Doing it again in C++ is more work and also harder to change
>> later.
>
> Sure. But there needs to be some sort of sane way to interact with QML
> elements from C++, if QML is to be the main UI paradigm of Qt. At the very
> least, it would make sense to make it possible to get a pointer to a
> QObject based on a QML id.
in QML 1.x, you can set
objectName: "someObjectName"
on any QML Item and then use
QObject::findChild<QDeclarativeItem*>("someObjectName")
to find it.
But that assumes the QML Items derive from QObject. When we move over
to sceneGraph in QML 2.0, will that still be true?
I don't know how to find something by id, but I'll be following this
thread in case someone else does.
More information about the Qt5-feedback
mailing list