本文整理汇总了C++中QDBusInterface::asyncCall方法的典型用法代码示例。如果您正苦于以下问题:C++ QDBusInterface::asyncCall方法的具体用法?C++ QDBusInterface::asyncCall怎么用?C++ QDBusInterface::asyncCall使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDBusInterface
的用法示例。
在下文中一共展示了QDBusInterface::asyncCall方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: start
void TaskWindowJob::start()
{
const QString operation = operationName();
if (operation == "cascade") {
QDBusInterface *kwinInterface = new QDBusInterface("org.kde.kwin", "/KWin", "org.kde.KWin");
QDBusPendingCall pcall = kwinInterface->asyncCall("cascadeDesktop");
// kDebug() << " connected to kwin interface! ";
setResult(true);
return;
} else if (operation == "unclutter") {
QDBusInterface *kwinInterface = new QDBusInterface("org.kde.kwin", "/KWin", "org.kde.KWin");
QDBusPendingCall pcall = kwinInterface->asyncCall("unclutterDesktop");
// kDebug() << "connected to kwin interface! ";
setResult(true);
return;
}
}
示例2: connectToSessionManager
void GnomeSessionClient::connectToSessionManager()
{
QString startupId = QString::fromLocal8Bit(qgetenv("DESKTOP_AUTOSTART_ID"));
QDBusInterface* managerIface = new QDBusInterface(
SM_DBUS_SERVICE,
SM_DBUS_PATH,
SM_DBUS_INTERFACE,
QDBusConnection::sessionBus(),
this);
QDBusPendingCall call = managerIface->asyncCall("RegisterClient", d->m_applicationId, startupId);
QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher(call, this);
connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)),
SLOT(slotRegisterClientFinished(QDBusPendingCallWatcher*)));
}