当前位置: 首页>>代码示例>>C++>>正文


C++ saveAs函数代码示例

本文整理汇总了C++中saveAs函数的典型用法代码示例。如果您正苦于以下问题:C++ saveAs函数的具体用法?C++ saveAs怎么用?C++ saveAs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了saveAs函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的saveAs函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。