QDeclarativeItem::setParentItem



  • Hi,

    I got a strange behaviour corresponding the QDeclarativeItem::setParentItem. At least for me it is strange.

    The Implementation of setParentItem takes a QDeclarativeItem* as paramenter. Additionally to that, a QDeclarativeItem inherits a setParentItem with a QGraphicsItem* as parameter.

    In my code i call @MyDeclarativeItem->setParentItem(myGraphicsItem);@ which results in a compiler error saying no overload of the method setParentItem found with that arguements. When i cast myDeclarativeItem to a QGraphicsItem, oh wonder, it works. But according to my knowledge QDeclarative should have both setParentItem methods, since they have different parameter types.

    so why does it only have its own implementation and why is it a different implementation at all?

    greetings

    Nazgul



  • also i got a problem when using a qml file that contains mouseareas. In a QdeclarativeView everything works fine. but when i put the same qml file into a QDeclarativeItem with following code
    @QDeclarativeEngine* engine = new QDeclarativeEngine();
    QDeclarativeComponent* component = new QDeclarativeComponent(engine, QUrl::fromUserInput(qmlFileName));
    QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(component->create());@
    i dont recieve any mouse relating signals in my qml. do i have to set specific flags?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.