Loading...
Searching...
No Matches
InterfaceWidget Class Reference

The InterfaceWidget class provides a user interface for running external scripts. More...

`#include <interfacewidget.h>`

Inheritance diagram for InterfaceWidget:

## Public Member Functions

| InterfaceWidget (const QString &scriptFilePath, QWidget *parent_=nullptr)
void | setInterfaceScript (const QString &scriptFilePath)
void | reloadOptions ()
QtGui::InterfaceScript & | interfaceScript ()
const QtGui::InterfaceScript & | interfaceScript () const
Public Member Functions inherited from JsonWidget
| JsonWidget (QWidget *parent_=nullptr)
virtual void | setMolecule (QtGui::Molecule *mol)
QJsonObject | collectOptions () const
void | applyOptions (const QJsonObject &opts)
bool | isEmpty () const

## Additional Inherited Members

Public Slots inherited from JsonWidget
virtual void | updatePreviewText ()
Protected Member Functions inherited from JsonWidget
QString | lookupOptionType (const QString &name) const
bool | optionString (const QString &option, QString &value) const
| Search for an option named option and convert its value to a string.
QString | generateJobTitle () const
virtual void | updateOptions ()
void | buildOptionGui ()
void | combinedOptionRow (const QString &label1, const QString &label2, const QString &tr1, const QString &tr2, QJsonObject &options, bool bothLabels=false)
void | addOptionRow (const QString &key, const QString &label, const QJsonValue &option)
QWidget * | createOptionWidget (const QJsonValue &option)
QWidget * | createStringListWidget (const QJsonObject &obj)
QWidget * | createStringWidget (const QJsonObject &obj)
QWidget * | createFilePathWidget (const QJsonObject &obj)
QWidget * | createIntegerWidget (const QJsonObject &obj)
QWidget * | createFloatWidget (const QJsonObject &obj)
QWidget * | createBooleanWidget (const QJsonObject &obj)
QWidget * | createTextWidget (const QJsonObject &obj)
QWidget * | createTableWidget (const QJsonObject &obj)
void | setOptionDefaults ()
void | setOption (const QString &name, const QJsonValue &defaultValue)
void | setStringListOption (const QString &name, const QJsonValue &value)
void | setStringOption (const QString &name, const QJsonValue &value)
void | setFilePathOption (const QString &name, const QJsonValue &value)
void | setIntegerOption (const QString &name, const QJsonValue &value)
void | setFloatOption (const QString &name, const QJsonValue &value)
void | setBooleanOption (const QString &name, const QJsonValue &value)
void | setTextOption (const QString &name, const QJsonValue &value)
void | setTableOption (const QString &name, const QJsonValue &value)
Protected Attributes inherited from JsonWidget
QtGui::Molecule * | m_molecule
bool | m_isTabbed
QJsonObject | m_options
QJsonObject | m_optionCache
QList< QTextEdit * > | m_dirtyTextEdits
bool | m_empty
bool | m_batchMode
QFormLayout * | m_currentLayout
QWidget * | m_centralWidget
QMap< QString, QWidget * > | m_widgets
QMap< QString, QTextEdit * > | m_textEdits

## Detailed Description

<avogadro/qtgui/interfacewidget.h>

See also
  InterfaceScript

The InterfaceWidget creates a GUI to represent the options given by an script, turning JSON from the script into a form and passing the results back to the script via command-line

## Constructor & Destructor Documentation

## InterfaceWidget()

InterfaceWidget | ( | const QString & | scriptFilePath,
|  | QWidget * | parent_ = nullptr )

explicit

Construct a widget that dynamically generates a GUI to configure the script specified by scriptFilePath. Pass an empty string to create without loading a script (configure via interfaceScript() then call reloadOptions()).

## Member Function Documentation

## setInterfaceScript()

void setInterfaceScript | ( | const QString & | scriptFilePath | ) |

Use the script pointed to by scriptFilePath.

Parameters

  scriptFilePath | Absolute path to script.

## reloadOptions()

void reloadOptions | ( |  | ) |

Re-fetch options from the underlying script and rebuild the GUI. Call this after configuring the interpreter (e.g. for package mode).

## interfaceScript() [1/2]

QtGui::InterfaceScript & interfaceScript | ( |  | ) |

Access to the underlying input script object.

## interfaceScript() [2/2]

const QtGui::InterfaceScript & interfaceScript | ( |  | ) | const

Access to the underlying input script object.

The documentation for this class was generated from the following file:

- interfacewidget.h