namespace dealii
{
-/*! @addtogroup ParameterGui
- *@{
- */
+ /*! @addtogroup ParameterGui
+ *@{
+ */
namespace ParameterGui
{
-/**
- * The BrowseLineEdit class provides a special line editor for the parameterGUI.
- * While editing file- or directory names it is much more easier to have a file-dialog
- * and just click on existing files or directories. This editor provides a simple QLineEditor
- * and a browse-button which opens a file- or a directory dialog. Clicking on existing files or directories
- * copies the path to the line editor. Depending on the <tt>BrowseType</tt> given in the constructor
- * the browse button opens a <tt>file</tt> or a <tt>directory</tt> dialog.
- *
- * @note This class is used in the graphical user interface for the @ref ParameterHandler class.
- * It is not compiled into the deal.II libraries and can not be used by applications using deal.II.
- *
- * @ingroup ParameterGui
- * @author Martin Steigemann, Wolfgang Bangerth, 2010
- */
+ /**
+ * The BrowseLineEdit class provides a special line editor for the parameterGUI.
+ * While editing file- or directory names it is much more easier to have a file-dialog
+ * and just click on existing files or directories. This editor provides a simple QLineEditor
+ * and a browse-button which opens a file- or a directory dialog. Clicking on existing files or directories
+ * copies the path to the line editor. Depending on the <tt>BrowseType</tt> given in the constructor
+ * the browse button opens a <tt>file</tt> or a <tt>directory</tt> dialog.
+ *
+ * @note This class is used in the graphical user interface for the @ref ParameterHandler class.
+ * It is not compiled into the deal.II libraries and can not be used by applications using deal.II.
+ *
+ * @ingroup ParameterGui
+ * @author Martin Steigemann, Wolfgang Bangerth, 2010
+ */
class BrowseLineEdit : public QFrame
{
Q_OBJECT
- public:
- /**
- * The browse button opens a <tt>file</tt> or
- * a <tt>directory</tt> dialog. This can be specified
- * in the constructor by setting this flag <tt>BrowseType</tt>.
- */
- enum BrowseType {file = 0, directory = 1, files = 2};
- /**
- * Constructor. The type of the browse dialog can be specified
- * by the flag <tt>BrowseType</tt>, the default is <tt>file</tt>.
- */
- BrowseLineEdit (const BrowseType type = file,
- QWidget *parent = 0);
+ public:
+ /**
+ * The browse button opens a <tt>file</tt> or
+ * a <tt>directory</tt> dialog. This can be specified
+ * in the constructor by setting this flag <tt>BrowseType</tt>.
+ */
+ enum BrowseType {file = 0, directory = 1, files = 2};
+ /**
+ * Constructor. The type of the browse dialog can be specified
+ * by the flag <tt>BrowseType</tt>, the default is <tt>file</tt>.
+ */
+ BrowseLineEdit (const BrowseType type = file,
+ QWidget *parent = 0);
- /**
- * Reimplemented from the QWidget class.
- * Returns the size of the editor.
- */
- QSize sizeHint() const;
- /**
- * Reimplemented from the QWidget class.
- */
- QSize minimumSizeHint() const;
- /**
- * Returns the text of the line editor.
- */
- QString text() const;
- /**
- * This pattern stores the type of the browse dialog.
- */
- BrowseType browse_type;
+ /**
+ * Reimplemented from the QWidget class.
+ * Returns the size of the editor.
+ */
+ QSize sizeHint() const;
+ /**
+ * Reimplemented from the QWidget class.
+ */
+ QSize minimumSizeHint() const;
+ /**
+ * Returns the text of the line editor.
+ */
+ QString text() const;
+ /**
+ * This pattern stores the type of the browse dialog.
+ */
+ BrowseType browse_type;
- public slots:
- /**
- * A <tt>slot</tt> to set @p str as text of the line editor.
- */
- void setText(const QString &str);
+ public slots:
+ /**
+ * A <tt>slot</tt> to set @p str as text of the line editor.
+ */
+ void setText(const QString &str);
- signals:
- /**
- * This <tt>signal</tt> will be emitted, if editing is finished.
- */
- void editingFinished();
+ signals:
+ /**
+ * This <tt>signal</tt> will be emitted, if editing is finished.
+ */
+ void editingFinished();
- private slots:
- /**
- * This <tt>slot</tt> should be always called, if editing is finished.
- */
- void editing_finished();
- /**
- * This function opens a file- or a directory dialog as specified in the
- * constructor.
- */
- void browse();
+ private slots:
+ /**
+ * This <tt>slot</tt> should be always called, if editing is finished.
+ */
+ void editing_finished();
+ /**
+ * This function opens a file- or a directory dialog as specified in the
+ * constructor.
+ */
+ void browse();
- private:
- /**
- * The line editor.
- */
- QLineEdit * line_editor;
- /**
- * The browse button.
- */
- QPushButton * browse_button;
+ private:
+ /**
+ * The line editor.
+ */
+ QLineEdit *line_editor;
+ /**
+ * The browse button.
+ */
+ QPushButton *browse_button;
};
}
-/**@}*/
+ /**@}*/
}
namespace dealii
{
-/*! @addtogroup ParameterGui
- *@{
- */
+ /*! @addtogroup ParameterGui
+ *@{
+ */
namespace ParameterGui
{
-/**
- * The InfoMessage class implements a special info message for the parameterGUI.
- * Besides showing a info message itself, the dialog shows a checkbox "Show this message again".
- * If the user unchecks this box, this is stored in the "settings.ini" file and will be reloaded
- * the next time the user opens the parameterGUI. The intention of such a info message is the following.
- * The user should have some information on how using the GUI "at hand"
- * such as "how to edit parameter values" for example. But after reading this message, the user knows
- * it and the message should not appear permanently.
- *
- * @note This class is used in the graphical user interface for the @ref ParameterHandler class.
- * It is not compiled into the deal.II libraries and can not be used by applications using deal.II.
- *
- * @ingroup ParameterGui
- * @author Martin Steigemann, Wolfgang Bangerth, 2010
- */
+ /**
+ * The InfoMessage class implements a special info message for the parameterGUI.
+ * Besides showing a info message itself, the dialog shows a checkbox "Show this message again".
+ * If the user unchecks this box, this is stored in the "settings.ini" file and will be reloaded
+ * the next time the user opens the parameterGUI. The intention of such a info message is the following.
+ * The user should have some information on how using the GUI "at hand"
+ * such as "how to edit parameter values" for example. But after reading this message, the user knows
+ * it and the message should not appear permanently.
+ *
+ * @note This class is used in the graphical user interface for the @ref ParameterHandler class.
+ * It is not compiled into the deal.II libraries and can not be used by applications using deal.II.
+ *
+ * @ingroup ParameterGui
+ * @author Martin Steigemann, Wolfgang Bangerth, 2010
+ */
class InfoMessage : public QDialog
{
Q_OBJECT
- public:
- /**
- * Constructor
- */
- InfoMessage (QWidget *parent = 0);
- /**
- * With this function the @p message which will be shown in the
- * dialog can be set.
- */
- void setInfoMessage(const QString &message);
+ public:
+ /**
+ * Constructor
+ */
+ InfoMessage (QWidget *parent = 0);
+ /**
+ * With this function the @p message which will be shown in the
+ * dialog can be set.
+ */
+ void setInfoMessage(const QString &message);
- public slots:
- /**
- * Show the dialog with the <tt>message</tt>.
- */
- void showMessage();
+ public slots:
+ /**
+ * Show the dialog with the <tt>message</tt>.
+ */
+ void showMessage();
- protected:
- /**
- * Reimplemented from QDialog.
- */
- void done(int r);
+ protected:
+ /**
+ * Reimplemented from QDialog.
+ */
+ void done(int r);
- private:
- /**
- * This variable stores, if the <tt>message</tt> should be shown again the next time.
- */
- bool show_again;
- /**
- * The <tt>Ok</tt> button.
- */
- QPushButton * ok;
- /**
- * The checkbox<tt>Show this message again</tt>.
- */
- QCheckBox * again;
- /**
- * The <tt>message</tt> editor.
- */
- QTextEdit * message;
- /**
- * An <tt>icon</tt> for the dialog.
- */
- QLabel * icon;
+ private:
+ /**
+ * This variable stores, if the <tt>message</tt> should be shown again the next time.
+ */
+ bool show_again;
+ /**
+ * The <tt>Ok</tt> button.
+ */
+ QPushButton *ok;
+ /**
+ * The checkbox<tt>Show this message again</tt>.
+ */
+ QCheckBox *again;
+ /**
+ * The <tt>message</tt> editor.
+ */
+ QTextEdit *message;
+ /**
+ * An <tt>icon</tt> for the dialog.
+ */
+ QLabel *icon;
#ifdef QT_SOFTKEYS_ENABLED
- /**
- * A action for pressing the <tt>Ok</tt> button.
- */
- QAction * ok_action;
+ /**
+ * A action for pressing the <tt>Ok</tt> button.
+ */
+ QAction *ok_action;
#endif
- /**
- * An object for storing <tt>settings</tt> in a file.
- */
- QSettings * settings;
+ /**
+ * An object for storing <tt>settings</tt> in a file.
+ */
+ QSettings *settings;
};
}
-/**@}*/
+ /**@}*/
}
namespace dealii
{
-/*! @addtogroup ParameterGui
- *@{
- */
+ /*! @addtogroup ParameterGui
+ *@{
+ */
namespace ParameterGui
{
-/**
- * The MainWindow class of the the parameterGUI.
- * The parameterGUI is a graphical user interface for editing parameter files based on the XML format,
- * created by the @ref ParameterHandler::print_parameters() function with @ref ParameterHandler::XML as second argument.
- * Please see <tt>Representation of Parameters</tt> in the documentation of the @ref ParameterHandler class for more details.
- * The MainWindow class provides the basic functionality of the GUI as save- and load-file-actions and documentation.
- * The parameterGUI provides special editors for the different types of parameters defined in the ParameterHandler class.
- *
- * @note This class is used in the graphical user interface for the @ref ParameterHandler class.
- * It is not compiled into the deal.II libraries and can not be used by applications using deal.II.
- *
- * @ingroup ParameterGui
- * @author Martin Steigemann, Wolfgang Bangerth, 2010
- */
+ /**
+ * The MainWindow class of the the parameterGUI.
+ * The parameterGUI is a graphical user interface for editing parameter files based on the XML format,
+ * created by the @ref ParameterHandler::print_parameters() function with @ref ParameterHandler::XML as second argument.
+ * Please see <tt>Representation of Parameters</tt> in the documentation of the @ref ParameterHandler class for more details.
+ * The MainWindow class provides the basic functionality of the GUI as save- and load-file-actions and documentation.
+ * The parameterGUI provides special editors for the different types of parameters defined in the ParameterHandler class.
+ *
+ * @note This class is used in the graphical user interface for the @ref ParameterHandler class.
+ * It is not compiled into the deal.II libraries and can not be used by applications using deal.II.
+ *
+ * @ingroup ParameterGui
+ * @author Martin Steigemann, Wolfgang Bangerth, 2010
+ */
class MainWindow : public QMainWindow
{
Q_OBJECT
- public:
- /**
- * Constructor.
- * If a @p filename is given,
- * the MainWindow tries to open
- * and parse the file.
- */
- MainWindow(const QString &filename = "");
+ public:
+ /**
+ * Constructor.
+ * If a @p filename is given,
+ * the MainWindow tries to open
+ * and parse the file.
+ */
+ MainWindow(const QString &filename = "");
- protected:
- /**
- * Reimplemented from QMainWindow.
- * We ask, if changes should be saved.
- */
- void closeEvent(QCloseEvent *event);
+ protected:
+ /**
+ * Reimplemented from QMainWindow.
+ * We ask, if changes should be saved.
+ */
+ void closeEvent(QCloseEvent *event);
- private slots:
+ private slots:
- /**
- * Open a parameter file.
- */
- void open();
- /**
- * Save the parameter file.
- */
- bool save();
- /**
- * Open a file dialog to save the parameter file.
- */
- bool save_as();
- /**
- * Show some information on the parameterGUI
- */
- void about();
+ /**
+ * Open a parameter file.
+ */
+ void open();
+ /**
+ * Save the parameter file.
+ */
+ bool save();
+ /**
+ * Open a file dialog to save the parameter file.
+ */
+ bool save_as();
+ /**
+ * Show some information on the parameterGUI
+ */
+ void about();
- /**
- * A <tt>slot</tt> that should be always called,
- * if parameter values were changed.
- */
- void tree_was_modified();
+ /**
+ * A <tt>slot</tt> that should be always called,
+ * if parameter values were changed.
+ */
+ void tree_was_modified();
- /**
- * A <tt>slot</tt> that is called when the active
- * item has changed. It updates the documentation
- * text in the documentation panel.
- */
- void set_documentation_text(QTreeWidgetItem *selected_item,
- QTreeWidgetItem *previous_item);
+ /**
+ * A <tt>slot</tt> that is called when the active
+ * item has changed. It updates the documentation
+ * text in the documentation panel.
+ */
+ void set_documentation_text(QTreeWidgetItem *selected_item,
+ QTreeWidgetItem *previous_item);
- /**
- * A <tt>slot</tt> that is called when the active
- * tree item should be set to its default value.
- */
- void set_to_default();
+ /**
+ * A <tt>slot</tt> that is called when the active
+ * tree item should be set to its default value.
+ */
+ void set_to_default();
- /**
- * A <tt>slot</tt> that is called when any
- * item value has changed. It updates the font depending
- * on whether the item has a default value or not.
- */
- void item_changed(QTreeWidgetItem *item,
- int column);
+ /**
+ * A <tt>slot</tt> that is called when any
+ * item value has changed. It updates the font depending
+ * on whether the item has a default value or not.
+ */
+ void item_changed(QTreeWidgetItem *item,
+ int column);
- /**
- * Show an information dialog, how
- * parameters can be edited.
- */
- void show_settings ();
+ /**
+ * Show an information dialog, how
+ * parameters can be edited.
+ */
+ void show_settings ();
- /**
- * Apply the new settings to this window.
- */
- void apply_settings ();
+ /**
+ * Apply the new settings to this window.
+ */
+ void apply_settings ();
- /**
- * Hide all default items in tree_widget if set in gui_settings.
- * Otherwise restores all default values.
- */
- void update_visible_items();
+ /**
+ * Hide all default items in tree_widget if set in gui_settings.
+ * Otherwise restores all default values.
+ */
+ void update_visible_items();
- /**
- * Reads the font from gui_settings and applies it.
- */
- void update_font();
+ /**
+ * Reads the font from gui_settings and applies it.
+ */
+ void update_font();
- /**
- * Changes whether default items should be displayed in the tree widget
- * and calls update_visible_items() to apply the changes.
- */
- void toggle_visible_default_items();
+ /**
+ * Changes whether default items should be displayed in the tree widget
+ * and calls update_visible_items() to apply the changes.
+ */
+ void toggle_visible_default_items();
- /**
- * Function that displays a font selection dialog, stores the result
- * in gui_settings, and displays the new font.
- */
- void select_font();
- private:
- /**
- * Show an information dialog, how
- * parameters can be edited.
- */
- void show_message ();
- /**
- * This function creates all actions.
- */
- void create_actions();
- /**
- * This function creates all menus.
- */
- void create_menus();
+ /**
+ * Function that displays a font selection dialog, stores the result
+ * in gui_settings, and displays the new font.
+ */
+ void select_font();
+ private:
+ /**
+ * Show an information dialog, how
+ * parameters can be edited.
+ */
+ void show_message ();
+ /**
+ * This function creates all actions.
+ */
+ void create_actions();
+ /**
+ * This function creates all menus.
+ */
+ void create_menus();
- /**
- * This function creates the toolbar.
- */
- void create_toolbar();
- /**
- * This function checks, if parameters were changed
- * and show a dialog, if changes should be saved.
- * This function should be always called,
- * before open a new parameter file or before closing the GUI
- */
- bool maybe_save ();
- /**
- * Save parameters to @p filename in XML format.
- */
- bool save_file (const QString &filename);
- /**
- * Load parameters from @p filename in XML format.
- */
- void load_file (const QString &filename);
- /**
- * This functions writes the current @p filename to the window title.
- */
- void set_current_file (const QString &filename);
+ /**
+ * This function creates the toolbar.
+ */
+ void create_toolbar();
+ /**
+ * This function checks, if parameters were changed
+ * and show a dialog, if changes should be saved.
+ * This function should be always called,
+ * before open a new parameter file or before closing the GUI
+ */
+ bool maybe_save ();
+ /**
+ * Save parameters to @p filename in XML format.
+ */
+ bool save_file (const QString &filename);
+ /**
+ * Load parameters from @p filename in XML format.
+ */
+ void load_file (const QString &filename);
+ /**
+ * This functions writes the current @p filename to the window title.
+ */
+ void set_current_file (const QString &filename);
- /**
- * Determine if the item and all of its children have the default value,
- * and hide all default items. Returns true if the item and all of its
- * children have default values.
- */
- bool hide_item_with_default_value(QTreeWidgetItem *item);
+ /**
+ * Determine if the item and all of its children have the default value,
+ * and hide all default items. Returns true if the item and all of its
+ * children have default values.
+ */
+ bool hide_item_with_default_value(QTreeWidgetItem *item);
- /**
- * This is the tree structure in which we store all parameters.
- */
- QTreeWidget * tree_widget;
- /**
- * This is the documentation text area.
- */
- QTextEdit *documentation_text_widget;
+ /**
+ * This is the tree structure in which we store all parameters.
+ */
+ QTreeWidget *tree_widget;
+ /**
+ * This is the documentation text area.
+ */
+ QTextEdit *documentation_text_widget;
- /** A tool button that allows to toggle between showing/hiding parameters
- * with default values.
- */
- QToolButton *hide_default;
- /**
- * This menu provides all file actions as <tt>open</tt>, <tt>save</tt>, <tt>save as</tt>
- * and <tt>exit</tt>
- */
- QMenu * file_menu;
- /**
- * This menu provides some informations <tt>about</tt> the parameterGUI
- * and <tt>about Qt</tt>
- */
- QMenu * help_menu;
- /**
- * This menu provides context menu options for the active tree item.
- */
- QMenu * context_menu;
- /**
- * QAction <tt>open</tt> a file.
- */
- QAction * open_act;
- /**
- * QAction <tt>save</tt> a file.
- */
- QAction * save_act;
- /**
- * QAction <tt>save as</tt> a file.
- */
- QAction * save_as_act;
- /**
- * QAction <tt>save as</tt> a file.
- */
- QAction * settings_act;
- /**
- * QAction <tt>exit</tt> the GUI.
- */
- QAction * exit_act;
- /**
- * QAction <tt>about</tt> the parameterGUI.
- */
- QAction * about_act;
- /**
- * QAction <tt>about</tt> Qt.
- */
- QAction * about_qt_act;
- /**
- * QAction <tt>set_to_default</tt>.
- */
- QAction * set_to_default_act;
+ /** A tool button that allows to toggle between showing/hiding parameters
+ * with default values.
+ */
+ QToolButton *hide_default;
+ /**
+ * This menu provides all file actions as <tt>open</tt>, <tt>save</tt>, <tt>save as</tt>
+ * and <tt>exit</tt>
+ */
+ QMenu *file_menu;
+ /**
+ * This menu provides some informations <tt>about</tt> the parameterGUI
+ * and <tt>about Qt</tt>
+ */
+ QMenu *help_menu;
+ /**
+ * This menu provides context menu options for the active tree item.
+ */
+ QMenu *context_menu;
+ /**
+ * QAction <tt>open</tt> a file.
+ */
+ QAction *open_act;
+ /**
+ * QAction <tt>save</tt> a file.
+ */
+ QAction *save_act;
+ /**
+ * QAction <tt>save as</tt> a file.
+ */
+ QAction *save_as_act;
+ /**
+ * QAction <tt>save as</tt> a file.
+ */
+ QAction *settings_act;
+ /**
+ * QAction <tt>exit</tt> the GUI.
+ */
+ QAction *exit_act;
+ /**
+ * QAction <tt>about</tt> the parameterGUI.
+ */
+ QAction *about_act;
+ /**
+ * QAction <tt>about</tt> Qt.
+ */
+ QAction *about_qt_act;
+ /**
+ * QAction <tt>set_to_default</tt>.
+ */
+ QAction *set_to_default_act;
- /**
- * This value stores the current <tt>filename</tt> we work on.
- */
- QString current_file;
- /**
- * This dialog shows a short information message after loading a file.
- */
- InfoMessage * info_message;
+ /**
+ * This value stores the current <tt>filename</tt> we work on.
+ */
+ QString current_file;
+ /**
+ * This dialog shows a short information message after loading a file.
+ */
+ InfoMessage *info_message;
- SettingsDialog * settings_dialog;
+ SettingsDialog *settings_dialog;
- /**
- * An object for storing user settings.
- */
- QSettings * gui_settings;
+ /**
+ * An object for storing user settings.
+ */
+ QSettings *gui_settings;
};
}
-/**@}*/
+ /**@}*/
}
namespace dealii
{
-/*! @addtogroup ParameterGui
- *@{
- */
+ /*! @addtogroup ParameterGui
+ *@{
+ */
namespace ParameterGui
{
-/**
- * The ParameterDelegate class implements special delegates for the QTreeWidget class used in the parameterGUI.
- * The QTreeWidget class provides some different standard delegates for editing parameters shown in the
- * tree structure. The ParameterDelegate class provides special editors for the different types of parameters defined in
- * the ParameterHandler class. For all parameter types based on strings as "Anything", "MultipleSelection" "Map" and
- * "List" a simple line editor will be shown up. In the case of integer and double type parameters the editor is a spin box and for
- * "Selection" type parameters a combo box will be shown up. For parameters of type "FileName" and "DirectoryName"
- * the delegate shows a @ref BrowseLineEdit editor. The column of the tree structure with the parameter values has to be set
- * in the constructor.
- *
- * @note This class is used in the graphical user interface for the @ref ParameterHandler class.
- * It is not compiled into the deal.II libraries and can not be used by applications using deal.II.
- *
- * @ingroup ParameterGui
- * @author Martin Steigemann, Wolfgang Bangerth, 2010
- */
+ /**
+ * The ParameterDelegate class implements special delegates for the QTreeWidget class used in the parameterGUI.
+ * The QTreeWidget class provides some different standard delegates for editing parameters shown in the
+ * tree structure. The ParameterDelegate class provides special editors for the different types of parameters defined in
+ * the ParameterHandler class. For all parameter types based on strings as "Anything", "MultipleSelection" "Map" and
+ * "List" a simple line editor will be shown up. In the case of integer and double type parameters the editor is a spin box and for
+ * "Selection" type parameters a combo box will be shown up. For parameters of type "FileName" and "DirectoryName"
+ * the delegate shows a @ref BrowseLineEdit editor. The column of the tree structure with the parameter values has to be set
+ * in the constructor.
+ *
+ * @note This class is used in the graphical user interface for the @ref ParameterHandler class.
+ * It is not compiled into the deal.II libraries and can not be used by applications using deal.II.
+ *
+ * @ingroup ParameterGui
+ * @author Martin Steigemann, Wolfgang Bangerth, 2010
+ */
class ParameterDelegate : public QItemDelegate
{
Q_OBJECT
- public:
- /**
- * Constructor, @p value_column specifies the column
- * of the parameter tree this delegate will be used on.
- */
- ParameterDelegate (const int value_column, QObject *parent = 0);
- /**
- * This function creates the appropriate editor for the parameter
- * based on the <tt>index</tt>.
- */
- QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option,
- const QModelIndex &index) const;
- /**
- * Reimplemented from QItemDelegate.
- */
- QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
- /**
- * Reimplemented from QItemDelegate.
- */
- void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
- /**
- * Reimplemented from QItemDelegate.
- */
- void setEditorData(QWidget *editor, const QModelIndex &index) const;
- /**
- * Reimplemented from QItemDelegate.
- */
- void setModelData(QWidget *editor, QAbstractItemModel *model,
- const QModelIndex &index) const;
+ public:
+ /**
+ * Constructor, @p value_column specifies the column
+ * of the parameter tree this delegate will be used on.
+ */
+ ParameterDelegate (const int value_column, QObject *parent = 0);
+ /**
+ * This function creates the appropriate editor for the parameter
+ * based on the <tt>index</tt>.
+ */
+ QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
+ const QModelIndex &index) const;
+ /**
+ * Reimplemented from QItemDelegate.
+ */
+ QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
+ /**
+ * Reimplemented from QItemDelegate.
+ */
+ void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
+ /**
+ * Reimplemented from QItemDelegate.
+ */
+ void setEditorData(QWidget *editor, const QModelIndex &index) const;
+ /**
+ * Reimplemented from QItemDelegate.
+ */
+ void setModelData(QWidget *editor, QAbstractItemModel *model,
+ const QModelIndex &index) const;
- private slots:
- /**
- * Reimplemented from QItemDelegate.
- */
- void commit_and_close_editor();
+ private slots:
+ /**
+ * Reimplemented from QItemDelegate.
+ */
+ void commit_and_close_editor();
- private:
- /**
- * The column this delegate will be used on.
- */
- int value_column;
+ private:
+ /**
+ * The column this delegate will be used on.
+ */
+ int value_column;
};
}
-/**@}*/
+ /**@}*/
}
namespace dealii
{
-/*! @addtogroup ParameterGui
- *@{
- */
+ /*! @addtogroup ParameterGui
+ *@{
+ */
namespace ParameterGui
{
-/**
- * The PRMParameterWriter class provides an interface to write parameters
- * stored in a QTreeWidget to a file in deal.II's PRM format.
- * This class only writes parameters that deviate from their default values to
- * improve the readability of the created file.
- *
- * @note This class is used in the graphical user interface for the
- * @ref ParameterHandler class.
- * It is not compiled into the deal.II libraries and can not be used by
- * applications using deal.II.
- *
- * @ingroup ParameterGui
- * @author Rene Gassmoeller, 2017
- */
+ /**
+ * The PRMParameterWriter class provides an interface to write parameters
+ * stored in a QTreeWidget to a file in deal.II's PRM format.
+ * This class only writes parameters that deviate from their default values to
+ * improve the readability of the created file.
+ *
+ * @note This class is used in the graphical user interface for the
+ * @ref ParameterHandler class.
+ * It is not compiled into the deal.II libraries and can not be used by
+ * applications using deal.II.
+ *
+ * @ingroup ParameterGui
+ * @author Rene Gassmoeller, 2017
+ */
class PRMParameterWriter
{
- public:
- /**
- * Constructor.
- * Parameter values from @p tree_widget will be written.
- */
- PRMParameterWriter (QTreeWidget *tree_widget);
+ public:
+ /**
+ * Constructor.
+ * Parameter values from @p tree_widget will be written.
+ */
+ PRMParameterWriter (QTreeWidget *tree_widget);
- /**
- * This function writes the parameter values stored in <tt>tree_widget</tt>
- * to @p device in the PRM format.
- */
- bool write_prm_file (QIODevice *device);
+ /**
+ * This function writes the parameter values stored in <tt>tree_widget</tt>
+ * to @p device in the PRM format.
+ */
+ bool write_prm_file (QIODevice *device);
- private:
- /**
- * This function creates a string that corresponds to the data written
- * to a prm file for a given @p item of <tt>tree_widget</tt>.
- * If the @p item is a parameter it is only written if its value differs
- * from its default value. If the @p item is a subsection, a start element
- * <code>subsection</code> is written and <tt>write_item</tt> is called
- * recursively to write the next <tt>item</tt>.
- * If no items in this subsection differ from their default values then
- * the subsection is not written.
- * @p indentation_level describes the level the current item belongs to.
- * 0 describes a top level item and each subsection increases the level
- * by one.
- *
- */
- QString item_to_string (const QTreeWidgetItem *item,
- const unsigned int indentation_level);
+ private:
+ /**
+ * This function creates a string that corresponds to the data written
+ * to a prm file for a given @p item of <tt>tree_widget</tt>.
+ * If the @p item is a parameter it is only written if its value differs
+ * from its default value. If the @p item is a subsection, a start element
+ * <code>subsection</code> is written and <tt>write_item</tt> is called
+ * recursively to write the next <tt>item</tt>.
+ * If no items in this subsection differ from their default values then
+ * the subsection is not written.
+ * @p indentation_level describes the level the current item belongs to.
+ * 0 describes a top level item and each subsection increases the level
+ * by one.
+ *
+ */
+ QString item_to_string (const QTreeWidgetItem *item,
+ const unsigned int indentation_level);
- /**
- * A pointer to the QTreeWidget structure
- * which stores the parameters.
- */
- QTreeWidget * tree_widget;
+ /**
+ * A pointer to the QTreeWidget structure
+ * which stores the parameters.
+ */
+ QTreeWidget *tree_widget;
};
}
-/**@}*/
+ /**@}*/
}
namespace dealii
{
-/*! @addtogroup ParameterGui
- *@{
- */
+ /*! @addtogroup ParameterGui
+ *@{
+ */
namespace ParameterGui
{
-/**
- * The SettingsDialog class implements a settings dialog for the parameterGUI.
- * The dialog shows all available settings, and when the user clicks on 'OK'
- * stores them in the QSettings object handed over in the constructor (which
- * in turn stores them on disk to allow persistent settings).
- *
- * @ingroup ParameterGui
- * @author Rene Gassmoeller, 2017
- */
+ /**
+ * The SettingsDialog class implements a settings dialog for the parameterGUI.
+ * The dialog shows all available settings, and when the user clicks on 'OK'
+ * stores them in the QSettings object handed over in the constructor (which
+ * in turn stores them on disk to allow persistent settings).
+ *
+ * @ingroup ParameterGui
+ * @author Rene Gassmoeller, 2017
+ */
class SettingsDialog : public QDialog
{
Q_OBJECT
- public:
+ public:
/**
* Constructor
*/
SettingsDialog (QSettings *settings,
QWidget *parent = 0);
- public slots:
+ public slots:
/**
* Function that displays a font selection dialog and stores the result.
*/
*/
void loadSettings();
- private:
+ private:
/**
* This variable stores if the default values should be hidden. This
* might seem duplicative, since it is also stored in <tt>settings</tt>,
/**
* The <tt>Ok</tt> button.
*/
- QPushButton * ok;
+ QPushButton *ok;
/**
* The <tt>Cancel</tt> button.
*/
- QPushButton * cancel;
+ QPushButton *cancel;
/**
* The <tt>Change font</tt> button.
*/
- QPushButton * change_font;
+ QPushButton *change_font;
/**
* The checkbox<tt>Hide default values</tt>.
*/
- QCheckBox * hide_default;
+ QCheckBox *hide_default;
/**
* An object for storing <tt>settings</tt> in a file.
*/
- QSettings * settings;
+ QSettings *settings;
};
}
-/**@}*/
+ /**@}*/
}
namespace dealii
{
-/*! @addtogroup ParameterGui
- *@{
- */
+ /*! @addtogroup ParameterGui
+ *@{
+ */
namespace ParameterGui
{
-/**
- * The XMLParameterReader class provides an interface to parse parameters from XML files to a QTreeWidget.
- * This class makes extensive use of the QXmlStreamReader class, which implements the basic functionalities
- * for parsing XML files.
- *
- * @note This class is used in the graphical user interface for the @ref ParameterHandler class.
- * It is not compiled into the deal.II libraries and can not be used by applications using deal.II.
- *
- * @ingroup ParameterGui
- * @author Martin Steigemann, Wolfgang Bangerth, 2010
- */
+ /**
+ * The XMLParameterReader class provides an interface to parse parameters from XML files to a QTreeWidget.
+ * This class makes extensive use of the QXmlStreamReader class, which implements the basic functionalities
+ * for parsing XML files.
+ *
+ * @note This class is used in the graphical user interface for the @ref ParameterHandler class.
+ * It is not compiled into the deal.II libraries and can not be used by applications using deal.II.
+ *
+ * @ingroup ParameterGui
+ * @author Martin Steigemann, Wolfgang Bangerth, 2010
+ */
class XMLParameterReader
{
- public:
- /**
- * Constructor.
- * The parameter values will be stored in @p tree_widget.
- */
- XMLParameterReader (QTreeWidget *tree_widget);
- /**
- * This function reads the parameters from @p device into the <tt>tree_widget</tt>.
- * We use the QXmlStreamReader class for this.
- * There must be a start element
- * <code><ParameterHandler></code>
- * and an end element <code></ParameterHandler></code>
- * otherwise an exception is thrown.
- */
- bool read_xml_file (QIODevice *device);
- /**
- * This function returns an error message.
- */
- QString error_string () const;
+ public:
+ /**
+ * Constructor.
+ * The parameter values will be stored in @p tree_widget.
+ */
+ XMLParameterReader (QTreeWidget *tree_widget);
+ /**
+ * This function reads the parameters from @p device into the <tt>tree_widget</tt>.
+ * We use the QXmlStreamReader class for this.
+ * There must be a start element
+ * <code><ParameterHandler></code>
+ * and an end element <code></ParameterHandler></code>
+ * otherwise an exception is thrown.
+ */
+ bool read_xml_file (QIODevice *device);
+ /**
+ * This function returns an error message.
+ */
+ QString error_string () const;
- private:
- /**
- * This function implements a loop over the XML file
- * and parses XML elements. It calls @ref read_subsection_element
- * till the <code></ParameterHandler></code> element is found
- * or the end of the file is reached. In this case, an exception is thrown.
- */
- void parse_parameters ();
- /**
- * This functions parses a <tt>subsection</tt>.
- * and adds it as a child to @p parent.
- * If the next element is <code><value></code>,
- * this functions calls @ref read_parameter_element
- * otherwise the function itself recursively.
- */
- void read_subsection_element (QTreeWidgetItem *parent);
- /**
- * This function parses a <tt>parameter</tt> and
- * and adds it as a child to @p parent.
- * A <tt>parameter</tt> description consists of five elements:
- * @code
- * <value>value</value>
- * <default_value>default_value</default_value>
- * <documentation>documentation</documentation>
- * <pattern>pattern</pattern>
- * <pattern_description>[pattern_description]</pattern_description>
- * @endcode
- * If a <tt>parameter</tt> description is incomplete, an exception
- * is thrown.
- */
- void read_parameter_element (QTreeWidgetItem *parent);
- /**
- * Reimplemented from the @ref ParameterHandler class.
- * Unmangle a string @p s into its original form.
- */
- QString demangle (const QString &s);
- /**
- * This helper function creates a new child of @p item in the tree.
- */
- QTreeWidgetItem * create_child_item(QTreeWidgetItem *item);
- /**
- * The QXmlStreamReader object for reading XML elements.
- */
- QXmlStreamReader xml;
- /**
- * A pointer to the tree structure.
- */
- QTreeWidget * tree_widget;
- /**
- * An icon for subsections in the tree structure.
- */
- QIcon subsection_icon;
- /**
- * An icon for parameters in the tree structure.
- */
- QIcon parameter_icon;
+ private:
+ /**
+ * This function implements a loop over the XML file
+ * and parses XML elements. It calls @ref read_subsection_element
+ * till the <code></ParameterHandler></code> element is found
+ * or the end of the file is reached. In this case, an exception is thrown.
+ */
+ void parse_parameters ();
+ /**
+ * This functions parses a <tt>subsection</tt>.
+ * and adds it as a child to @p parent.
+ * If the next element is <code><value></code>,
+ * this functions calls @ref read_parameter_element
+ * otherwise the function itself recursively.
+ */
+ void read_subsection_element (QTreeWidgetItem *parent);
+ /**
+ * This function parses a <tt>parameter</tt> and
+ * and adds it as a child to @p parent.
+ * A <tt>parameter</tt> description consists of five elements:
+ * @code
+ * <value>value</value>
+ * <default_value>default_value</default_value>
+ * <documentation>documentation</documentation>
+ * <pattern>pattern</pattern>
+ * <pattern_description>[pattern_description]</pattern_description>
+ * @endcode
+ * If a <tt>parameter</tt> description is incomplete, an exception
+ * is thrown.
+ */
+ void read_parameter_element (QTreeWidgetItem *parent);
+ /**
+ * Reimplemented from the @ref ParameterHandler class.
+ * Unmangle a string @p s into its original form.
+ */
+ QString demangle (const QString &s);
+ /**
+ * This helper function creates a new child of @p item in the tree.
+ */
+ QTreeWidgetItem *create_child_item(QTreeWidgetItem *item);
+ /**
+ * The QXmlStreamReader object for reading XML elements.
+ */
+ QXmlStreamReader xml;
+ /**
+ * A pointer to the tree structure.
+ */
+ QTreeWidget *tree_widget;
+ /**
+ * An icon for subsections in the tree structure.
+ */
+ QIcon subsection_icon;
+ /**
+ * An icon for parameters in the tree structure.
+ */
+ QIcon parameter_icon;
};
}
-/**@}*/
+ /**@}*/
}
namespace dealii
{
-/*! @addtogroup ParameterGui
- *@{
- */
+ /*! @addtogroup ParameterGui
+ *@{
+ */
namespace ParameterGui
{
-/**
- * The XMLParameterWriter class provides an interface to write parameters stored in a QTreeWidget to a file in XML format.
- * This class makes extensive use of the QXmlStreamWriter class, which implements the basic functionalities for writing
- * XML files.
- *
- * @note This class is used in the graphical user interface for the @ref ParameterHandler class.
- * It is not compiled into the deal.II libraries and can not be used by applications using deal.II.
- *
- * @ingroup ParameterGui
- * @author Martin Steigemann, Wolfgang Bangerth, 2010
- */
+ /**
+ * The XMLParameterWriter class provides an interface to write parameters stored in a QTreeWidget to a file in XML format.
+ * This class makes extensive use of the QXmlStreamWriter class, which implements the basic functionalities for writing
+ * XML files.
+ *
+ * @note This class is used in the graphical user interface for the @ref ParameterHandler class.
+ * It is not compiled into the deal.II libraries and can not be used by applications using deal.II.
+ *
+ * @ingroup ParameterGui
+ * @author Martin Steigemann, Wolfgang Bangerth, 2010
+ */
class XMLParameterWriter
{
- public:
- /**
- * Constructor.
- * Parameter values from @p tree_widget will be written.
- */
- XMLParameterWriter (QTreeWidget *tree_widget);
- /**
- * This function writes the parameter values stored in <tt>tree_widget</tt>
- * to @p device in XML format. We use the QXmlStreamWriter class
- * for this. The root element is
- * <code><ParameterHandler></code>
- */
- bool write_xml_file (QIODevice *device);
+ public:
+ /**
+ * Constructor.
+ * Parameter values from @p tree_widget will be written.
+ */
+ XMLParameterWriter (QTreeWidget *tree_widget);
+ /**
+ * This function writes the parameter values stored in <tt>tree_widget</tt>
+ * to @p device in XML format. We use the QXmlStreamWriter class
+ * for this. The root element is
+ * <code><ParameterHandler></code>
+ */
+ bool write_xml_file (QIODevice *device);
- private:
- /**
- * This function writes a given @p item of <tt>tree_widget</tt>
- * to a file in XML format. For this the QXmlStreamWriter class is used.
- * If the @p item is a parameter, the elements that describes this parameter
- * are written:
- * @code
- * <value>value</value>
- * <default_value>default_value</default_value>
- * <documentation>documentation</documentation>
- * <pattern>pattern</pattern>
- * <pattern_description>[pattern_description]</pattern_description>
- * @endcode
- * If the @p item is a subsection, a start element <code>this_subsection</code> is written
- * and <tt>write_item</tt> is called recursively to write the next <tt>item</tt>.
- */
- void write_item (QTreeWidgetItem *item);
- /**
- * Reimplemented from the @ref ParameterHandler class.
- * Mangle a string @p s so that it
- * doesn't contain any special
- * characters or spaces.
- */
- QString mangle (const QString &s);
- /**
- * An QXmlStreamWriter object
- * which implements the functionalities
- * we need for writing parameters to XML files.
- */
- QXmlStreamWriter xml;
- /**
- * A pointer to the QTreeWidget structure
- * which stores the parameters.
- */
- QTreeWidget * tree_widget;
+ private:
+ /**
+ * This function writes a given @p item of <tt>tree_widget</tt>
+ * to a file in XML format. For this the QXmlStreamWriter class is used.
+ * If the @p item is a parameter, the elements that describes this parameter
+ * are written:
+ * @code
+ * <value>value</value>
+ * <default_value>default_value</default_value>
+ * <documentation>documentation</documentation>
+ * <pattern>pattern</pattern>
+ * <pattern_description>[pattern_description]</pattern_description>
+ * @endcode
+ * If the @p item is a subsection, a start element <code>this_subsection</code> is written
+ * and <tt>write_item</tt> is called recursively to write the next <tt>item</tt>.
+ */
+ void write_item (QTreeWidgetItem *item);
+ /**
+ * Reimplemented from the @ref ParameterHandler class.
+ * Mangle a string @p s so that it
+ * doesn't contain any special
+ * characters or spaces.
+ */
+ QString mangle (const QString &s);
+ /**
+ * An QXmlStreamWriter object
+ * which implements the functionalities
+ * we need for writing parameters to XML files.
+ */
+ QXmlStreamWriter xml;
+ /**
+ * A pointer to the QTreeWidget structure
+ * which stores the parameters.
+ */
+ QTreeWidget *tree_widget;
};
}
-/**@}*/
+ /**@}*/
}