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. Proper way to inherit QGraphicsProxyWidget

Proper way to inherit QGraphicsProxyWidget

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 660 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.
  • musimbateM Offline
    musimbateM Offline
    musimbate
    wrote on last edited by
    #1

    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
    {

    public:
    UBGraphicsTableItem(const int & rows,const int & columns);
    virtual ~UBGraphicsTableItem();
    //......

    private:
    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)
    :QGraphicsProxyWidget()
    {

     mTableWidget=new QTableWidget(rows,columns);
    
     mTableWidget->setFixedWidth(500);
     setWidget(mTableWidget);
    

    }

    @

    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.

    Thanks.

    Why join the navy if you can be a pirate?-Steve Jobs

    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