mercredi 6 mai 2015

How can i edit a Qt designer form Class from a QGraphicsProxyWidget?

Who wants to make my life easier today?

Ι have written an App with Qt and now i am training how to use QGraphicsProxyWidgets in a scene. So i have a QGraphicsview on my MainWindow and this view has a scene in background. Now i try to use a QGraphicsProxyWidget class to display a mini window in the scene.

I made a new Qt designer Form Class and i designed a GUI with a QLabel and a Qpushbutton.

I use the below code to add this Form into the scene :

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

The result is a "mini" Widget in the scene. The Question is this: Now i want to edit the QLabel from the Form class and i want to display there some live data, for example the coordinates of the mouse on the scene, But i cannot find a way to have access to the objects from the Form Class. Like

ui->QLableName->SetText("Hallo World");

and i ask the community how can i change the objects of the Form Class via a QGraphicsProxyWidget ?

Aucun commentaire:

Enregistrer un commentaire