Naruto
Naruto

Reputation: 9634

How to make the title bold?

In QMessageBox how can I make the title text bold? Here is the sample code, which I am using to disply a messagebox:

int ret = QMessageBox::warning(this, tr("My Application"),
          tr("document has been modified.\n"
          "Do you want to save your changes?"),
          QMessageBox::Save | QMessageBox::Discard
          | QMessageBox::Cancel,
          QMessageBox::Save);

I just want tr("My Application") to be bold, and rest to be in normal font. How can I do that?
By default I am getting the normal font for both title and descriptive text.

Thanks.

Upvotes: 2

Views: 3562

Answers (2)

mtvec
mtvec

Reputation: 18326

This is not possible since most window managers do not allow rich text inside the window title.

Upvotes: 1

chalup
chalup

Reputation: 8516

You can add some HTML-like formatting to the message box contents, i.e. :

// ...
"Do you want to save your <b>changes</b>?"),
// ...

I do not have access to S60 environment to check if it works for message box title too. It doesn't work on Windows, but hey, it's worth a shot.

Upvotes: 4

Related Questions