PDA

View Full Version : QProgressBar appearance only in MdiSubWindow



revellix
15th August 2011, 10:22
Hello Community,

I have the following problem. I am building a GUI with the following hierarchy:

1. Mainwindow -> calls a SubWindow in MDIArea
2. SubWindow shows a QTableWidget with a StartButton
3. StartButton starts an algorithm in a new thread.

I want now to implement a ProgressBar, that is shown in the SubWindow. When I allocate it in the QTableWidget and call this->show() it appears as a new window and blocks my mainwindow when it is set modal. How to work with a QProgressBar correctly, so that I can still use the MainWindow and the ProgressBar is shown only in the SubWindow??

any suggestions ?

cplus
15th August 2011, 10:35
set QTableWidget and ProgressBar as children of SubWindow.

revellix
15th August 2011, 11:01
nope ... I call


progress = new QProgressbarDialog(this);
progress->setModal(true);
progress->setVisible(true);
progress->show();


and it blocks my minwindow

nish
17th August 2011, 14:54
According to Qt Docs


The window is modal to a single window hierarchy and blocks input to its parent window, all grandparent windows, and all siblings of its parent and grandparent windows.

So basically a model dialog will always block your mainwindow because its the parent of mdi