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.
#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");
l.setText(text);
l.setToolTip(text);
l.show();
return app.exec();
}
#include <QApplication>
#include <QString>
#include <QLineEdit>
int main(int argc, char **argv)
{
QApplication app(argc, argv);
const QString text = QString("Test with %1 symbol").arg(QChar(0x2318));
// 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();
}
To copy to clipboard, switch view to plain text mode
Bookmarks