PDA

View Full Version : How to clear added widgets from "QGraphicsProxyWidget".



pastispast
24th July 2010, 15:40
Hi Friends,

I am writing a application that clears the added controls every 200 ms.

- I have used QTimer for the timer.
- I have used "QGraphicsProxyWidget" for adding the widgets(some pushbutton etc) on the "QGraphicsView"

Now I want to clear the widgets at every timer instance as I got the updated data for the "QGraphicsView".

I have used widget visibility concept to do this ("isVisible"), But I got crashes and incorrect results.

Is there any way to clear all the added widgets from the QGraphicsProxyWidget.

How to clear added widgets from "QGraphicsProxyWidget".

pastispast
25th July 2010, 05:50
Hi Friends,

I am writing a application that clears the added controls every 200 ms.

- I have used QTimer for the timer.
- I have used "QGraphicsProxyWidget" for adding the widgets(some pushbutton etc) on the "QGraphicsView"

Now I want to clear the widgets at every timer instance as I got the updated data for the "QGraphicsView".

I have used widget visibility concept to do this ("isVisible"), But I got crashes and incorrect results.

Is there any way to clear all the added widgets from the QGraphicsProxyWidget.

How to clear added widgets from "QGraphicsProxyWidget".

I have resolve this isue using "setVisible".

But now I am facing one more problem. I have to select the widgets on the screen. When the widget selects then round selection sholud appear on the screen. To this I am using some widget(pushbutton) style sheet as:

setStyleSheet(QPushButton:pressed{ \
image: url(:/img/images/image.png); \
background-color:rgb(203, 203, 203, 200);\
border-style:outset; \
border-radius:15px;}"););

It works on the normal widgets but when I use it in the "QGraphicsView" then some white rectangle shows around the widget (pushbutton).

How can I remove the extra white rectangle selection (or make transparent it)?