I have a program that is using a QSceneGraph and a series of custom 
QGraphicsWidgets.
I now want to use a QProgressDialog as a top-level window (_not_ embedded in 
the QSceneGraph) from within the QGraphicsWidget.
My code is calling the hide/show on the QProgressDialog instance, but I don't 
see anything at run-time.

I first just used the QProgressDialog on its own; and the program worked at 
run-time but without the dialog showing; stopping the program would, however, 
cause it to crash.
So I looked at QGraphicsProxyWidget and wrapped it with that - which prevents 
the crashes but doesn't otherwise solve the issue.

My goal is to have the QProgressDialog widget pop-up while the program does a 
background task, then go away when its done.
I don't want it as part of the QGraphScene - more as a modal window.

Some example code of what I am basically doing:

class myGraphicsWidget : public QGraphicsWidget {
...
QProgressDialog progressDlg;
QGraphicsProxyWidget proxyProgressDlg;
...
};
...
myGraphcisWidget::myGraphicsWidget(QGraphicsItem* _parent) : 
QGraphicsWidget(_parent), progressDlg(NULL) {
proxyProgressDlg.setWidget(&progressDlg);
}
...
void myGraphicsWidget::someSignal1(int _someValue) {
progressDlg.show();
progressDlg.setMaximum(_someValue);
}
...
void myGraphicsWidget::someSignal2(int _progress) {
progressDlg.setValue(_progress);
}
...
void myGraphicsWidget::someSignal3() {
progressDlg.hide();
}
...

I'm sure that I must be doing something wrong, but I'm not sure what...I 
haven't tried this before with QGraphics functionality.

Ben
_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to