Hello.
I stumble upon (very easy problem, but can't figure it out) problem with showing another Form.
I created application with "main" form, then I want show "About/Info" form but when I pass as parent (this) another form don't show.
Form fr = new Form(this);
fr->setWindowTitle(tr("Form Info/About"));
fr->show();
Form fr = new Form(this);
fr->setWindowTitle(tr("Form Info/About"));
fr->show();
To copy to clipboard, switch view to plain text mode
Form is "standard" form generated with QtCreator (class Form : public QWidget {...)
I studied examples and my code is practically identical.
Also when I pass no argument form show but is a independent window (shows in task bar) and after closing "main" window form window stays open.
Any suggestion are more then welcome.
Qt 4.6 Win
PS. same situation with qt4.6.1 on Win/Lin x64
PS2. ok I SOLVED my problem by doing :
fr = new Form(this);
fr->setWindowFlags( Qt::Window);
fr->setWindowModality( Qt::ApplicationModal );
fr->show();
fr->setFocus();
fr = new Form(this);
fr->setWindowFlags( Qt::Window);
fr->setWindowModality( Qt::ApplicationModal );
fr->show();
fr->setFocus();
To copy to clipboard, switch view to plain text mode
and from what I see the "problem" is "this" in Form. It seams that this not points to parent Form but i.e MainWindow.
What helps is "fr->setWindowFlags( Qt::Window);" that probably change parent.
I would like to know why is that happening.
Best regards
Bookmarks