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  

Functions  

Protected function  

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

enum ViewType  

Specify model and view to use for the TableDialog dialog

IdentifierDescription
TreeTreeViewUse TableTreeModel with a QTreeView
TreeTableViewUse TableTreeModel with a QTableView
GridTableViewUse TableGridModel with a QTableView

float get_column_margin_factor() const  

Get additionnal column width factor

QAbstractItemModel * get_model() const  

Return pointer to model

bool get_resize_on_expand() const  

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.

void set_column_margin_factor(float cmf)  

Set additionnal column width factor

void set_resize_on_expand(bool roe)  

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

Valid XHTML 1.0 StrictGenerated by diaxen on Mon Aug 15 03:23:06 2011 using MkDoc