I am trying to set a tooltip that will contain the Mac command key symbol \u2318 but can not figure out how to do it.
Printable View
I am trying to set a tooltip that will contain the Mac command key symbol \u2318 but can not figure out how to do it.
Putting the character in a QString, setting the tooltip, or making sure the font being used has the ⌘ glyph. Which bit is the problem?
The character is QChar(0x2318). There are a few ways to easily insert it.
Code:
#include <QApplication> #include <QString> #include <QLineEdit> int main(int argc, char **argv) { // Or, if you can type it then chances are this will work // const QString text = QString::fromUtf8("Test with ⌘ symbol"); QLineEdit l; l.setText(text); l.setToolTip(text); l.show(); return app.exec(); }
That was it! Thanks!