aptitude install libindicate-qt-dev
Find indicate-qt on the machine:
find_package(PkgConfig REQUIRED) pkg_check_modules(INDICATEQT REQUIRED indicate-qt)
Use it:
include_directories(${INDICATEQT_INCLUDE_DIRS})
link_directories(${INDICATEQT_LIBRARY_DIRS})
target_link_libraries(myapp ...
${INDICATEQT_LIBRARIES})
#include <KGlobal>
#include <qindicateserver.h>
void MyApp::createIndicateServer() {
m_indicateServer = QIndicate::Server::defaultInstance();
m_indicateServer->setType("message.irc");
QString appName = KGlobal::mainComponent().componentName();
KService::Ptr service = KService::serviceByDesktopName(appName);
m_indicateServer->setDesktopFile(service->entryPath());
m_indicateServer->show();
}
void MyApp::createIndicateServer() {
m_indicateServer = QIndicate::Server::defaultInstance();
m_indicateServer->setType("message.irc");
QString appName = KGlobal::mainComponent().componentName();
KService::Ptr service = KService::serviceByDesktopName(appName);
m_indicateServer->setDesktopFile(service->entryPath());
» connect(m_indicateServer, SIGNAL(serverDisplay()),
» SLOT(showMainWindow()));
m_indicateServer->show();
}
#include <KWindowSystem>
void MyApp::showMainWindow() {
m_mainWindow->show();
KWindowSystem::forceActiveWindow(m_mainWindow->winId());
}
void MyApp::addIndicator(const QString& text) {
QIndicate::Indicator* indicator =
new QIndicate::QIndicator(m_indicateServer);
indicator->setNameProperty("#kubuntu-devel");
indicator->setTimeProperty(QDateTime::currentDateTime());
indicator->setDrawAttentionProperty(true);
indicator->show();
// Insert code to keep track of the indicator here
}
void MyApp::addIndicator(const QString& text) {
QIndicate::Indicator* indicator =
new QIndicate::QIndicator(m_indicateServer);
indicator->setNameProperty("#kubuntu-devel");
indicator->setTimeProperty(QDateTime::currentDateTime());
indicator->setDrawAttentionProperty(true);
» connect(indicator, SIGNAL(display(QIndicate::Indicator*)),
» SLOT(displayIndicator(QIndicate::Indicator*)));
indicator->show();
// Insert code to keep track of the indicator here
}
void MyApp::displayIndicator(QIndicate::Indicator* indicator) {
showMainWindow();
// Do relevant action for this indicator
delete indicator; // Or indicator->hide();
}