PDA

View Full Version : How to hide from taskbar a form showed form mainwindow



tonnot
10th February 2011, 13:51
I'm used exec() to show my form in 'modal' way from the main window.


NewForm newform(this);
newform.exec();

But, I see the my main app and the second form names at the task bar.
Logically i'm talking about Windows...
Any idea ?
Thanks

JohannesMunk
10th February 2011, 15:36
Hi!

If NewForm is a descendant of QDialog and this refers to a Widget this should work as it is!

For a normal window you need to set the parent, and the windowFlags to Window if you still want a resizable window frame..



#include <QtCore>
#include <QtGui>

int main(int argc, char *argv[])
{
QApplication app(argc, argv);

QWidget a;
a.show();

QWidget b(&a);
b.setWindowFlags(Qt::Window);
b.show();

QDialog d(&a);
d.exec();

return app.exec();
}


The above code produces 3 windows with only one taskbar entry..

Joh