本文整理汇总了C++中saveAs函数的典型用法代码示例。如果您正苦于以下问题:C++ saveAs函数的具体用法?C++ saveAs怎么用?C++ saveAs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了saveAs函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: saveAs
bool DocumentEditor::saveWithCharset(const QString& codec_) {
_codec = codec_;
if (_fullPath.isEmpty()) {
return saveAs();
} else {
return saveFile(_fullPath);
}
}
开发者ID:jzsun,项目名称:raptor,代码行数:8,代码来源:document_editor.cpp
示例2: connect
void MainWindow::initActionsConnections()
{
connect(ui->actionQuit, SIGNAL(triggered()), this, SLOT(close()));
connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(about()));
connect(ui->actionSaveAs, SIGNAL(triggered()), this, SLOT(saveAs()));
connect(ui->actionCopy, SIGNAL(triggered()), this, SLOT(copy()));
connect(ui->actionHelp, SIGNAL(triggered()), this, SLOT(help()));
}
开发者ID:ndtmike,项目名称:Reboundlinx,代码行数:8,代码来源:mainwindow.cpp
示例3: saveAs
bool MyChild::save()
{
if (isUntitled) {
return saveAs();
} else {
return saveFile(curFile);
}
}
开发者ID:Pengfei-Gao,项目名称:develop-reference-data,代码行数:8,代码来源:mychild.cpp
示例4: saveAs
bool MainWindow::save()
{
if (curFile.isEmpty()) {
return saveAs();
} else {
return saveFile(curFile);
}
}
开发者ID:GaoHongchen,项目名称:CPPGUIProgrammingWithQt4,代码行数:8,代码来源:mainwindow.cpp
示例5: saveAs
bool TextEditor::save()
{
if (curFile.isEmpty()) {
return saveAs();
} else {
return saveFile(curFile);
}
}
开发者ID:yiminyangguang520,项目名称:qt,代码行数:8,代码来源:texteditor.cpp
示例6: saveAs
bool MainWindowImpl::save()
{
if (currentDocument.isEmpty()) {
return saveAs();
} else {
return saveFile(currentDocument);
}
}
开发者ID:Fale,项目名称:Ascii-Design,代码行数:8,代码来源:mainwindowimpl.cpp
示例7: saveAs
void MQLEdit::fileSave()
{
if(_fileName.isEmpty()) {
saveAs();
} else {
save();
}
}
开发者ID:Wushaowei001,项目名称:xtuple,代码行数:8,代码来源:mqledit.cpp
示例8: saveAs
bool SyntaxTextEditor::save()
{
if (isUntitled) {
return saveAs();
} else {
return saveFile(curFile);
}
}
开发者ID:bezigon,项目名称:liteide,代码行数:8,代码来源:syntaxtexteditor.cpp
示例9: QAction
// Methods
void MainWindow::createActions()
{
// File actions
newAction = new QAction(tr("&New"), this);
newAction->setIcon(QIcon::fromTheme("document-new"));
newAction->setShortcut(QKeySequence::New);
newAction->setStatusTip(tr("Create a new spreadsheet"));
connect(newAction, SIGNAL(triggered()), this, SLOT(newFile()));
openAction = new QAction(tr("&Open"), this);
openAction->setIcon(QIcon::fromTheme("document-open"));
openAction->setShortcut(QKeySequence::Open);
openAction->setStatusTip(tr("Open a spreadsheet"));
connect(openAction, SIGNAL(triggered()), this, SLOT(openFile()));
saveAction = new QAction(tr("&Save"), this);
saveAction->setIcon(QIcon::fromTheme("document-save"));
saveAction->setShortcut(QKeySequence::Save);
saveAction->setStatusTip(tr("Save a spreadsheet"));
connect(saveAction, SIGNAL(triggered()), this, SLOT(save()));
saveAsAction = new QAction(tr("Save &As"), this);
saveAsAction->setIcon(QIcon::fromTheme("document-save-as"));
saveAsAction->setShortcut(QKeySequence::SaveAs);
saveAsAction->setStatusTip(tr("Save a spreadsheet in new file"));
connect(saveAsAction, SIGNAL(triggered()), this, SLOT(saveAs()));
exitAction = new QAction(tr("&Exit"), this);
exitAction->setIcon(QIcon::fromTheme("application-exit"));
exitAction->setShortcut(QKeySequence::Quit);
connect(exitAction, SIGNAL(triggered()), this, SLOT(close()));
// Edit actions
cutAction = new QAction(tr("&Cut"), this);
cutAction->setIcon(QIcon::fromTheme("edit-cut"));
cutAction->setShortcut(QKeySequence::Cut);
copyAction = new QAction(tr("&Copy"), this);
copyAction->setIcon(QIcon::fromTheme("edit-copy"));
copyAction->setShortcut(QKeySequence::Copy);
pasteAction = new QAction(tr("&Paste"), this);
pasteAction->setIcon(QIcon::fromTheme("edit-paste"));
pasteAction->setShortcut(QKeySequence::Paste);
findAction = new QAction(tr("&Find"), this);
findAction->setIcon(QIcon::fromTheme("edit-find"));
findAction->setShortcut(QKeySequence::Find);
connect(findAction, SIGNAL(triggered()), this, SLOT(find()));
// Help actions
aboutAction = new QAction(tr("&About"), this);
aboutAction->setIcon(QIcon::fromTheme("help-about"));
connect(aboutAction, SIGNAL(triggered()), this, SLOT(about()));
aboutQtAction = new QAction(tr("About &Qt"), this);
connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
}
开发者ID:frozenix,项目名称:qspreadsheet,代码行数:59,代码来源:mainwindow.cpp
示例10: saveAs
bool MQLEdit::fileSave()
{
if (_dest == MQLFile || (_dest == MQLUnknown && ! OpenRPT::loggedIn))
{
if (_fileName.isEmpty())
return saveAs();
else
return save();
}
else if (_dest == MQLDatabase)
{
if (_mqlGroup.isEmpty() || _mqlName.isEmpty())
return fileDatabaseSaveAs();
else
return databaseSave();
}
else if (_dest == MQLUnknown)
{
QMessageBox save;
save.setText("How do you want to save your changes?");
QPushButton *cancel = save.addButton(QMessageBox::Cancel);
QPushButton *db = save.addButton(tr("Database only"), QMessageBox::AcceptRole);
QPushButton *file = save.addButton(tr("File only"), QMessageBox::AcceptRole);
QPushButton *both = save.addButton(tr("Database and File"),QMessageBox::AcceptRole);
save.setEscapeButton((QAbstractButton*)cancel);
save.exec();
// since _dest == MQUnknown, we can assume we don't have file/group-name
if (save.clickedButton() == (QAbstractButton*)db)
return fileDatabaseSaveAs();
else if (save.clickedButton() == (QAbstractButton*)file)
return saveAs();
else if (save.clickedButton() == (QAbstractButton*)both)
{
// save to db first to get group and name
// then reset the title and type which are changed by saveAs()
bool returnVal = fileDatabaseSaveAs() && saveAs();
setWindowTitle(getTitleString(MQLDatabase));
setDestType(MQLDatabase);
return returnVal;
}
}
return false;
}
开发者ID:Wushaowei001,项目名称:xtuple,代码行数:45,代码来源:mqledit.cpp
示例11: saveAs
bool XmlWindow::save(){
if(curFile.isEmpty()){
return saveAs();
}
else{
this->build_xml();
return saveFile(curFile);
}
}
开发者ID:brainstudio-team,项目名称:BrainStudio,代码行数:9,代码来源:xmlwindow.cpp
示例12: saveAs
bool MyWidget::save() {
if(fileName.isEmpty())
return saveAs();
else {
FileWriter writer(fileName, model, this);
resetModified();
return true;
}
}
开发者ID:mzilio,项目名称:qCharts,代码行数:9,代码来源:mywidget.cpp
示例13: saveAs
bool ImageWindow::save()
{
if (curFile.isEmpty()) {
return saveAs();
} else {
saveFile(curFile);
return true;
}
}
开发者ID:evade55,项目名称:station-meteo-test,代码行数:9,代码来源:imagewindow.cpp
示例14: fileName
/// Save to the current filename, opening a dialog if blank
void ScriptEditor::saveToCurrentFile() {
QString filename = fileName();
if (filename.isEmpty()) {
saveAs();
return;
} else {
saveScript(filename);
}
}
开发者ID:tyronerees,项目名称:mantid,代码行数:10,代码来源:ScriptEditor.cpp
示例15: saveAs
void Editor::saveAsEncoding( int code )
{
#ifndef QT_NO_FILEDIALOG
//storing filename (proper save) is left as an exercise...
QString fn = QFileDialog::getSaveFileName( QString::null, QString::null, this );
if ( !fn.isEmpty() )
(void) saveAs( fn, code );
#endif
}
开发者ID:nightfly19,项目名称:renyang-learn,代码行数:9,代码来源:qwerty.cpp
示例16: saveAs
bool QFEHelpEditorWidget::save() {
if (currentScript.isEmpty() || newScript) {
return saveAs();
} else {
return saveFile(currentScript);
}
}
开发者ID:jkriege2,项目名称:QuickFit3,代码行数:9,代码来源:qfehelpeditorwidget.cpp
示例17: qDebug
bool MainWindow::save() {
if(curFile.isEmpty()) {
qDebug() << "saveAs";
return saveAs();
} else {
qDebug("saveFile");
return saveFile(curFile);
}
}
开发者ID:GustJc,项目名称:QtMapBuilder,代码行数:9,代码来源:mainwindow.cpp
示例18: saveAs
bool Editor::save()
{
if (isUntitled) {
return saveAs();
} else {
saveFile(curFile);
return true;
}
}
开发者ID:EleVenPerfect,项目名称:OTHERS,代码行数:9,代码来源:editor.cpp
示例19: QAction
void MainWindow::createActions()
{
newAct = new QAction(tr("&New"), this);
// newAct = QAction(QIcon(":/images/new.png"), tr("&New"), this);
newAct->setShortcuts(QKeySequence::New);
newAct->setStatusTip(tr("Create a new file"));
connect(newAct, SIGNAL(triggered()), this, SLOT(newFile()));
openAct = new QAction(tr("&Open"), this);
// openAct = QAction(QIcon(":/images/open.png"), tr("&Open"), this);
openAct->setShortcuts(QKeySequence::Open);
openAct->setStatusTip(tr("Open an existing file"));
connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
saveAct = new QAction(tr("&Save"), this);
// saveAct = QAction(QIcon(":/images/save.png"), tr("&Save"), this);
saveAct->setShortcuts(QKeySequence::Save);
saveAct->setStatusTip(tr("Create a new file"));
connect(saveAct, SIGNAL(triggered()), this, SLOT(save()));
saveAsAct = new QAction(tr("&SaveAs"), this);
saveAsAct->setShortcuts(QKeySequence::SaveAs);
saveAsAct->setStatusTip(tr("Create a new file as"));
connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs()));
exitAct = new QAction(tr("&Exit"), this);
exitAct->setShortcuts(QKeySequence::Quit);
exitAct->setStatusTip(tr("Close the program"));
connect(exitAct, SIGNAL(triggered()), this, SLOT(exitAll()));
aboutAct = new QAction(tr("&About"), this);
aboutAct->setStatusTip(tr("Show the About box"));
connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
selectAllAct = new QAction(tr("&SelectAll"), this);
selectAllAct->setShortcuts(QKeySequence::SelectAll);
selectAllAct->setStatusTip(tr("Select and All"));
connect(selectAllAct, SIGNAL(triggered()), this, SLOT(selectAll()));
copyAllAct = new QAction(tr("&CopyAll"), this);
copyAllAct->setStatusTip(tr("Select and Copy All"));
connect(copyAllAct, SIGNAL(triggered()), this, SLOT(copyAll()));
copyTextAct = new QAction(tr("&Copy"), this);
copyTextAct->setShortcuts(QKeySequence::Copy);
copyTextAct->setStatusTip(tr("Copy the text"));
connect(copyTextAct, SIGNAL(triggered()), this, SLOT(copyText()));
pasteTextAct = new QAction(tr("&Paste"), this);
pasteTextAct->setShortcuts(QKeySequence::Paste);
pasteTextAct->setStatusTip(tr("Select All"));
connect(pasteTextAct, SIGNAL(triggered()), this, SLOT(pasteText()));
}
开发者ID:thiagoms15,项目名称:Qt_Projects,代码行数:56,代码来源:mainwindow.cpp
示例20: lastExternalModifiedDateTime
void MainWindow::checkForFileChanges(const FileCheckMoment &moment)
{
if (moment == FocusIn)
{
QDateTime lastExternalModifiedDateTime(QFileInfo(m_currentUrl.path()).lastModified());
if (lastExternalModifiedDateTime > m_lastInternalModifiedDateTime)
m_isModifiedExternally = true;
else // when the fileChangedWarningMessageBox below is cancelled, the main window is focused in again with m_isModifiedExternally == true so this slot is called again, but now m_lastInternalModifiedDateTime has been updated (during focusOut) and now we don't want to show the dialog again
return;
}
if (!m_isModifiedExternally)
return;
m_isModifiedExternally = false;
QPointer<QMessageBox> fileChangedWarningMessageBox = new QMessageBox(this);
fileChangedWarningMessageBox->setText(tr("The document was modified by another program.\nWhat do you want to do?"));
fileChangedWarningMessageBox->setWindowTitle(KtikzApplication::applicationName());
fileChangedWarningMessageBox->setIcon(QMessageBox::Warning);
QAbstractButton *overwriteButton = fileChangedWarningMessageBox->addButton(tr("&Overwrite"), QMessageBox::AcceptRole);
QAbstractButton *reloadButton;
switch (moment)
{
case Saving:
reloadButton = fileChangedWarningMessageBox->addButton(tr("&Save under another name"), QMessageBox::AcceptRole);
break;
case Closing:
reloadButton = fileChangedWarningMessageBox->addButton(tr("&Close without saving"), QMessageBox::AcceptRole);
break;
case FocusIn:
default:
reloadButton = fileChangedWarningMessageBox->addButton(tr("&Reload file"), QMessageBox::AcceptRole);
break;
}
fileChangedWarningMessageBox->addButton(QMessageBox::Cancel);
fileChangedWarningMessageBox->exec();
if (fileChangedWarningMessageBox->clickedButton() == overwriteButton)
saveUrl(m_currentUrl);
else if (fileChangedWarningMessageBox->clickedButton() == reloadButton)
switch (moment)
{
case Saving:
saveAs();
break;
case Closing:
// do nothing since the file will be closed anyway
break;
case FocusIn:
default:
reload();
break;
}
else // cancel (check again on "Save" or "Close")
m_isModifiedExternally = true;
delete fileChangedWarningMessageBox;
}
开发者ID:jfmcarreira,项目名称:ktikz,代码行数:56,代码来源:mainwindow.cpp
注:本文中的saveAs函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论