Important: Please read the Qt Code of Conduct -

Proper way to inherit QGraphicsProxyWidget

  • Hi ,
    I am trying to inherit QGraphicsProxyWidget so I can add custom QWidget based items to my scene but the application is having problems when quitting.I think the problem has sth to do with parents somehow and the application is having problems when cleaning up before it quits.

    Here is my header:


    class UBGraphicsTableItem :public QObject,public QGraphicsProxyWidget,public UBItem

    UBGraphicsTableItem(const int & rows,const int & columns);
    virtual ~UBGraphicsTableItem();

    QTableWidget * mTableWidget;
    QGraphicsSvgItem* mResizeSvgItem;
    QGraphicsSvgItem* mRotateSvgItem;



    In the cpp file,I simply create tha tableWidget and assign it to the proxy .


    UBGraphicsTableItem::UBGraphicsTableItem(const int & rows,const int & columns)

     mTableWidget=new QTableWidget(rows,columns);



    When I comment out everything that relates to the tableWidget ,all works fine suggesting that my tableWidget is not being integrated well with the proxyWidget.Any help would be appreciated as to what I might be doing wrong here.


Log in to reply