Planned maintenance has been done but it did not solve the problem. So work will continue on this and a new time for trying updates will be announced asap.

QWidget added to a QGraphicsScene not responding to QGraphicsItemFlags.



  • Hi ,
    I am trying to add a QWidget based table to a scene as follows but I find that after being added ,the item does not respond the isMovable flag as a simple circle of rect i draw on the scene does.

    @
    Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
    {
    ui->setupUi(this);

    mView1=new QGraphicsView(this);

    mTableWidget=new QTableWidget(3,4);

    mScene=new QGraphicsScene(this);

    QGraphicsProxyWidget *proxy = new QGraphicsProxyWidget();

    proxy->setWidget(mTableWidget);

    proxy->setFlag(QGraphicsItem::ItemIsMovable);

    mScene->addItem(proxy);

    mView1->setScene(mScene);

    }

    @

    Is there something I am missing here to make the added item behave like a normal QGraphicsItem in the scene?
    Thanks .


Log in to reply