|
|
MLABListViewItem * | itemForId (int id) |
|
QList< MLABListViewItem * > | topLevelItems () const |
|
MLABListViewItem * | firstItem () const |
|
MLABListViewItem * | firstChild () const |
|
MLABListViewItem * | lastItem () const |
|
void | ensureItemVisible (MLABListViewItem *item, bool positionAtCenter=false) |
|
MLABListViewItem * | selectedItem () const |
|
QList< MLABListViewItem * > | selectedItems () const |
|
void | resizeColumnsToContents () |
|
void | setSelected (MLABListViewItem *item, bool selected) |
|
bool | isSelected (MLABListViewItem *item) |
|
void | setAlternatingRowColors (bool enable) |
|
QVariantList | selectedItemIds () |
|
QVariantList | checkedItemIds () |
|
QList< MLABListViewItem * > | checkedItems () |
|
void | clearSelection () |
|
MLABListViewItem * | currentItem () const |
|
void | setCurrentItem (MLABListViewItem *item) |
|
void | setColumnAlignment (int column, Alignment alignment) |
|
void | setColumnWidth (int column, int w) |
|
void | setColumnPixmapFile (int column, const QString &file) |
|
void | setColumnText (int column, const QString &text) |
|
QString | columnText (int column) |
|
void | setSorting (int column, bool ascending) |
|
int | sortColumn () const |
|
bool | isSortOrderAscending () const |
|
void | addColumn (const QString &label) |
|
void | removeColumn (int idx) |
|
int | columnCount () |
|
void | hideColumn (int column) |
|
void | showColumn (int column) |
|
bool | isColumnHidden (int column) |
|
void | removeColumns () |
|
void | clearItems () |
|
void | removeItem (MLABListViewItem *item) |
|
MLABListViewItem * | appendItem (const QStringList &texts=QStringList()) |
|
MLABListViewItem * | appendItem (MLABListViewItem *parent, const QStringList &texts=QStringList()) |
|
MLABListViewItem * | insertItem () |
|
MLABListViewItem * | insertItem (MLABListViewItem *after) |
|
MLABListViewItem * | insertItem (const QStringList &texts) |
|
MLABListViewItem * | insertItem (MLABListViewItem *after, const QStringList &texts) |
|
MLABListViewItem * | insertItem (MLABListViewItem *parent, MLABListViewItem *after) |
|
MLABListViewItem * | insertItem (MLABListViewItem *parent, MLABListViewItem *after, const QStringList &texts) |
|
MLABListViewItem * | insertCheckBoxItem () |
|
MLABListViewItem * | insertRadioControllerItem () |
|
MLABListViewItem * | insertRadioItem (MLABListViewItem *after) |
|
MLABListViewItem * | insertCheckBoxItem (MLABListViewItem *after) |
|
MLABListViewItem * | insertRadioControllerItem (MLABListViewItem *after) |
|
MLABListViewItem * | insertRadioItem (MLABListViewItem *parent, MLABListViewItem *after) |
|
MLABListViewItem * | insertCheckBoxItem (MLABListViewItem *parent, MLABListViewItem *after) |
|
MLABListViewItem * | insertRadioControllerItem (MLABListViewItem *parent, MLABListViewItem *after) |
|
void | setRootIsDecorated (bool flag) |
|
void | setStringEditorValues (const QStringList &values, int flags=0) |
|
void | setItemFilter (int column, const QString &pattern, bool caseSensitive=true, bool keepParents=false) |
|
void | unsetItemFilter () |
|
void | setSizeHint (const QSize &size) override |
|
void | beginInsertItems (int itemCount) |
|
void | beginInsertItems (MLABListViewItem *parent, int itemCount) |
|
void | endInsertItems () |
|
void | adjustSize () |
|
virtual void | setEnabled (bool flag) |
|
virtual void | setVisible (bool flag) |
|
virtual bool | isVisible () |
|
virtual void | setFocus () |
|
virtual bool | hasFocus () |
|
virtual void | setToolTip (const QString &string) |
|
virtual void | setWhatsThis (const QString &string) |
|
void | displayWhatsThis () |
|
void | displayWhatsThis (const QString &text) |
|
virtual void | setTitle (const QString &) |
|
QWidget * | widget () |
|
QLayout * | layout () |
|
virtual QString | windowHandle () |
|
virtual bool | createScreenshot (const QString &filename, bool grabFromScreen=true, bool scaleToLowRes=false) |
|
bool | isReloadable () const |
|
void | reload (MLABTree *tree) |
|
QString | createGlobalScreenshot () |
|
QString | applicationName () |
|
QSize | size () |
|
int | width () |
|
int | height () |
|
int | minWidth () |
|
int | minHeight () |
|
int | maxWidth () |
|
int | maxHeight () |
|
virtual void | setMinWidth (int s) |
|
virtual void | setMinHeight (int s) |
|
void | setMaxWidth (int s) |
|
void | setMaxHeight (int s) |
|
QSize | sizeHint () |
|
QSize | minSize () |
|
QSize | maxSize () |
|
void | setMinSize (QSize size) |
|
void | setMaxSize (QSize size) |
|
void | updateLayout () |
|
int | windowID () |
|
MLABWidgetControl * | control (const QString &name) |
|
float | scaleFactor () |
|
MLABModule * | module () |
|
QString | getType () |
|
QString | getName () |
|
bool | acceptDrops () |
|
void | setAcceptDrops (bool flag) |
|
void | raiseWidget () |
|
void | setStyleSheetFromString (const QString &styleSheetText) |
|
void | setStyleSheetFromFile (const QString &styleSheetFileName) |
|
MLABTree * | tree () |
|
void | updateMaxSize () |
|
bool | expandX () |
|
bool | expandY () |
|
MLABTreePtr | getDefaultTagValues () const |
|
virtual bool | hasUncommittedChanges () const |
|
virtual void | applyUncommittedChanges () |
|
virtual void | revertUncommittedChanges () |
|
MLABField * | field () const |
|
ListView control.
Control for showing a ListView. It can be controlled and filled with content via a field or the values tag. If the items are filled via a given field or the value tag, the item ids are guaranteed to be numbered starting from 0 (without the header column).
ListView can also be controlled manually by using Scripting. It offers creation of any number of columns and creating/removing items on the fly. It also allows to create a tree view in the first column by using insertChildItem().
The interface to access content of individual items is given in MLABListViewItem.
Inserting and Adding Items
If the list view is filtered or sorted, then beginInsertItems() and endInsertItems() should be called before and after adding or inserting items. If they are not called, the filtering and sorting will not be immediately applied to the new items.
For more details see the Qt documentation of QAbstractItemModel::beginInsertRows().
Here is an example:
2 listView.beginInsertItems(3)
3 listView.appendItem([
"item0"])
4 listView.appendItem([
"item1"])
5 listView.appendItem([
"item2"])
6 listView.endInsertItems()
10 listView.beginInsertItems(parentItem, 2)
11 listView.appendItem(parentItem, [
"subitem0"])
12 listView.appendItem(parentItem, [
"subitem1"])
13 listView.endInsertItems()
18 listView.beginInsertItems(1)
19 parentItem = listView.appendItem([
"item0"])
20 listView.appendItem(parentItem, [
"subitem0"])
21 listView.appendItem(parentItem, [
"subitem0"])
22 listView.endInsertItems()
void MLABListViewControl::setItemFilter |
( |
int |
column, |
|
|
const QString & |
pattern, |
|
|
bool |
caseSensitive = true , |
|
|
bool |
keepParents = false |
|
) |
| |
|
slot |
Sets a filter for a special column (0..n) or all columns (-1): Only show items with a string value that matches the regular expression given by pattern.
The regular expression syntax is the default pattern syntax of Qt5: http://doc.qt.io/qt-5/qregexp.html. Operations like selecting items or making items visible/invisible will have no effect on items that are filtered away. The original item hierarchy that is accessed with parent(), firstChild(), nextSibling() and childCount() is not affected by filtering. Each call to setItemFilter will replace the previous filter. If keepParents is set, all parents of items that would make it through the filter also get through the filter, i.e. they are visible. But this may be an expensive recursive operation, especially for deeply nested trees, so handle with care.
void MLABListViewControl::setStringEditorValues |
( |
const QStringList & |
values, |
|
|
int |
flags = 0 |
|
) |
| |
|
slot |
Sets combo box values to use when editing string values - if the value list is empty, the normal line edit is used for editing.
This is only relevant for string values, not e.g. for numerical values which have their own editor. The flags parameter can be a combination (bit-ored) of the values EditorEditable and EditorCaseSensitive, which are defined on this control: EditorEditable defines whether the user can enter his/her own values (default is not editable), EditorCaseSensitive makes the automatic string completion case sensitive (default is case insensitive).