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


C++ setCurrentFile函数代码示例

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


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

示例1: setCurrentFile

void MainWindow::newFile()
{
    //if (okToContinue()) {
    renderArea->clearAll(); // wyczyść pixmapę
    historyList->clear();
    cmdLineEdit->clear();
    setCurrentFile("");
    //}
}
开发者ID:delor,项目名称:turtle,代码行数:9,代码来源:mainwindow.cpp

示例2: HdrViewer

void MainGui::addHdrViewer(pfs::Frame* hdr_pfs_frame, QString fname) {
	HdrViewer *newhdr=new HdrViewer(this, qtpfsgui_options->negcolor, qtpfsgui_options->naninfcolor, false);
	newhdr->updateHDR(hdr_pfs_frame);
	newhdr->filename=fname;
	newhdr->setWindowTitle(fname);
	mdiArea->addSubWindow(newhdr);
	newhdr->show();
	setCurrentFile(fname);
}
开发者ID:adrianogebertgomes,项目名称:BUG,代码行数:9,代码来源:mainWindow.cpp

示例3: setCurrentFile

bool MainWindow::loadFile(const QString &fileName)
{
    if(spreadsheet->readFile(fileName))
    {
        setCurrentFile(fileName);
        return true;
    }
    return false;
}
开发者ID:frozenix,项目名称:qspreadsheet,代码行数:9,代码来源:mainwindow.cpp

示例4: statusBar

bool MainWindow::saveFile(const QString &fileName)
{
    if(!spreadsheet->writeFile(fileName)) {
        statusBar()->showMessage(tr("Saving canceled"), 2000);
        return false;
    }
    setCurrentFile(fileName);
    statusBar()->showMessage(tr("File saved"), 2000);
    return true;
}
开发者ID:marsimunovic,项目名称:QTGui,代码行数:10,代码来源:mainwindow.cpp

示例5: repaint

void FilenameComponent::filesDropped (const StringArray& filenames, int, int)
{
    isFileDragOver = false;
    repaint();

    const File f (filenames[0]);

    if (f.exists() && (f.isDirectory() == isDir))
        setCurrentFile (f, true);
}
开发者ID:2DaT,项目名称:Obxd,代码行数:10,代码来源:juce_FilenameComponent.cpp

示例6: setCurrentFile

void MainWindow::openDir(const QDir & dir)
{
    if(db->open(dir)) {
        setCurrentFile(dir.path());
        pisoar->setCurrentDir(db->dirBase());
        tabs->show();
    }
    else
        tabs->hide();
}
开发者ID:martinspinler,项目名称:pisoar,代码行数:10,代码来源:mainwindow.cpp

示例7: writer

bool MyChild::saveFile(QString fileName)
{
    if (!(fileName.endsWith(".htm", Qt::CaseInsensitive) || fileName.endsWith(".html", Qt::CaseInsensitive))) {
        fileName += ".html"; // 默认保存为 HTML 文档
    }
    QTextDocumentWriter writer(fileName);
    bool success = writer.write(this->document());
    if (success)
        setCurrentFile(fileName);
    return success;
}
开发者ID:Pengfei-Gao,项目名称:develop-reference-data,代码行数:11,代码来源:mychild.cpp

示例8: statusBar

bool MainWindow::loadFile(const QString &fileName)
{
    if (!spreadsheet->readFile(fileName)) {
        statusBar()->showMessage(tr("Loading canceled"), 2000);
        return false;
    }

    setCurrentFile(fileName);
    statusBar()->showMessage(tr("File loaded"), 2000);
    return true;
}
开发者ID:Program0,项目名称:ZerothMarlo_CSC17B,代码行数:11,代码来源:mainwindow.cpp

示例9: loadProject

void MainWindow::
loadProject(
  QString filename)
{
  setCurrentFile(filename);
  QApplication::setOverrideCursor(Qt::WaitCursor);
  QFile file(filename);
  if(!file.open(QFile::ReadOnly | QFile::Text))
  {
    QMessageBox::warning(NULL, "Load project", "Cannot open project file.");
    QApplication::restoreOverrideCursor();
    return;
  }
  config.setProjectDirFromFile(filename);

  QDomDocument doc;
  QString errorStr;
  int errorLine, errorColumn;
  if(!doc.setContent(&file, false, &errorStr, &errorLine, &errorColumn))
  {
    QMessageBox::warning(NULL, "Load project",
        QString("Parse error at line %1 column %2 :").arg(errorLine).
	        arg(errorColumn) + errorStr);
    QApplication::restoreOverrideCursor();
    return;
  }
  QDomElement root = doc.documentElement();
  if(root.tagName() == WarperController::xmlTag2D)
  {
    controler = new WarperController(this, &projectSettings);
    controler->set3D(false);
    bool success=controler->parseProject(root);
    projectSettings.m_fileName = filename;
    actionSaveProject->setEnabled(true);
    checkAndSwitch(success, ProjectProperties::warpingProject);
  }
  else if(root.tagName() == WarperController::xmlTag3D)
  {
    controler = new WarperController(this, &projectSettings);
    controler->set3D(true);
    bool success=controler->parseProject(root);
    projectSettings.m_fileName = filename;
    actionSaveProject->setEnabled(true);
    checkAndSwitch(success, ProjectProperties::warpingProject);
  }
  else
  {
    QMessageBox::warning(NULL, "Load project",
                         QString("Not a warping project"));
  }
  QApplication::restoreOverrideCursor();
  file.close();
  return;
}
开发者ID:ma-tech,项目名称:WlzQtApps,代码行数:54,代码来源:MainWindow.cpp

示例10: readFile

