PDA

View Full Version : Getting rid of Dialog Title Bar



skepticalgeek
15th July 2010, 21:55
I have several different dialog forms in my application. I want to display them without the title bar. It is a touchscreen interface and the title bar and control box just get in the way. I can get rid of the title bar in the designer of Qt Creator, but when the form previews, or displays in the app, Qt puts the title bar back again, with a title of "Dialog". My main window displays without a title bar, no problem. I've scoured the help docs and Googled until my eyes bleed but I can't figure out how to do this. Help, please?

saa7_go
15th July 2010, 22:15
How about using QWidget::setWindowFlags(Qt::WindowFlags) (http://doc.trolltech.com/4.6/qwidget.html#windowFlags-prop) ?

In your custom dialog constructor, add this code:

setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint);

skepticalgeek
16th July 2010, 00:09
That did the trick. Thank you. You are too cool.