Unsolved Removing Close button from QMessageBox
-
on the top right corner) from QMessageBox. -
-
tried, it doesn't work
-
Try this...Found on google and worked in my case( Windows 10).
QMessageBox* msgBox = new QMessageBox(QMessageBox::Question, "This is the title", "This is the text", QMessageBox::Yes | QMessageBox::No, this, Qt::FramelessWindowHint); msgBox->exec();
-
What @Ni-Sumi said works for me on Windows 7.
QMessageBox mb; mb.setText("Some text"); mb.setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint); mb.exec();
-
Hi,
Which OS are u using and Qt version.?.
As mentioned by @Ni-Sumi and @Wieland
The code provided is working in Windows 8.1 and ubuntu 14.04 version Which i am using.
QMessageBox mb;
mb.setText("Some text");
mb.setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint);
mb.exec();QMessageBox* msgBox = new QMessageBox(QMessageBox::Question,
"This is the title",
"This is the text",
QMessageBox::Yes | QMessageBox::No, this,
Qt::FramelessWindowHint);
msgBox->exec();Thanks,
-
Hi,
Can u provide the code snippet, so the users in the forum will come to know the issue.
and provide the solution.Thanks,
-
@NIXIN
Pradeep code is right, you should try once again and remember it must only ''setWindowFlags' otherwise overwrite it.
QMessageBox messageBox;
messageBox.setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint);
messageBox.exec();