本文整理汇总了C++中Folder::name方法的典型用法代码示例。如果您正苦于以下问题:C++ Folder::name方法的具体用法?C++ Folder::name怎么用?C++ Folder::name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Folder
的用法示例。
在下文中一共展示了Folder::name方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: path
QString Folder::path() {
QString folderPath = "/" + QString(name()) + "/";
Folder *parentFolder = static_cast<Folder *>(parent());
while (parentFolder) {
folderPath.prepend("/" + QString(parentFolder->name()));
parentFolder = static_cast<Folder *>(parentFolder->parent());
}
return folderPath;
}
示例2: path
QString Folder::path()
{
QString s = "/" + QString(name()) + "/";
Folder *parentFolder = (Folder *)parent();
while (parentFolder){
s.prepend("/" + QString(parentFolder->name()));
parentFolder = (Folder *)parentFolder->parent();
}
return s;
}
示例3: data
QVariant FoldersModel::data(const QModelIndex &index, int role) const
{
Folder * item = qobject_cast<Folder *>(get(index.row()));
if (!item)
return QVariant();
switch (role) {
case Id:
return item->id();
break;
case Name:
return item->name();
break;
case AdditionalData:
return QVariant::fromValue(item->additionalData());
break;
case FilesModel:
return QVariant::fromValue(item->filesModel());
break;
}
return QVariant();
}
示例4: defined
//
// generate
//
void Export_File_Generator::
generate (const std::string & location, const Project & proj)
{
// Open the .mpc file for writing.
Folder root = proj.root_folder ();
const std::string name = GAME::Utils::normalize (root->name ());
const std::string filename = location + "/" + name + "/" + name + "_export.h";
std::string macro_guard = "_" + name + "_EXPORT_H_";
std::transform (macro_guard.begin (),
macro_guard.end (),
macro_guard.begin (),
&::toupper);
std::ofstream hfile;
hfile.open (filename.c_str ());
std::string export_basename = name;
std::transform (export_basename.begin (),
export_basename.end (),
export_basename.begin (),
&::toupper);
const std::string export_name = export_basename + "_Export";
if (hfile.is_open ())
{
// Generate the contents of the .mpc file.
hfile
<< "// -*- C++ -*-" << std::endl
<< std::endl
<< "#ifndef " << macro_guard << std::endl
<< "#define " << macro_guard << std::endl
<< std::endl
<< include_t ("ace/config.h")
<< std::endl
<< "#if defined (ACE_AS_STATIC_LIBS) && !defined (" << export_basename << "_HAS_DLL)" << std::endl
<< "# define " << export_basename << "_HAS_DLL 0" << std::endl
<< "#endif /* ACE_AS_STATIC_LIBS && " << export_basename << "_HAS_DLL */" << std::endl
<< std::endl
<< "#if !defined (" << export_basename << "_HAS_DLL)" << std::endl
<< "# define " << export_basename << "_HAS_DLL 1" << std::endl
<< "#endif /* ! " << export_basename << "_HAS_DLL */" << std::endl
<< std::endl
<< "#if defined (" << export_basename << "_HAS_DLL) && (" << export_basename << "_HAS_DLL == 1)" << std::endl
<< "# if defined (" << export_basename << "_BUILD_DLL)" << std::endl
<< "# define " << export_basename << "_Export ACE_Proper_Export_Flag" << std::endl
<< "# define " << export_basename << "_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)" << std::endl
<< "# define " << export_basename << "_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)" << std::endl
<< "# else /* " << export_basename << "_BUILD_DLL */" << std::endl
<< "# define " << export_basename << "_Export ACE_Proper_Import_Flag" << std::endl
<< "# define " << export_basename << "_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)" << std::endl
<< "# define " << export_basename << "_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)" << std::endl
<< "# endif /* " << export_basename << "_BUILD_DLL */" << std::endl
<< "#else /* " << export_basename << "_HAS_DLL == 1 */" << std::endl
<< "# define " << export_basename << "_Export" << std::endl
<< "# define " << export_basename << "_SINGLETON_DECLARATION(T)" << std::endl
<< "# define " << export_basename << "_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)" << std::endl
<< "#endif /* " << export_basename << "_HAS_DLL == 1 */" << std::endl
<< std::endl
<< "// Set " << export_basename << "_NTRACE = 0 to turn on library specific tracing even if" << std::endl
<< "// tracing is turned off for ACE." << std::endl
<< "#if !defined (" << export_basename << "_NTRACE)" << std::endl
<< "# if (ACE_NTRACE == 1)" << std::endl
<< "# define " << export_basename << "_NTRACE 1" << std::endl
<< "# else /* (ACE_NTRACE == 1) */" << std::endl
<< "# define " << export_basename << "_NTRACE 0" << std::endl
<< "# endif /* (ACE_NTRACE == 1) */" << std::endl
<< "#endif /* !" << export_basename << "_NTRACE */" << std::endl
<< std::endl
<< "#if (" << export_basename << "_NTRACE == 1)" << std::endl
<< "# define " << export_basename << "_TRACE(X)" << std::endl
<< "#else /* (" << export_basename << "_NTRACE == 1) */" << std::endl
<< "# if !defined (ACE_HAS_TRACE)" << std::endl
<< "# define ACE_HAS_TRACE" << std::endl
<< "# endif /* ACE_HAS_TRACE */" << std::endl
<< "# define " << export_basename << "_TRACE(X) ACE_TRACE_IMPL(X)" << std::endl
<< "# include \"ace/Trace.h\"" << std::endl
<< "#endif /* (" << export_basename << "_NTRACE == 1) */"
<< std::endl
<< "#endif // !defined " << macro_guard << std::endl;
hfile.close ();
}
}