本文整理汇总了C++中TFilePath::withoutParentDir方法的典型用法代码示例。如果您正苦于以下问题:C++ TFilePath::withoutParentDir方法的具体用法?C++ TFilePath::withoutParentDir怎么用?C++ TFilePath::withoutParentDir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TFilePath
的用法示例。
在下文中一共展示了TFilePath::withoutParentDir方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: populateFolder
void CastTreeViewer::populateFolder(QTreeWidgetItem *folder)
{
TFilePath folderPath(folder->data(1, Qt::DisplayRole).toString().toStdWString());
std::vector<TFilePath> folders;
getLevelSet()->listFolders(folders, folderPath);
int i;
for (i = 0; i < (int)folders.size(); i++) {
TFilePath fp = folders[i];
QString fpQstr = QString::fromStdWString(fp.getWideString());
QString name = QString::fromStdWString(fp.withoutParentDir().getWideString());
QTreeWidgetItem *child = new QTreeWidgetItem((QTreeWidgetItem *)0, QStringList(name) << fpQstr);
if (name != AudioFolderName)
child->setFlags(child->flags() | Qt::ItemIsEditable);
folder->addChild(child);
populateFolder(child);
}
}
示例2: onDeliver
void onDeliver()
{
if (m_error) {
m_error = false;
MsgBox(DVGui::CRITICAL, QObject::tr("There was an error saving frames for the %1 level.").arg(QString::fromStdWString(m_fp.withoutParentDir().getWideString())));
}
bool isPreview = (m_fp.getType() == "noext");
TImageCache::instance()->remove(toString(m_fp.getWideString() + L".0"));
TNotifier::instance()->notify(TSceneNameChange());
if (Preferences::instance()->isGeneratedMovieViewEnabled()) {
if (!isPreview && (Preferences::instance()->isDefaultViewerEnabled()) &&
(m_fp.getType() == "mov" || m_fp.getType() == "avi" || m_fp.getType() == "3gp")) {
QString name = QString::fromStdString(m_fp.getName());
int index;
if ((index = name.indexOf("#RENDERID")) != -1) //!quite ugly I know....
m_fp = m_fp.withName(name.left(index).toStdWString());
if (!TSystem::showDocument(m_fp)) {
QString msg(QObject::tr("It is not possible to display the file %1: no player associated with its format").arg(QString::fromStdWString(m_fp.withoutParentDir().getWideString())));
MsgBox(WARNING, msg);
}
}
else {
int r0, r1, step;
TApp *app = TApp::instance();
ToonzScene *scene = app->getCurrentScene()->getScene();
TOutputProperties &outputSettings = isPreview ? *scene->getProperties()->getPreviewProperties() : *scene->getProperties()->getOutputProperties();
outputSettings.getRange(r0, r1, step);
const TRenderSettings rs = outputSettings.getRenderSettings();
if (r0 == 0 && r1 == -1)
r0 = 0, r1 = scene->getFrameCount() - 1;
double timeStretchFactor = isPreview ? 1.0 : (double)outputSettings.getRenderSettings().m_timeStretchTo /
outputSettings.getRenderSettings().m_timeStretchFrom;
r0 = tfloor(r0 * timeStretchFactor);
r1 = tceil((r1 + 1) * timeStretchFactor) - 1;
TXsheet::SoundProperties *prop = new TXsheet::SoundProperties();
prop->m_frameRate = outputSettings.getFrameRate();
TSoundTrack *snd = app->getCurrentXsheet()->getXsheet()->makeSound(prop);
if (outputSettings.getRenderSettings().m_stereoscopic) {
assert(!isPreview);
::viewFile(m_fp.withName(m_fp.getName() + "_l"), r0 + 1, r1 + 1, step, isPreview ? rs.m_shrinkX : 1, snd, 0, false, true);
::viewFile(m_fp.withName(m_fp.getName() + "_r"), r0 + 1, r1 + 1, step, isPreview ? rs.m_shrinkX : 1, snd, 0, false, true);
} else
::viewFile(m_fp, r0 + 1, r1 + 1, step, isPreview ? rs.m_shrinkX : 1, snd, 0, false, true);
}
}
}