本文整理汇总了C++中MapDocument::fileName方法的典型用法代码示例。如果您正苦于以下问题:C++ MapDocument::fileName方法的具体用法?C++ MapDocument::fileName怎么用?C++ MapDocument::fileName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MapDocument
的用法示例。
在下文中一共展示了MapDocument::fileName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateDocumentTab
void DocumentManager::updateDocumentTab()
{
MapDocument *mapDocument = static_cast<MapDocument*>(sender());
const int index = mDocuments.indexOf(mapDocument);
QString tabText = mapDocument->displayName();
if (mapDocument->isModified())
tabText.prepend(QLatin1Char('*'));
mTabWidget->setTabText(index, tabText);
mTabWidget->setTabToolTip(index, mapDocument->fileName());
}
示例2: finalCommand
QString Command::finalCommand() const
{
QString finalCommand = command;
// Perform map filename replacement
MapDocument *mapDocument = DocumentManager::instance()->currentDocument();
if (mapDocument) {
const QString fileName = mapDocument->fileName();
finalCommand.replace(QLatin1String("%mapfile"),
QString(QLatin1String("\"%1\"")).arg(fileName));
}
return finalCommand;
}
示例3: lastPath
/**
* Returns the last location of a file chooser for the given file type. As long
* as it was set using setLastPath().
*
* When no last path for this file type exists yet, the path of the currently
* selected map is returned.
*
* When no map is open, the user's 'Documents' folder is returned.
*/
QString Preferences::lastPath(FileType fileType) const
{
QString path = mSettings->value(lastPathKey(fileType)).toString();
if (path.isEmpty()) {
DocumentManager *documentManager = DocumentManager::instance();
MapDocument *mapDocument = documentManager->currentDocument();
if (mapDocument)
path = QFileInfo(mapDocument->fileName()).path();
}
if (path.isEmpty()) {
path = QStandardPaths::writableLocation(
QStandardPaths::DocumentsLocation);
}
return path;
}