
Originally Posted by
wysota
Maybe you are using it wrong. Try the window flags example (or demo) that comes with Qt and see if that works.
I might be using it wrongly, but in that case someone will undoubtedly find what's wrong in this minimal code sample that reproduces the problem:
int main(int argc, char *argv[])
{
theDocumentWindow->setWindowTitle( "Document Window" );
theDocumentWindow
->setCentralWidget
( new QLabel( "Document" ) );
theDocumentWindow->show();
QWidget * theToolsPalette
= new QWidget( NULL, Qt
::Tool | Qt
::WindowTitleHint | Qt
::CustomizeWindowHint | Qt
::WindowCloseButtonHint );
theToolsPalette->setWindowTitle( "Tools Palette" );
thePaletteLayout
->addWidget
( new QLabel( "Tools" ) );
theToolsPalette->show();
return a.exec();
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QMainWindow * theDocumentWindow = new QMainWindow();
theDocumentWindow->setWindowTitle( "Document Window" );
theDocumentWindow->setCentralWidget( new QLabel( "Document" ) );
theDocumentWindow->show();
QWidget * theToolsPalette = new QWidget( NULL, Qt::Tool | Qt::WindowTitleHint | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
theToolsPalette->setWindowTitle( "Tools Palette" );
QHBoxLayout * thePaletteLayout = new QHBoxLayout( theToolsPalette );
thePaletteLayout->addWidget( new QLabel( "Tools" ) );
theToolsPalette->show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
In the real program window creation is done in the application of course.
Bookmarks