Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Label in Mac dock icon [Solved]
I'm not sure whether my previous research on this was for Java Swing or Qt, but I haven't been able to find any usable results right now:
Is it possible to add a (1-2 digit) label to a dock icon on Mac OS with Qt? I know it's possible using pure Obj. C, but is there a specific interface in Qt that does just that?
Thanks in advance.
The silence tells everything I guess. Oh well. Even though my objective C skills are below zero, I managed to put together a simple wrapper class after a bit of googling and experimentation:
static void setValue(const QString &val);
#endif // DOCKICONLABEL_H@
void DockIconLabel::setValue(const QString &val)
const QByteArray utf8 = val.toUtf8();
const char* cString = utf8.constData();
[[[NSApplication sharedApplication] dockTile] setBadgeLabel:[[NSString alloc] initWithUTF8String:cString]];
Na, you were just quicker to find the solution :)
Thanks for sharing !
There are now helper functions in qtmacextras to do that
Sounds good, thanks for info!