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


C++ setWindowModified函数代码示例

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


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


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