PDA

View Full Version : Adding dialogs in MainWindow as New Tab



tayalp
13th April 2014, 07:26
I am new to QT and using QT 4.8. I have an application code which has a MainDialog and at certain time or user actions some new modeless dialogs comes.
Now I want to show these new modeless dialogs within the MainDialog window in new tab.(may be stackedwidget is what they call in QT) I want to have both options in my application based on some pref in registry. so if user check this option the new dialogs will come in a new tab or else the same way.
The dialogs are shown as show() method as of now.
My main window is like class MainWindow : public QMainWindow
and new dialogs which I am talkin about is derived by QDialog
class mydialog : public QDialog
How can I do this to show existing modeless dialogs as Tabbed in main window... ? Please suggest

anda_skoa
13th April 2014, 10:42
You can reparent a QDialog to remove the top level window hints.

But I think in your case it makes more sense to have the actual content as a QWidget derived class and then, depending on preference, either add it to a QTabWidget or to a QDialog.

Cheers,
_