bool Editor::openFile(const QString &fileName)
{
    bool ok = readFile(fileName);
    if (ok) {
        setCurrentFile(fileName);
        emit message(tr("File loaded"), 2000);
    } else {
        emit message(tr("Loading canceled"), 2000);
    }
    return ok;
}
开发者ID:EleVenPerfect,项目名称:OTHERS,代码行数:11,代码来源:editor.cpp

示例11: tr

void WMain::saveFileAction(bool saveas) {
		if(cDocument->filename=="" || saveas) {
		cDocument->filename=QFileDialog::getSaveFileName(wMain,
											  tr("Choose file"), "./");
	}
	if(!cDocument->filename.endsWith(".dic") && !cDocument->filename.endsWith(".txt")) {
		cDocument->filename.append(".dic");
	}
	cDocument->saveToFile();
	setCurrentFile(cDocument->filename);
}
开发者ID:pewniak747,项目名称:dicto,代码行数:11,代码来源:wmain.cpp

示例12: setCurrentFile

bool ImageDisplay::openFile(const QString &fileName)
{
	if (readFile(fileName))
	{
		setCurrentFile(fileName);
		return true;
	}
	else
	{
		return false;
	}
}
开发者ID:bpoje,项目名称:dct,代码行数:12,代码来源:ImageDisplay.cpp

示例13: TextEditWidget

void PEditor::newFile() {
    tabWidget->addTab(new TextEditWidget(tabWidget), "");
    switchToTab(tabWidget->count() - 1);

    textEdit->getFont()->setPointSize(textSize);
    textEdit->getFont()->setFamily(textFont);
    textEdit->updateFont();
    textEdit->setLineNumbering(lineNumbering);

    connect(tabWidget->currentWidget(), SIGNAL(highlighting(bool)), this, SLOT(setSyntaxHighlightingMenuItem(bool)));
    setCurrentFile("");
}
开发者ID:CreativeLabs0X3CF,项目名称:deveditor,代码行数:12,代码来源:peditor.cpp

示例14: tr

bool MapWindow::saveFile(const QString & fileName)
{
    if(! mapData.saveMapXML(fileName))
    {
        QMessageBox::warning(this, tr("Map Editor"), tr("Cannot write file %1.").arg(fileName));
        return saveAs();
    }

    setCurrentFile(fileName);

    return true;
}
开发者ID:mastermind-,项目名称:free-heroes,代码行数:12,代码来源:mapwindow.cpp

示例15: QMainWindow

JsonEditorMain::JsonEditorMain(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::JsonEditorMain),
    newInsertText(tr("Insert new data")),
    treeViewColumnKey(tr("Node")),
    treeViewColumnValue(tr("Value")),
    treeViewColumnType(tr("Type"))
{
    ui->setupUi(this);
    connect(ui->menuCodeTools, SIGNAL(toggled(bool)), this, SLOT(toggleCodeToolbar(bool)));
    connect(ui->menuFindTools, SIGNAL(toggled(bool)), this, SLOT(toggleFindToolbar(bool)));
    connect(ui->menuFileTools, SIGNAL(toggled(bool)), this, SLOT(toggleFileToolbar(bool)));
    connect(ui->menuEditTools, SIGNAL(toggled(bool)), this, SLOT(toggleEditToolbar(bool)));
    connect(ui->menuRefresh, SIGNAL(triggered()), this, SLOT(refreshJsonTree()));
    connect(ui->menuInsertNode, SIGNAL(triggered()), this, SLOT(insertTreeNode()));
    connect(ui->menuInsertChild, SIGNAL(triggered()), this, SLOT(insertTreeChild()));
    connect(ui->menuDeleteNode, SIGNAL(triggered()), this, SLOT(deleteTreeNode()));
    connect(ui->jsonTree, SIGNAL(clicked(QModelIndex)), this, SLOT(updateActions()));
    connect(ui->menuFormat, SIGNAL(triggered()), this, SLOT(formatCode()));
    connect(ui->menuHelp, SIGNAL(triggered()), this, SLOT(showHelp()));
    connect(ui->jsonTree, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(dataEdit(QModelIndex)));


//    connect(ui->menuNewFile, SIGNAL(triggered()), this, SLOT(newFile()));
    connect(ui->menuOpenFile, SIGNAL(triggered()), this, SLOT(open()));
    connect(ui->menuSaveFile, SIGNAL(triggered()), this, SLOT(save()));
    connect(ui->menuSaveAs, SIGNAL(triggered()), this, SLOT(saveAs()));

    JSHighlighter * highlight = new JSHighlighter(ui->jsonCode->document());

    setCurrentFile("");

    textEdit = ui->jsonCode;
    connect(textEdit->document(), SIGNAL(contentsChanged()),
            this, SLOT(documentWasModified()));
    setUnifiedTitleAndToolBarOnMac(true);

    m_findDialog = new FindDialog(this);
    m_findDialog->setModal(false);
    m_findDialog->setTextEdit(textEdit);

    m_findReplaceDialog = new FindReplaceDialog(this);
    m_findReplaceDialog->setModal(false);
    m_findReplaceDialog->setTextEdit(textEdit);

    connect(ui->menuFind, SIGNAL(triggered()), m_findDialog, SLOT(show()));
    connect(ui->menuReplace, SIGNAL(triggered()), m_findReplaceDialog, SLOT(show()));

//    connect(ui->actionFindNext, SIGNAL(triggered()), m_findDialog, SLOT(findNext()));
//    connect(ui->actionFindPrevious, SIGNAL(triggered()), m_findDialog, SLOT(findPrev()));

    readSettings();
}
开发者ID:peteristhegreat,项目名称:qt-json-editor,代码行数:53,代码来源:jsoneditormain.cpp


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