I've been working on a new feature for Mac support in Qt. Basically, it's about adding a NSStatusItem::title()
support. Since Qt is a C++ framework, I am working in scope of ObjC-binding (corresponding method is declared in C++ header and defined in .mm source file).
void QCocoaSystemTrayIcon::updateTitle(const QString &title)
{
NSString *nstitle = title.toNSString();
[trayItem setTitle: nstitle];
}
Note: in the code above, toNSString() creates & releases a proper NSString* in place.
Interesting, if you replace actual setting line with
[[trayItem view] setToolTip: nsstring];
tool tip, in fact, is being changed. It proves that trayItem
and nsstring
are proper objects.
I am running IIRC latest OS X Yosemite 10.10.1