Eu também estou aprendendo o Qt e tentei encontrar uma maneira de usar a API do Unity no Qt, eu poderia usar apenas o Dbus API, mas não tenho sorte com o Quicklist, pois ele precisa de um DbusMenu e eu não sei como implementar isso aprendendo :)).
Este é o exemplo que criei para mim e espero que seja útil para os outros. Talvez o Unity devs possa ajudar a corrigir / corrigir / adicionar novo código (lista rápida) a ele:)
/*
Unity Launcher Dbus API exmable for Qt
foxoman [gplus.to/foxoman][[email protected]]
https://wiki.ubuntu.com/Unity/LauncherAPI#Low_level_DBus_API:_com.canonical.Unity.LauncherEntry
First step : add this line to your Qt project file .pro
QT += dbus
*/
/* I will run this example as Qt console apps */
#include <QtCore/QCoreApplication>
/* Include Qt Dbus required */
#include <QtDBus>
// Qt Main Method
int main(int argc, char *argv[])
{
/* Qt console Main Loop [ in GUI application the Main loop is QApplication ]
Unity API need Main Loop to run */
QCoreApplication a(argc, argv);
/* Create Qt Dbus Signal to send Dbus Message to unity Dbus API
signal com.canonical.Unity.LauncherEntry.Update (in s app_uri, in a{sv} properties)
*/
QDBusMessage signal = QDBusMessage::createSignal(
"/", /* Path */
"com.canonical.Unity.LauncherEntry", /* Unity DBus Interface */
"Update"); /* Update Signal */
/* app_uri
Desktop ID ex: firefox -> need to be pined in the launcher to see the effect
*/
signal << "application://firefox.desktop";
/* properties : A map of strings to variants with the properties to set on the launcher icon */
QVariantMap setProperty;
/* A number to display on the launcher icon */
setProperty.insert("count", qint64(80));
/* show count */
setProperty.insert("count-visible", true);
/* progress bar count must be float between 0 and 1 (mean from 0.00 to 0.100)*/
setProperty.insert("progress", double(0.80));
/* show progress bar */
setProperty.insert("progress-visible", true);
/* Tells the launcher to get the users attention */
setProperty.insert("urgent",true);
/* Pack the properties Map to the signal */
signal << setProperty;
/* Send the signal */
QDBusConnection::sessionBus().send(signal);
return a.exec();
}
baixe o exemplo aqui link