QT: Hide the title bar of a dialog/window
Solution 1
Why not using QSplashScreen?
Example extracted from the assistant:
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPixmap pixmap(":/splash.png");
QSplashScreen splash(pixmap);
splash.show();
app.processEvents();
...
QMainWindow window;
window.show();
splash.finish(&window);
return app.exec();
}
Solution 2
Why not use QSplashScreen
for this? Anyway, you can set window flags to remove the window decoration. See the documentation for QWidget::setWindowFlags
and Qt::WindowFlags
.
Samir
C/C++, .NET 2.0 (C++/CLI, C#), Install Shield Premier 2009, Qt......
Updated on June 04, 2022Comments
-
Samir about 2 years
I have a parent window in which a push-button's click event function has the following lines:
SplashScreenDialog *splScrDlg = new SplashScreenDialog(this); splScrDlg->show();
What I want is I want to remove the maximize button, minimize button, close button and also the title bar from the dialog(or window). [Actually it is for a splash screen, it would contain an image for a while and then would exit automatically and opens the main window, you are welcome with other ideas for showing splash screen]
-
Samir over 14 yearsThanks man. It works but the image is shown for too short a time as I right now don't have much things to load. I want to keep the image open for at least 2 seconds. What to do?
-
Lukáš Lalinský over 14 yearsCreate a single-shot timer and close the splashscreen from there.