0

I'm trying to display the bullet character in a QMessageBox, but it renders as a typical "unknown" character (a ? on a black background).

Here's how I try to do it :

QString message = QString::fromUtf8("\u2022");
QMessageBox::warning(this, "some title", message); // "this" is a QMainWindow subclass

I have tried to use the bullet character directly in source code with :

QString message = "•";

Visual Studio prompts me to save the file as Unicode, which is what I do, but the result is still the same.

I'm using Qt5.3 with Visual Studio 2010 on Windows 8.1, if that matters.

demonplus
  • 5,613
  • 12
  • 49
  • 68
undu
  • 2,411
  • 3
  • 21
  • 28

1 Answers1

3

I would do it in the following way:

QString message = QString("This is the bullet character: %1").arg(QChar(0x2022));
vahancho
  • 20,808
  • 3
  • 47
  • 55