Logo Search packages:      
Sourcecode: qtiplot version File versions  Download package

ApplicationWindow * ApplicationWindow::loadScript ( const QString &  fn,
bool  execute = false,
bool  factorySettings = false 
) [slot]

Create a new project from a script file.

Parameters:
fn is read as a Python script file and loaded in the command script window.
execute specifies if the script should be executed after opening.

Definition at line 14323 of file ApplicationWindow.cpp.

References applyUserSettings(), ScriptWindow::executeAll(), ScriptWindow::open(), restoreApplicationGeometry(), scriptWindow, setScriptingLanguage(), and showScriptWindow().

{
#ifdef SCRIPTING_PYTHON
      QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
      ApplicationWindow *app= new ApplicationWindow(factorySettings);
      app->applyUserSettings();
      app->setScriptingLanguage("Python");
      app->restoreApplicationGeometry();
      app->showScriptWindow();
      app->scriptWindow->open(fn);
      QApplication::restoreOverrideCursor();
      if (execute)
            app->scriptWindow->executeAll();
      return app;
#else
    QMessageBox::critical(this, tr("QtiPlot") + " - " + tr("Error"),
    tr("QtiPlot was not built with Python scripting support included!"));
#endif

}


Generated by  Doxygen 1.6.0   Back to index