Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QGraphicsProxyWidget can't be moved
Forum Updated to NodeBB v4.3 + New Features

QGraphicsProxyWidget can't be moved

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.6k 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.
  • P Offline
    P Offline
    papillon
    wrote on last edited by
    #1

    Hello, I'm wondering if you could help me out understand why a QGraphicsProxyWidget can't be selected/moved into my scene (see code below):

    @
    QGroupBox *groupBox = new QGroupBox("Contact Details");
    QLabel *numberLabel = new QLabel("Telephone number");
    QLineEdit *numberEdit = new QLineEdit;
    QFormLayout *layout = new QFormLayout;
    layout->addRow(numberLabel, numberEdit);
    groupBox->setLayout(layout);
    QGraphicsProxyWidget *proxy = scene->addWidget(groupBox);
    proxy->setFlag(QGraphicsItem::ItemIsMovable);
    proxy->setFlag(QGraphicsItem::ItemIsSelectable);
    @

    while I can successfully select and move around a paintable object:

    @
    QGraphicsPathItem *myItem = new QGraphicsPathItem(0, scene);
    QPainterPath p;
    p.addRoundedRect(-50, -15, 100, 30, 5, 5);
    myItem->setPath(p);
    myItem->setPen(QPen(Qt::darkGreen));
    myItem->setBrush(Qt::green);
    myItem->setFlag(QGraphicsItem::ItemIsMovable);
    myItem->setFlag(QGraphicsItem::ItemIsSelectable);
    @

    Thanks

    1 Reply Last reply
    0
    • S Offline
      S Offline
      stevenceuppens
      wrote on last edited by
      #2

      Hi Papillon,

      I think this post is helpfull

      http://www.qtcentre.org/threads/28434-Move-QGraphicsProxyWidget

      Steven CEUPPENS
      Developer / Architect
      Mobile: +32 479 65 93 10

      1 Reply Last reply
      0
      • P Offline
        P Offline
        papillon
        wrote on last edited by
        #3

        Thanks. So if I understand it correctly, I need to subclass QGraphicsProxyWidget and override mouse events.

        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