TableDialog class reference
[Model/View module]
Declaration
#include <QtLua/TableDialog>
namespace QtLua {
class TableDialog;
};
This class is a member of the QtLua namespace.
Description
This dialog class use the TableTreeModel or TableGridModel classes to enable display and edition of lua tables in QTreeView or QTableView widgets.
The dialog has some edition buttons depending on model edition attributes.
The QtLib lua library provides functions to invoke these dialogs from lua code.
See also TableTreeModel class and TableGridModel class.
Inheritance
Members
Type
- enum ViewType
Functions
- TableDialog(const Value &table, TableDialog::ViewType type, QAbstractItemModel *model = [...], int attr = [...], QWidget *parent = [...])
- float get_column_margin_factor() const
- QAbstractItemModel * get_model() const
- bool get_resize_on_expand() const
- QAbstractItemView * get_view() const
- void set_column_margin_factor(float cmf)
- void set_resize_on_expand(bool roe)
Protected function
- virtual QSize sizeHint() const
Static functions
- static void grid_table_dialog(QWidget *parent, const QString &title, const Value &table, TableGridModel::Attributes attr = [...], const Value::List *colkeys = [...], const Value::List *rowkeys = [...])
- static void tree_table_dialog(QWidget *parent, const QString &title, const Value &table, TableTreeModel::Attributes attr = [...])
- static void tree_tree_dialog(QWidget *parent, const QString &title, const Value &table, TableTreeModel::Attributes attr = [...])
Members detail
TableDialog(const Value &table, TableDialog::ViewType type, QAbstractItemModel *model = 0, int attr = 0, QWidget *parent = 0)
Create a table dialog.
Parameters list:
- table: lua table to expose
- type: dialog type
- model: mvc model to use, a default model is created if NULL.
- attr: model attributes, control display and edit options
Specify model and view to use for the TableDialog dialog
Identifier | Description |
---|---|
TreeTreeView | Use TableTreeModel with a QTreeView |
TreeTableView | Use TableTreeModel with a QTableView |
GridTableView | Use TableGridModel with a QTableView |
Get additionnal column width factor
QAbstractItemModel * get_model() const
Return pointer to model
Get current resize on expand state
QAbstractItemView * get_view() const
Return pointer to view
static void grid_table_dialog(QWidget *parent, const QString &title, const Value &table, TableGridModel::Attributes attr = TableGridModel::Attributes(), const Value::List *colkeys = 0, const Value::List *rowkeys = 0)
Shortcut function to display a modal lua table dialog. A TableGridModel model is used.
Parameters list:
- parent: parent widget
- title: dialog window title
- table: lua table to expose
- attr: model attributes, control display and edit options
- colkeys: list of lua value to use as column keys, use TableGridModel::fetch_all_column_keys if NULL.
- rowkeys: list of lua value to use as row keys, use TableGridModel::fetch_all_row_keys if NULL.
Set additionnal column width factor
Set keys column resize to content on node expand
virtual QSize sizeHint() const
This member access is protected.
static void tree_table_dialog(QWidget *parent, const QString &title, const Value &table, TableTreeModel::Attributes attr = TableTreeModel::Recursive)
Shortcut function to display a modal lua table dialog. A TableTreeModel model is used.
Parameters list:
- parent: parent widget
- title: dialog window title
- table: lua table to expose
- attr: model attributes, control display and edit options
static void tree_tree_dialog(QWidget *parent, const QString &title, const Value &table, TableTreeModel::Attributes attr = TableTreeModel::Recursive)
Shortcut function to display a modal lua table dialog. A TableTreeModel model is used.
Parameters list:
- parent: parent widget
- title: dialog window title
- table: lua table to expose
- attr: model attributes, control display and edit options