Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt MessageBox remove TitleBar?

Tags:

qt

How to remove Title Bar from Qt MessageBox in Qt?

I have gone through

QMessageBox::QMessageBox(Icon icon, const QString & title, const QString & text, StandardButtons buttons, QWidget * parent, Qt::WindowFlags f)

But how to use this. Any example? Any help is appreciated. Thanks.

like image 441
Bokambo Avatar asked Oct 05 '11 10:10

Bokambo


1 Answers

That is the constructor of QMessageBox. You use it like any other construcor, for example:

QMessageBox msgBox(QMessageBox::Question,
                   "This is the title", 
                   "This is the text", 
                   QMessageBox::Yes | QMessageBox::No, this,
                   Qt::FramelessWindowHint);
msgBox.exec();

or

QMessageBox* msgBox = new QMessageBox(QMessageBox::Question,
                                      "This is the title", 
                                      "This is the text", 
                                      QMessageBox::Yes | QMessageBox::No, this,
                                      Qt::FramelessWindowHint);
msgBox->exec();

In this case, this is a parent window (QMainWindow instance)

like image 96
Tamás Szelei Avatar answered Oct 19 '22 12:10

Tamás Szelei