本文整理汇总了C++中Document::GetFilename方法的典型用法代码示例。如果您正苦于以下问题:C++ Document::GetFilename方法的具体用法?C++ Document::GetFilename怎么用?C++ Document::GetFilename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Document
的用法示例。
在下文中一共展示了Document::GetFilename方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateWindowTitle
void MainWindow::updateWindowTitle() {
Document* doc = Application::I()->CurrentDocument();
if (doc == 0) {
setWindowTitle(VER_PRODUCTNAME_STR);
setWindowModified(false);
} else {
QString title;
title = doc->GetFilename().isEmpty() ? "<unsaved>" : doc->GetFilename();
title.append("[*] - ").append(VER_PRODUCTNAME_STR);
setWindowModified(doc->HasUnsavedData());
setWindowTitle(title);
}
}
示例2: sl_Application_CurrentDocumentChanged
void MainWindow::sl_Application_CurrentDocumentChanged(Document* oldDoc) {
if (oldDoc) {
QObject::disconnect(oldDoc, 0, this, 0);
}
Document* doc = Application::I()->CurrentDocument();
engine->SetTargetDocument(doc);
if (searchResultsWidget) {
searchResultsWidget->ClearResults();
searchResultsWidget->hide();
}
navigationPanel->SetTargetDocument(doc);
bookmarksMenu->SetDocument(doc);
if (doc) {
QObject::connect(doc, SIGNAL(sg_Changed()),
this, SLOT(sl_CurrentDocument_Changed()));
QObject::connect(doc, SIGNAL(sg_ItemUnregistered(Note*)),
this, SLOT(sl_Application_NoteDeleted(Note*)));
QObject::connect(doc, SIGNAL(sg_SavingAborted()),
this, SLOT(sl_Document_SavingAborted()));
QObject::connect(doc, SIGNAL(sg_SavingFailed(QString)),
this, SLOT(sl_Document_SavingFailed(QString)));
QObject::connect(doc, SIGNAL(sg_SavingFinished()),
this, SLOT(sl_Document_SavingFinished()));
QObject::connect(doc, SIGNAL(sg_SavingProgress(int)),
this, SLOT(sl_Document_SavingFinished()));
QObject::connect(doc, SIGNAL(sg_SavingStarted()),
this, SLOT(sl_Document_SavingStarted()));
Application::I()->Settings.SetLastDocumentName(doc->GetFilename());
}
sl_EditMenuContentChanged();
// Actions
bool enable = (doc != 0);
saveDocumentAction->setEnabled(enable);
saveDocumentAsAction->setEnabled(enable);
closeDocumentAction->setEnabled(enable);
documentPropertiesAction->setEnabled(enable);
globalSearchAction->setEnabled(enable);
sl_Clipboard_DataChanged();
updateWindowTitle();
}
示例3: sl_SaveDocumentAction_Triggered
void MainWindow::sl_SaveDocumentAction_Triggered(bool* actionCancelled) {
Document* doc = Application::I()->CurrentDocument();
if (!doc) {
WARNING("No current document set");
return;
}
QString filename = QString();
if (doc->GetFilename().isEmpty()) {
filename = QFileDialog::getSaveFileName(this, "Select a name", QString(),
"qNotesManager save file (*.nms)");
if (filename.isNull() || filename.isEmpty()) {
if (actionCancelled) {
*actionCancelled = true;
}
return;
}
newRecentFile(filename);
}
doc->Save(filename);
}