当前位置: 首页>>代码示例>>C++>>正文


C++ TFilePathSet::empty方法代码示例

本文整理汇总了C++中TFilePathSet::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ TFilePathSet::empty方法的具体用法?C++ TFilePathSet::empty怎么用?C++ TFilePathSet::empty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TFilePathSet的用法示例。


在下文中一共展示了TFilePathSet::empty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: loadPreset

bool InsertFxPopup::loadPreset(QTreeWidgetItem *item)
{
	QString str = item->data(0, Qt::UserRole).toString();
	TFilePath presetsFilepath(m_presetFolder + str.toStdWString());
	int i;
	for (i = item->childCount() - 1; i >= 0; i--)
		item->removeChild(item->child(i));
	if (TFileStatus(presetsFilepath).isDirectory()) {
		TFilePathSet presets = TSystem::readDirectory(presetsFilepath);
		if (!presets.empty()) {
			for (TFilePathSet::iterator it2 = presets.begin(); it2 != presets.end(); ++it2) {
				TFilePath presetPath = *it2;
				QString name(presetPath.getName().c_str());
				QTreeWidgetItem *presetItem = new QTreeWidgetItem((QTreeWidget *)0, QStringList(name));
				presetItem->setData(0, Qt::UserRole, QVariant(toQString(presetPath)));
				item->addChild(presetItem);
				presetItem->setIcon(0, m_fxIcon);
			}
		} else
			return false;
	} else
		return false;

	return true;
}
开发者ID:CroW-CZ,项目名称:opentoonz,代码行数:25,代码来源:insertfxpopup.cpp

示例2: loadMacro

void InsertFxPopup::loadMacro()
{
	TFilePath fp = m_presetFolder + TFilePath("macroFx");
	try {
		if (TFileStatus(fp).isDirectory()) {
			TFilePathSet macros = TSystem::readDirectory(fp);
			if (macros.empty())
				return;

			QTreeWidgetItem *macroFolder = new QTreeWidgetItem((QTreeWidget *)0, QStringList(tr("Macro")));
			macroFolder->setData(0, Qt::UserRole, QVariant(toQString(fp)));
			macroFolder->setIcon(0, m_folderIcon);
			m_fxTree->addTopLevelItem(macroFolder);
			for (TFilePathSet::iterator it = macros.begin(); it != macros.end(); ++it) {
				TFilePath macroPath = *it;
				QString name(macroPath.getName().c_str());
				QTreeWidgetItem *macroItem = new QTreeWidgetItem((QTreeWidget *)0, QStringList(name));
				macroItem->setData(0, Qt::UserRole, QVariant(toQString(macroPath)));
				macroItem->setIcon(0, m_fxIcon);
				macroFolder->addChild(macroItem);
			}
		}
	} catch (...) {
	}
}
开发者ID:CroW-CZ,项目名称:opentoonz,代码行数:25,代码来源:insertfxpopup.cpp

示例3: loadMacro

void AddFxContextMenu::loadMacro() {
  TFilePath macroDir = m_presetPath + TFilePath("macroFx");
  try {
    if (TFileStatus(macroDir).isDirectory()) {
      TFilePathSet macros = TSystem::readDirectory(macroDir);
      if (macros.empty()) return;

      QMenu *insertMacroMenu  = new QMenu("Macro", m_insertMenu);
      QMenu *addMacroMenu     = new QMenu("Macro", m_addMenu);
      QMenu *replaceMacroMenu = new QMenu("Macro", m_replaceMenu);

      m_insertMenu->addMenu(insertMacroMenu);
      m_addMenu->addMenu(addMacroMenu);
      m_replaceMenu->addMenu(replaceMacroMenu);

      for (TFilePathSet::iterator it = macros.begin(); it != macros.end();
           ++it) {
        TFilePath macroPath = *it;
        QString name        = QString::fromStdWString(macroPath.getWideName());

        QAction *insertAction  = new QAction(name, insertMacroMenu);
        QAction *addAction     = new QAction(name, addMacroMenu);
        QAction *replaceAction = new QAction(name, replaceMacroMenu);

        insertAction->setData(
            QVariant(QString::fromStdWString(macroPath.getWideString())));
        addAction->setData(
            QVariant(QString::fromStdWString(macroPath.getWideString())));
        replaceAction->setData(
            QVariant(QString::fromStdWString(macroPath.getWideString())));

        insertMacroMenu->addAction(insertAction);
        addMacroMenu->addAction(addAction);
        replaceMacroMenu->addAction(replaceAction);

        m_insertActionGroup->addAction(insertAction);
        m_addActionGroup->addAction(addAction);
        m_replaceActionGroup->addAction(replaceAction);
      }
    }
  } catch (...) {
  }
}
开发者ID:SaierMe,项目名称:opentoonz,代码行数:43,代码来源:addfxcontextmenu.cpp

