Qt World Summit: Register Today!

QML/C++ Integration using VS2008

  • New to Qt Quick, forgive the newbie status. :)

    I've seen the Developer Days 2010 presentation on integrating C++ with QML.

    When implementing some parts myself I've encountered some issues, perhaps related to the fact I'm using VS2008 for my Qt development and QtCreator for editing just the QML part.

    1. When using @QDeclarativeContext->setContextProperty()@ - shouldn't this call also create a slot for the property?

    For example:
    in cpp:
    @mContext->setContextProperty("currObjectName", currObjName);@

    When I try to include this block in QML I can no longer load it into my view:
    @ onCurrObjectNameChanged: {
    myText2.text = "change"

    Does that mean that there's no onCurrObjectNameChanged slot and signal connection? Should I just create my custom object "listener" and register it in QML with its own registered slot connections?

    1. Is there a way to have the environment of VS2008 integrate better with QML files? I'm talking specifically about the recognition of dynamically created properties, can it work like the above link's video demonstration of that behavior in Qt Creator? Currently, having them disconnected means I'm writing in the dark on the QML side.

Log in to reply