本文整理汇总了C++中Plugin::deleteLater方法的典型用法代码示例。如果您正苦于以下问题:C++ Plugin::deleteLater方法的具体用法?C++ Plugin::deleteLater怎么用?C++ Plugin::deleteLater使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plugin
的用法示例。
在下文中一共展示了Plugin::deleteLater方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removePlugin
void PanelPluginsModel::removePlugin(pluginslist_t::iterator plugin)
{
if (mPlugins.end() != plugin)
{
mPanel->settings()->remove(plugin->first);
Plugin * p = plugin->second.data();
const int row = plugin - mPlugins.begin();
beginRemoveRows(QModelIndex(), row, row);
mPlugins.erase(plugin);
endRemoveRows();
mActive = mPlugins.isEmpty() ? QModelIndex() : createIndex(mPlugins.size() > row ? row : row - 1, 0);
emit pluginRemoved(p); // p can be nullptr
mPanel->settings()->setValue(mNamesKey, pluginNames());
if (nullptr != p)
p->deleteLater();
}
}
示例2: slotPluginReadyForUnload
void PluginManager::slotPluginReadyForUnload()
{
// Using QObject::sender() is on purpose here, because otherwise all
// plugins would have to pass 'this' as parameter, which makes the API
// less clean for plugin authors
// FIXME: I don't buy the above argument. Add a Kopete::Plugin::emitReadyForUnload(void),
// and make readyForUnload be passed a plugin. - Richard
Plugin *plugin = dynamic_cast<Plugin *>( const_cast<QObject *>( sender() ) );
if ( !plugin )
{
kWarning( 14010 ) << "Calling object is not a plugin!";
return;
}
kDebug( 14010 ) << plugin->pluginId() << "ready for unload";
plugin->deleteLater();
}