本文整理汇总了C++中Notification::deleteLater方法的典型用法代码示例。如果您正苦于以下问题:C++ Notification::deleteLater方法的具体用法?C++ Notification::deleteLater怎么用?C++ Notification::deleteLater使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Notification
的用法示例。
在下文中一共展示了Notification::deleteLater方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeNotification
void NotificationLayout::removeNotification(uint key, uint reason)
{
Notification *n = m_notifications.take(key);
if (!n)
{
qDebug() << "Oooook! Expecting instance of notification, got:" << key;
return;
}
int ix = m_layout->indexOf(n);
if (ix == -1)
{
qDebug() << "Qooook! Widget not in layout. Impossible!" << n;
return;
}
delete m_layout->takeAt(ix);
n->deleteLater();
emit notificationClosed(key, reason);
if (m_notifications.count() == 0)
emit allNotificationsClosed();
checkHeight();
}
示例2: execute
bool NotificationAction::execute(Rule *rule)
{
Q_D(NotificationAction);
Q_UNUSED(rule);
Notification *notification = new Notification(this);
notification->setTimestamp(QDateTime::currentDateTime());
notification->setSummary(d->summary);
notification->publish();
notification->deleteLater();
return true;
}