Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QDeclarativeItem::setParentItem
Forum Updated to NodeBB v4.3 + New Features

QDeclarativeItem::setParentItem

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 1 Posters 2.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jupiter
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jupiter
      wrote on last edited by
      #2

      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?

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved