本文整理汇总了C++中setWindowModified函数的典型用法代码示例。如果您正苦于以下问题:C++ setWindowModified函数的具体用法?C++ setWindowModified怎么用?C++ setWindowModified使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setWindowModified函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: setWindowModified
void MainWindow::setCurrentFile(const QString &fileName)
{
curFile = fileName;
setWindowModified(false);
QString shownName = "Untitled";
if (!curFile.isEmpty()) {
shownName = strippedName(curFile);
recentFiles.removeAll(curFile);
recentFiles.prepend(curFile);
updateRecentFileActions();
}
setWindowTitle(tr("%1[*] - %2").arg(shownName)
.arg(tr("Spreadsheet")));
}
开发者ID:evade55,项目名称:station-meteo-test,代码行数:16,代码来源:mainwindow.cpp
示例2: tr
void MainWindow::saveFormAs()
{
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"),
recentFolder,
tr("Jupiter Forms (*.jform);;All Files (*.*)"));
if (fileName != "")
{
if (!fileName.toLower().endsWith(".jform"))
fileName += ".jform";
setWindowFilePath(fileName);
form->saveFile(fileName);
setWindowModified(false);
recentFolder = QFileInfo(fileName).path();
updateRecentFile(fileName);
}
}
开发者ID:robcaldecott,项目名称:jupiter,代码行数:16,代码来源:MainWindow.cpp
示例3: setWindowModified
void QWERTYEditor::setCurrentFile(const QString &fileName) {
/*
Функция установки текущего файла.
Вызывается для сброса состояний переменных при загрузки\сохранения\изменении
и тд файл. Обновляется имя файла. Если имя пустое, то показываем имя new.txt
*/
curFile = fileName;
textEdit->document()->setModified(false);
setWindowModified(false);
QString shownName = curFile;
if (curFile.isEmpty())
shownName = "new.txt";
setWindowFilePath(shownName);
}
开发者ID:AlNat,项目名称:Qwerty-Editor,代码行数:16,代码来源:QWERTYEditor.cpp
示例4: QFileInfo
void MdiChild::setCurrentFile(const QString &fileName)
{
curFile = QFileInfo(fileName).canonicalFilePath();
isUntitled = false;
fileChanged = false;
setWindowModified(false);
updateTitle();
int MaxRecentFiles = g.historySize();
QStringList files = g.recentFiles();
files.removeAll(fileName);
files.prepend(fileName);
while (files.size() > MaxRecentFiles)
files.removeLast();
g.recentFiles( files );
}
开发者ID:RonDePrez,项目名称:opentx,代码行数:16,代码来源:mdichild.cpp
示例5: setWindowModified
void VentanaPrincipal::setArchivoActual(const QString &nombreArchivo)
{
archivoActual = nombreArchivo;
editorTexto->document()->setModified(false);
setWindowModified(false);
QString nombreaAMostrar = archivoActual;
if (archivoActual.isEmpty())
{
nombreaAMostrar = "Archivo sin nombre.txt";
}
setWindowFilePath(nombreaAMostrar);
}
开发者ID:seguame,项目名称:Sendero,代码行数:16,代码来源:VentanaPrincipal.cpp
示例6: tr
void WordFrequencyForm::exportFrequencyList()
{
if (!wordFrequencyList_)
{
QMessageBox::information(this, tr("Unable to export frequency list"),
tr("Unable to export frequency list. There is no list to export."));
return;
}
QString wflistFilePath = QFileDialog::getSaveFileName(this, tr("Save word frequency list file..."),
workingDirectoryPath_, tr("XML files (*.xml)"));
if (!wflistFilePath.isEmpty())
{
wordFrequencyList_->write_xml(wflistFilePath.toStdString());
setWindowModified(false);
}
}
开发者ID:SeanCampbell,项目名称:WordAnalysis,代码行数:17,代码来源:wordfrequencyform.cpp
示例7: QFile
void MainWindow::loadFile(const QString &fileName)
{
//if is empty
if(fileName.isEmpty())
{
//set the file name
this->setFileName(QString ());
ui->AppOutput->append("No file is open");
return;
}
// create a QFile Object with the fileName variable
QFile *qfo=new QFile(fileName);
//if
if(!(qfo->open(QIODevice::Text|QIODevice::ReadOnly)))
{
ui->AppOutput->append("The file "+fileName+" cannot be opened");
QMessageBox::warning(this,"Error","The file cannot be opened",QMessageBox::Ok,QMessageBox::Ok);
setFileName(QString());
return;
}
else
{
ui->AppOutput->append("The file at "+fileName+" is opened");
QTextStream qts(qfo);
//codigo de parseo.
int count_lines=0;
while(!qts.atEnd())
{
//se lee la linea
QString line=qts.readLine();
//se muestra en la pantalla
ui->textEdit->appendPlainText(line);
//se envia a parsearla
lineParser(line);
//se cuenta la cantidad de lineas
count_lines++;
}
ui->AppOutput->append("Lines: "+QString::number(count_lines));
qfo->close();
setFileName(fileName);
setWindowModified(false);
}
}
开发者ID:DavidRamos015,项目名称:Html5Checker,代码行数:46,代码来源:parser.cpp
示例8: setWindowModified
//*****************************************************************************
void mlMainWindow::setCurrentFile(const QString &fileName) {
curFile = fileName;
ui->tbxEditor->document()->setModified(false);
setWindowModified(false);
QString shownName = curFile;
if( curFile.isEmpty() )
shownName = "untitled.txt";
else
shownName = strippedName();
setWindowFilePath(shownName);
setWindowTitle( tr("%1 - %2[*]")
.arg(sAPPNAME)
.arg(shownName) );
}
开发者ID:RoXimn,项目名称:mollana,代码行数:18,代码来源:mlmainwindow.cpp
示例9: saveImgFile
/*--------------------------------------- Private functions -----------------------------------------*/
bool PicEditWindow::saveFile(const QString &fileName){
// !!! if here the cursor state change hasn't been used, the program will announce abnormal ending
// once close the program ??? why
// set cursor as wait state
QApplication::setOverrideCursor(Qt::WaitCursor);
// emit save file signal
emit saveImgFile(fileName);
settitle(fileName);
// restore cursor state
QApplication::restoreOverrideCursor();
// restore window modify state
setWindowModified(false);
return true;
}
开发者ID:nop-end,项目名称:qt_picedit,代码行数:19,代码来源:piceditwindow.cpp
示例10: tr
void ArchiverWindow::slotFileOpen()
{
QString fileName =
QFileDialog::getOpenFileName(this, tr("Open Archive"),
QString(), tr("Tar Archives (*.tar *.tar.gz *.tar.xz *.tar.bz2 *.tgz *.tbz2"));
if (!fileName.isEmpty()) {
setBusy(true);
if (m_model->openArchive(fileName)) {
setWindowModified(false);
setWindowFilePath(fileName);
setBusy(false);
ui->actionFileSaveAs->setEnabled(false);
}
}
}
开发者ID:hawaii-desktop,项目名称:hawaii-archiver,代码行数:18,代码来源:archiverwindow.cpp
示例11: setWindowModified
void MeshSubWindow::setCurrentFile(const QString &fileName)
{
curFile = fileName;
setWindowModified(false);
QString shownName = tr("Untitled");
if (!curFile.isEmpty())
{
shownName = strippedName(curFile);
recentFiles.removeAll(curFile);
recentFiles.prepend(curFile);
//emit current_file_changed();
}
setWindowTitle(tr("%1[*] - %2").arg(shownName)
.arg(tr("Simplex Spline")));
updateStatusBar();
}
开发者ID:xiamenwcy,项目名称:b-spline-knots-setting,代码行数:18,代码来源:MeshSubWindow.cpp
示例12: tr
bool MainWindow::resize()
{
bool ok;
int width = QInputDialog::getInt(this, tr("Painter"),
tr("Please enter the width"
"(less than 1024)"),
painter->curSize().width(), 0,
1024, 1, &ok);
if(!ok) return ok;
int height = QInputDialog::getInt(this, tr("Painter"),
tr("Please enter the height"
"(less than 1024)"),
painter->curSize().height(), 0,
1024, 1, &ok);
if(!ok) return ok;
setWindowModified(painter->setSize(QSize(width, height)));
return ok;
}
开发者ID:byronyi-deprecated,项目名称:Project_1,代码行数:18,代码来源:mainwindow.cpp
示例13: fileSaveAs
bool HtmlEditor::fileSave()
{
if (fileName.isEmpty() || fileName.startsWith(QLatin1String(":/")))
return fileSaveAs();
QFile file(fileName);
bool success = file.open(QIODevice::WriteOnly);
if (success) {
// FIXME: here we always use UTF-8 encoding
QString content = ui->webView->page()->mainFrame()->toHtml();
QByteArray data = content.toUtf8();
qint64 c = file.write(data);
success = (c >= data.length());
}
setWindowModified(false);
return success;
}
开发者ID:Tarzanello,项目名称:graphics-dojo-qt5,代码行数:18,代码来源:htmleditor.cpp
示例14: QFileInfo
void HtmlEditor::setCurrentFileName(const QString &fileName)
{
this->fileName = fileName;
QString shownName;
if (fileName.isEmpty())
shownName = "untitled";
else
shownName = QFileInfo(fileName).fileName();
setWindowTitle(tr("%1[*] - %2").arg(shownName).arg(tr("HTML Editor")));
setWindowModified(false);
bool allowSave = true;
if (fileName.isEmpty() || fileName.startsWith(QLatin1String(":/")))
allowSave = false;
ui->actionFileSave->setEnabled(allowSave);
}
开发者ID:Tarzanello,项目名称:graphics-dojo-qt5,代码行数:18,代码来源:htmleditor.cpp
示例15: QFileInfo
//////////////////////////////////////////////////////////////////
//单文档实现。
void CMainWindow::setCurrentFile(const QString& fileName)
{
curFile = QFileInfo(fileName).canonicalFilePath();
isUntitled = false;
setWindowTitle(curFile + "[*]");
textEdit->document()->setModified(false);
setWindowModified(false);
QSettings settings("709", "SDI example");
QStringList files = settings.value("recentFiles").toStringList();
files.removeAll(fileName);
files.prepend(fileName);
while (files.size() > MaxRecentFiles)
files.removeLast();
settings.setValue("recentFiles", files);
updateRecentFiles();
}
开发者ID:hkutangyu,项目名称:QTDemo,代码行数:20,代码来源:mainwindow.cpp
示例16: QMainWindow
MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent),
m_toolBar(this),
m_aboutDialog(this),
m_helpBrowser(this),
m_viewerModel(this),
m_viewerView(this),
m_undoStack(this),
m_undoStackView(&m_undoStack, this),
m_viewerSelectionModel(&m_viewerModel, this),
m_logMessageDialog(0),
m_preferencesBrowser(this),
m_quiInputDialog(0),
m_context(0)
{
QGLFormat format(QGL::SampleBuffers);
format.setVersion(2,1);
format.setProfile(QGLFormat::CompatibilityProfile);
//format.setSampleBuffers(true);
//format.setSamples(4);
//format.setVersion(3,3);
//format.setProfile(QGLFormat::CoreProfile);
m_context = new QGLContext(format);
m_viewer = new Viewer(m_context, m_viewerModel, this);
m_viewer->initShaders();
setStatusBar(0);
setWindowTitle("IQmol");
setWindowModified(false);
setAcceptDrops(false);
setWindowIcon(QIcon(":/resources/icons/iqmol.png"));
createMenus();
createLayout();
createConnections();
m_undoStack.setUndoLimit(Preferences::UndoLimit());
m_undoStackView.setEmptyLabel("History:");
m_viewerView.setModel(&m_viewerModel);
m_viewerView.setSelectionModel(&m_viewerSelectionModel);
m_viewer->setActiveViewerMode(Viewer::BuildAtom);
m_viewer->setDefaultSceneRadius();
m_viewer->resetView();
}
开发者ID:jwakely,项目名称:IQmol,代码行数:44,代码来源:MainWindow.C
示例17: file
/*
Save the file currently in the editor.
*/
bool MainWindow::save( )
{
QFile file(currentFile);
if(file.open(QFile::WriteOnly | QFile::Text))
{
QTextStream out(&file);
QApplication::setOverrideCursor(Qt::WaitCursor);
out << editor->toPlainText();
QApplication::restoreOverrideCursor();
editor->document()->setModified(false);
setWindowModified(false);
return true;
}
else
{
statusBar()->showMessage( "Couldn't save...maybe the current file has been moved or deleted.", 3500 );
return false;
}
}
开发者ID:YTakami,项目名称:makecontroller,代码行数:22,代码来源:MainWindow.cpp
示例18: clear
void Opeke::openFile(const QString &inputFileName)
{
QString tmpFile;
if ( KIO::NetAccess::download (inputFileName, tmpFile, this ) )
{
emit clear();
fileName = inputFileName;
QFile* file = new QFile (tmpFile);
file->open ( QIODevice::ReadOnly );
m_view->openBricks(file);
file->close();
setWindowModified(false);
setCaption(fileName, false);
}
else
{
KMessageBox::error ( this, KIO::NetAccess::lastErrorString() );
}
}
开发者ID:Noughmad,项目名称:Opeke,代码行数:19,代码来源:opeke.cpp
示例19: open_chr
void win_char_editor::file_open()
{
if (!ask_if_save())
return;
QString new_file = open_chr(this);
if (!new_file.isEmpty())
if (w_main->char_open(new_file, &(c->cs), TRUE))
{
file = new_file;
never_saved = FALSE;
setWindowModified(FALSE);
setWindowTitle(QFileInfo(file).completeBaseName() + "[*] - Char Editor");
char_width->setCurrentIndex(c->cs.width - 1);
c->ur.clear();
c->setUpdatesEnabled(FALSE);
c->setUpdatesEnabled(TRUE);
}
}
开发者ID:OS2World,项目名称:APP-GRAPHICS-IteCAD,代码行数:19,代码来源:win_char_editor.cpp
示例20: blockTableSignals
void UXTEditor::insertRow()
{
blockTableSignals( true );
d_ptr->infos.push_back( STRING_MANAGER::TStringInfo() );
d_ptr->t->setRowCount( d_ptr->t->rowCount() + 1 );
int row = d_ptr->t->rowCount() - 1;
QTableWidgetItem *item1 = new QTableWidgetItem();
QTableWidgetItem *item2 = new QTableWidgetItem();
d_ptr->t->setItem( row, 0, item1 );
d_ptr->t->setItem( row, 1, item2 );
markRowUntranslated( row );
setWindowModified( true );
blockTableSignals( false );
}
开发者ID:sythaeryn,项目名称:pndrpg,代码行数:19,代码来源:uxt_editor.cpp
注:本文中的setWindowModified函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论