June 6, 2011

evergreen evergreen
Lab Rat
79 posts

QMessageBox frameless stylesheet

 

Hi,

I’m trying to find a simple way to take out the title bar and the frame from the QMessageBox that pops up.
I’m trying to find by stylesheets but no result by now.

Any help is welcome.

5 replies

June 6, 2011

HuXiKa HuXiKa
Lab Rat
83 posts

  1. setWindowFlags(Qt::FramelessWindowHint);

 Signature 

If you can find faults of spelling in the text above, you can keep them.

June 6, 2011

VC15 VC15
Lab Rat
25 posts

I think this constructor may help you:

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

http://doc.qt.nokia.com/4.7/qmessagebox.html#QMessageBox-2

Don’t include the flag responsible for title into flags (Qt::WindowTitleHint, I suppose) and you must get what you want.

June 6, 2011

evergreen evergreen
Lab Rat
79 posts

When I set Flags as FramelessWindowHint, I get what I want visually, but the dialog is no longer modal.
I try to play with the other but it doesn’t work by now.

Any idea how to combine frameless and modal?

June 6, 2011

HuXiKa HuXiKa
Lab Rat
83 posts

Check Qt Demos -> WindowFlags and Qt Demos -> ShapedClock.

 Signature 

If you can find faults of spelling in the text above, you can keep them.

June 6, 2011

evergreen evergreen
Lab Rat
79 posts

didn’t quite helped

 
  ‹‹ How can i get all font names in the system      Additional Style for Qt application ››

You must log in to post a reply. Not a member yet? Register here!