本文整理汇总了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);
}
}
示例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()));
}
示例3: saveAs
bool MyChild::save()
{
if (isUntitled) {
return saveAs();
} else {
return saveFile(curFile);
}
}
示例4: saveAs
bool MainWindow::save()
{
if (curFile.isEmpty()) {
return saveAs();
} else {
return saveFile(curFile);
}
}
示例5: saveAs
bool TextEditor::save()
{
if (curFile.isEmpty()) {
return saveAs();
} else {
return saveFile(curFile);
}
}
示例6: saveAs
bool MainWindowImpl::save()
{
if (currentDocument.isEmpty()) {
return saveAs();
} else {
return saveFile(currentDocument);
}
}
示例7: saveAs
void MQLEdit::fileSave()
{
if(_fileName.isEmpty()) {
saveAs();
} else {
save();
}
}
示例8: saveAs
bool SyntaxTextEditor::save()
{
if (isUntitled) {
return saveAs();
} else {
return saveFile(curFile);
}
}
示例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()));
}
示例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;
}
示例11: saveAs
bool XmlWindow::save(){
if(curFile.isEmpty()){
return saveAs();
}
else{
this->build_xml();
return saveFile(curFile);
}
}
示例12: saveAs
bool MyWidget::save() {
if(fileName.isEmpty())
return saveAs();
else {
FileWriter writer(fileName, model, this);
resetModified();
return true;
}
}
示例13: saveAs
bool ImageWindow::save()
{
if (curFile.isEmpty()) {
return saveAs();
} else {
saveFile(curFile);
return true;
}
}
示例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);
}
}
示例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
}