本文整理汇总了C++中setCurrentFile函数的典型用法代码示例。如果您正苦于以下问题:C++ setCurrentFile函数的具体用法?C++ setCurrentFile怎么用?C++ setCurrentFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setCurrentFile函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: statusBar
bool MainWindow::saveFile(const QString& fileName)
{
if (!m_document->saveFile(fileName.toStdString()))
{
statusBar()->showMessage(tr("Saving failed"), 2000);
return false;
}
setCurrentFile(fileName);
statusBar()->showMessage(tr("File saved"), 2000);
return true;
}
开发者ID:cguebert,项目名称:SofaViewer,代码行数:12,代码来源:MainWindow.cpp
示例17: QTabWidget
MainWindow::MainWindow()
:documents()
{
tabWidget = new QTabWidget(this);
tabWidget -> setTabsClosable(true);
tabWidget -> setUsesScrollButtons(true);
tabWidget -> setDocumentMode(true);
connect(tabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int)));
connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int)));
setCentralWidget(tabWidget);
createActions();
createMenus();
createContextMenu(0);
createToolBars();
createStatusBar();
readSettings();
findDialog = 0;
setWindowIcon(QIcon(":/images/pics/ss.png"));
setCurrentFile("");
//test
setWindowModified(true);
setCurrentFile(tr("data.sp"));
setCurrentFile(tr("money.sp"));
setCurrentFile(tr("students.sp"));
setCurrentFile(tr("teachers.sp"));
setCurrentFile(tr("total.sp"));
}
开发者ID:kernelhcy,项目名称:hcyprojects,代码行数:29,代码来源:mainwindow.cpp
示例18: QMainWindow
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
// Buttons
auto buttonsDock = new QDockWidget(tr("Buttons"));
m_buttonsDockWidget = new QWidget(this);
auto buttonsLayout = new QGridLayout;
m_buttonsDockWidget->setLayout(buttonsLayout);
buttonsDock->setObjectName("ButtonsDock");
buttonsDock->setWidget(m_buttonsDockWidget);
buttonsDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
addDockWidget(Qt::LeftDockWidgetArea, buttonsDock);
// Graph tree
m_graphView = new GraphView(this);
auto graphDock = new QDockWidget(tr("Graph"), this);
graphDock->setObjectName("GraphDock");
graphDock->setWidget(m_graphView->view());
graphDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
addDockWidget(Qt::LeftDockWidgetArea, graphDock);
m_openGLView = new OpenGLView(this);
setCentralWidget(m_openGLView);
createActions();
createMenus();
statusBar();
std::vector<QMenu*> menus = { m_fileMenu, m_toolsMenu, m_viewMenu, m_helpMenu };
m_simpleGUI = std::make_shared<SimpleGUIImpl>(this, m_openGLView, m_buttonsDockWidget, menus);
connect(m_graphView, &GraphView::itemOpened, [this](void* item) {
m_simpleGUI->openPropertiesDialog(static_cast<GraphNode*>(item));
});
setWindowIcon(QIcon(":/share/icons/icon.png"));
setCurrentFile("");
setAcceptDrops(true);
readSettings();
loadModules();
auto& factory = DocumentFactory::instance();
if (factory.creatableDocuments().empty())
m_newAction->setEnabled(false);
if (factory.loadFilesFilter().empty())
m_openAction->setEnabled(false);
}
开发者ID:cguebert,项目名称:SofaViewer,代码行数:50,代码来源:MainWindow.cpp
示例19: QFile
void MainWindow::loadFile(const QString &fileName)
{
logFile = new QFile(fileName);
#ifndef QT_NO_CURSOR
QApplication::setOverrideCursor(Qt::WaitCursor);
#endif
#ifndef QT_NO_CURSOR
QApplication::restoreOverrideCursor();
#endif
setCurrentFile(fileName);
statusBar()->showMessage(tr("File loaded"), 2000);
reloadFile();
}
开发者ID:nabsha,项目名称:gTail,代码行数:14,代码来源:mainwindow.cpp
示例20: recentFiles
MainWindow::MainWindow() :
recentFiles( Persistent<RecentFiles>( "recentFiles" ) ), mainIcon_()
{
createActions();
createMenus();
// createContextMenu();
createToolBars();
// createStatusBar();
createCrawler();
setAcceptDrops( true );
// Default geometry
const QRect geometry = QApplication::desktop()->availableGeometry( this );
setGeometry( geometry.x() + 20, geometry.y() + 40,
geometry.width() - 140, geometry.height() - 140 );
// Send actions to the crawlerwidget
connect( this, SIGNAL( followSet( bool ) ),
crawlerWidget, SIGNAL( followSet( bool ) ) );
connect( this, SIGNAL( optionsChanged() ),
crawlerWidget, SLOT( applyConfiguration() ) );
// Actions from the CrawlerWidget
connect( crawlerWidget, SIGNAL( followDisabled() ),
this, SLOT( disableFollow() ) );
connect( crawlerWidget, SIGNAL( updateLineNumber( int ) ),
this, SLOT( lineNumberHandler( int ) ) );
readSettings();
emit optionsChanged();
// We start with the empty file
setCurrentFile( "" );
mainIcon_.addFile( ":/images/hicolor/16x16/glogg.png" );
mainIcon_.addFile( ":/images/hicolor/24x24/glogg.png" );
mainIcon_.addFile( ":/images/hicolor/32x32/glogg.png" );
mainIcon_.addFile( ":/images/hicolor/48x48/glogg.png" );
// Register for progress status bar
connect( crawlerWidget, SIGNAL( loadingProgressed( int ) ),
this, SLOT( updateLoadingProgress( int ) ) );
connect( crawlerWidget, SIGNAL( loadingFinished( bool ) ),
this, SLOT( displayNormalStatus( bool ) ) );
setWindowIcon( mainIcon_ );
setCentralWidget(crawlerWidget);
}
开发者ID:blaykelarue,项目名称:glogg,代码行数:49,代码来源:mainwindow.cpp
注:本文中的setCurrentFile函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论