示例4: loadPreset

bool AddFxContextMenu::loadPreset(const string &name,
								  QMenu *insertFxGroup, QMenu *addFxGroup, QMenu *replaceFxGroup)
{
	TFilePath presetsFilepath(m_presetPath + name);
	if (TFileStatus(presetsFilepath).isDirectory()) {
		TFilePathSet presets = TSystem::readDirectory(presetsFilepath, false);
		if (!presets.empty()) {
			QMenu *inserMenu = new QMenu(QString::fromStdWString(TStringTable::translate(name)), insertFxGroup);
			insertFxGroup->addMenu(inserMenu);
			QMenu *addMenu = new QMenu(QString::fromStdWString(TStringTable::translate(name)), addFxGroup);
			addFxGroup->addMenu(addMenu);
			QMenu *replaceMenu = new QMenu(QString::fromStdWString(TStringTable::translate(name)), replaceFxGroup);
			replaceFxGroup->addMenu(replaceMenu);

			//This is a workaround to set the bold style to the first element of this menu
			//Setting a font directly to a QAction is not enought; style sheet definitions
			//preval over QAction font settings.
			inserMenu->setObjectName("fxMenu");
			addMenu->setObjectName("fxMenu");
			replaceMenu->setObjectName("fxMenu");

			QAction *insertAction = new QAction(QString::fromStdWString(TStringTable::translate(name)), inserMenu);
			QAction *addAction = new QAction(QString::fromStdWString(TStringTable::translate(name)), addMenu);
			QAction *replaceAction = new QAction(QString::fromStdWString(TStringTable::translate(name)), replaceMenu);

			insertAction->setCheckable(true);
			addAction->setCheckable(true);
			replaceAction->setCheckable(true);

			insertAction->setData(QVariant(QString::fromStdString(name)));
			addAction->setData(QVariant(QString::fromStdString(name)));
			replaceAction->setData(QVariant(QString::fromStdString(name)));

			inserMenu->addAction(insertAction);
			addMenu->addAction(addAction);
			replaceMenu->addAction(replaceAction);

			m_insertActionGroup->addAction(insertAction);
			m_addActionGroup->addAction(addAction);
			m_replaceActionGroup->addAction(replaceAction);

			for (TFilePathSet::iterator it2 = presets.begin(); it2 != presets.end(); ++it2) {
				TFilePath presetName = *it2;
				QString qPresetName = QString::fromStdWString(presetName.getWideName());

				insertAction = new QAction(qPresetName, inserMenu);
				addAction = new QAction(qPresetName, addMenu);
				replaceAction = new QAction(qPresetName, replaceMenu);

				insertAction->setData(QVariant(QString::fromStdWString(presetName.getWideString())));
				addAction->setData(QVariant(QString::fromStdWString(presetName.getWideString())));
				replaceAction->setData(QVariant(QString::fromStdWString(presetName.getWideString())));

				inserMenu->addAction(insertAction);
				addMenu->addAction(addAction);
				replaceMenu->addAction(replaceAction);

				m_insertActionGroup->addAction(insertAction);
				m_addActionGroup->addAction(addAction);
				m_replaceActionGroup->addAction(replaceAction);
			}
			return true;
		} else
			return false;
	} else
		return false;
}
开发者ID:ArseniyShestakov,项目名称:opentoonz,代码行数:67,代码来源:addfxcontextmenu.cpp


注:本文中的TFilePathSet::empty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。