本文整理汇总了C++中qstringlist::Iterator::endsWith方法的典型用法代码示例。如果您正苦于以下问题:C++ Iterator::endsWith方法的具体用法?C++ Iterator::endsWith怎么用?C++ Iterator::endsWith使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qstringlist::Iterator
的用法示例。
在下文中一共展示了Iterator::endsWith方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleIPCMessage
void QmitkCommonExtPlugin::handleIPCMessage(const QByteArray& msg)
{
QDataStream ds(msg);
QString msgType;
ds >> msgType;
// we only handle messages containing command line arguments
if (msgType != "$cmdLineArgs") return;
// activate the current workbench window
berry::IWorkbenchWindow::Pointer window =
berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow();
QMainWindow* mainWindow =
static_cast<QMainWindow*> (window->GetShell()->GetControl());
mainWindow->setWindowState(mainWindow->windowState() & ~Qt::WindowMinimized);
mainWindow->raise();
mainWindow->activateWindow();
// Get the preferences for the instantiation behavior
berry::IPreferencesService* prefService = berry::Platform::GetPreferencesService();
berry::IPreferences::Pointer prefs = prefService->GetSystemPreferences()->Node("/General");
bool newInstanceAlways = prefs->GetBool("newInstance.always", false);
bool newInstanceScene = prefs->GetBool("newInstance.scene", true);
QStringList args;
ds >> args;
QStringList fileArgs;
QStringList sceneArgs;
Poco::Util::OptionSet os;
berry::Platform::GetOptionSet(os);
Poco::Util::OptionProcessor processor(os);
#if !defined(POCO_OS_FAMILY_UNIX)
processor.setUnixStyle(false);
#endif
args.pop_front();
QStringList::Iterator it = args.begin();
while (it != args.end())
{
std::string name;
std::string value;
if (processor.process(it->toStdString(), name, value))
{
++it;
}
else
{
if (it->endsWith(".mitk"))
{
sceneArgs << *it;
}
else
{
fileArgs << *it;
}
it = args.erase(it);
}
}
if (newInstanceAlways)
{
if (newInstanceScene)
{
startNewInstance(args, fileArgs);
foreach(QString sceneFile, sceneArgs)
{
startNewInstance(args, QStringList(sceneFile));
}
}
else
{