本文整理汇总了C++中Notification::close方法的典型用法代码示例。如果您正苦于以下问题:C++ Notification::close方法的具体用法?C++ Notification::close怎么用?C++ Notification::close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Notification
的用法示例。
在下文中一共展示了Notification::close方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: syncNotifications
void NotificationManager::syncNotifications()
{
QList<PersonalNotification*> pnList;
QMap<int,int> typeCounts;
QList<QObject*> notifications = Notification::notifications();
foreach (QObject *o, notifications) {
Notification *n = static_cast<Notification*>(o);
if (n->previewBody().isEmpty() && !n->body().isEmpty() && n->hintValue("x-commhistoryd-data").isNull()) {
NotificationGroup *group = new NotificationGroup(n, this);
if (m_Groups.contains(group->type())) {
group->removeGroup();
delete group;
continue;
}
m_Groups.insert(group->type(), group);
} else {
PersonalNotification *pn = new PersonalNotification(this);
if (!pn->restore(n)) {
delete pn;
n->close();
delete n;
continue;
}
typeCounts[pn->eventType()]++;
pnList.append(pn);
}
}
示例2: while
bool
NotificationManager::replaceActive(Notification* notification)
{
ILOG_TRACE_F(ILX_NOTIFICATIONMAN);
if (notification->tag().empty())
return false;
pthread_mutex_lock(&_activeMutex);
NotificationList::iterator it = _active.begin();
while (it != _active.end())
{
Notification* old = ((Notification*) *it);
if (old->tag() == notification->tag())
{
it = _active.erase(it);
_active.insert(it, notification);
notification->setGeometry(old->surfaceGeometry());
old->close();
_compositor->removeWidget(old);
notification->show();
pthread_mutex_unlock(&_activeMutex);
return true;
}
++it;
}
pthread_mutex_unlock(&_activeMutex);
return false;
}