Important: Please read the Qt Code of Conduct -

How can i change a form with Qgraphicsproxywidget ?

  • Hi at all,

    I have used a Qgraphicproxywidget to add a form into a scene, but the problem is how can i have access to the gui form and how can i edit the elements during the runtime.

    My code is this one :

    proxy = new CustomProxy(0, Qt::Widget);
    proxy->setWidget(new Form);

    And the Form is a Qt designer form Class. I have a pushbutton and a QLabel, and i want to put some live data on the QLabel from a databank. How can i have access to this Gui form ?

  • Lifetime Qt Champion


    Keep a pointer to the Form you set on the proxy, then connect what you need to update its label.

    Hope it helps

  • @SGaist

    Thank you, could you be more clear, could you give me an example ?

  • Lifetime Qt Champion

    proxy = new CustomProxy(0, Qt::Widget);
    Form *newForm = new Form;

Log in to reply