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.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With