[Interest] QGraphicsWidget and QWidget Dialog Windows...

BRM bm_witness at yahoo.com
Tue Jun 18 21:17:38 CEST 2013



The minimum duration was getting in the way..though the task was taking longer than the default 4 seconds.
Any how..set it to zero so it pops up like I want (which is everytime any how).

Ben

> From: BRM <bm_witness at yahoo.com>
>To: Interests Qt <interest at qt-project.org> 
>Sent: Tuesday, June 18, 2013 2:56 PM
>Subject: [Interest] QGraphicsWidget and QWidget Dialog Windows...
> 
>
>
>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
>Interest at qt-project.org
>http://lists.qt-project.org/mailman/listinfo/interest
>
>
>



More information about the Interest mailing list