MLABListViewControl Class Reference
[GUI ControlsCommon GUI Controls]

ListView control. More...

Inherits MLABSimpleWidgetControl.

List of all members.

Public Types

enum  EditorFlags

Public Slots

Scripting access
void addColumn (const QString &label)
QVariantList checkedItemIds ()
void clearItems ()
void clearSelection ()
int columnCount ()
QString columnText (int column)
MLABScriptListViewItemcurrentItem () const
void ensureItemVisible (MLABScriptListViewItem *item)
MLABScriptListViewItemfirstChild ()
MLABScriptListViewItemfirstItem ()
void hideColumn (int column)
MLABScriptListViewIteminsertCheckBoxItem (MLABScriptListViewItem *parent, MLABScriptListViewItem *after)
MLABScriptListViewIteminsertCheckBoxItem (MLABScriptListViewItem *after)
MLABScriptListViewIteminsertCheckBoxItem ()
MLABScriptListViewIteminsertItem (MLABScriptListViewItem *parent, MLABScriptListViewItem *after, const QStringList &texts)
MLABScriptListViewIteminsertItem (MLABScriptListViewItem *parent, MLABScriptListViewItem *after)
MLABScriptListViewIteminsertItem (MLABScriptListViewItem *after, const QStringList &texts)
MLABScriptListViewIteminsertItem (const QStringList &texts)
MLABScriptListViewIteminsertItem (MLABScriptListViewItem *after)
MLABScriptListViewIteminsertItem ()
MLABScriptListViewIteminsertRadioControllerItem (MLABScriptListViewItem *parent, MLABScriptListViewItem *after)
MLABScriptListViewIteminsertRadioControllerItem (MLABScriptListViewItem *after)
MLABScriptListViewIteminsertRadioControllerItem ()
MLABScriptListViewIteminsertRadioItem (MLABScriptListViewItem *parent, MLABScriptListViewItem *after)
MLABScriptListViewIteminsertRadioItem (MLABScriptListViewItem *after)
bool isColumnHidden (int column)
bool isSelected (MLABScriptListViewItem *item)
bool isSortOrderAscending () const
MLABScriptListViewItemitemForId (int id)
MLABScriptListViewItemlastItem ()
void removeColumn (int idx)
void removeColumns ()
void removeItem (MLABScriptListViewItem *item)
void resizeColumnsToContents ()
MLABScriptListViewItemselectedItem () const
QVariantList selectedItemIds ()
void setColumnPixmapFile (int column, const QString &file)
void setColumnText (int column, const QString &text)
void setColumnWidth (int column, int w)
void setCurrentItem (MLABScriptListViewItem *item)
void setItemFilter (int column, const QString &pattern, bool caseSensitive=true, bool keepParents=false)
void setRootIsDecorated (bool flag)
void setSelected (MLABScriptListViewItem *item, bool selected)
void setSorting (int column, bool ascending)
void setStringEditorValues (const QStringList &values, int flags=0)
void showColumn (int column)
int sortColumn () const
void unsetItemFilter ()


Detailed Description

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 MLABScriptListViewItem


Member Enumeration Documentation

These flags can be used with setStringEditorValues().


Member Function Documentation

void MLABListViewControl::addColumn ( const QString &  label  )  [slot]

add a column

QVariantList MLABListViewControl::checkedItemIds (  )  [slot]

returns list of checked items ids the individual items can then be get via itemForId()

void MLABListViewControl::clearItems (  )  [slot]

clear all items

void MLABListViewControl::clearSelection (  )  [slot]

clear current selection

int MLABListViewControl::columnCount (  )  [slot]

return number of columns currently defined

QString MLABListViewControl::columnText ( int  column  )  [slot]

get the text for given column

MLABScriptListViewItem* MLABListViewControl::currentItem (  )  const [slot]

get the current item (in single selection mode, current item and selected item are the same)

void MLABListViewControl::ensureItemVisible ( MLABScriptListViewItem item  )  [slot]

make sure that the item is visible

MLABScriptListViewItem* MLABListViewControl::firstChild (  )  [slot]

get the first child in the listview (the logical first item, not the one by the sorting order)

MLABScriptListViewItem* MLABListViewControl::firstItem (  )  [slot]

get the first child in the listview (the logical first item, not the one by the sorting order)

void MLABListViewControl::hideColumn ( int  column  )  [slot]

make column invisible, e.g. for sorting purposes

MLABScriptListViewItem* MLABListViewControl::insertCheckBoxItem ( MLABScriptListViewItem parent,
MLABScriptListViewItem after 
) [slot]

insert a checkbox item behind the after item of parent (if after is null, item is first in list)

make sure that after is a child of parent, otherwise an error occurs!

MLABScriptListViewItem* MLABListViewControl::insertCheckBoxItem ( MLABScriptListViewItem after  )  [slot]

insert a checkbox item after given item (or as first item if after is null)

MLABScriptListViewItem* MLABListViewControl::insertCheckBoxItem (  )  [slot]

insert a checkbox item as first list item

MLABScriptListViewItem* MLABListViewControl::insertItem ( MLABScriptListViewItem parent,
MLABScriptListViewItem after,
const QStringList &  texts 
) [slot]

inserts a new child item after given item (or as first child if after is null), with given texts

make sure that after is a child of parent, otherwise an error occurs!

MLABScriptListViewItem* MLABListViewControl::insertItem ( MLABScriptListViewItem parent,
MLABScriptListViewItem after 
) [slot]

inserts a new child item after given item (or as first child if after is null)

make sure that after is a child of parent, otherwise an error occurs

MLABScriptListViewItem* MLABListViewControl::insertItem ( MLABScriptListViewItem after,
const QStringList &  texts 
) [slot]

create a new item with given texts after the given item (if after is null, the new item is the first in the list)

if after has a parent item, the new item is also a child item of that parent

MLABScriptListViewItem* MLABListViewControl::insertItem ( const QStringList &  texts  )  [slot]

create a new item with given texts at the beginning of the list

MLABScriptListViewItem* MLABListViewControl::insertItem ( MLABScriptListViewItem after  )  [slot]

insert a new item after the given item (if after is null, the new item is the first in the list)

if after has a parent item, the new item is also a child item of that parent

MLABScriptListViewItem* MLABListViewControl::insertItem (  )  [slot]

insert a new item at the beginning of the list

MLABScriptListViewItem* MLABListViewControl::insertRadioControllerItem ( MLABScriptListViewItem parent,
MLABScriptListViewItem after 
) [slot]

insert a radio controller item behind the after item of parent (if after is null, item is first in list)

make sure that after is a child of parent, otherwise an error occurs!

MLABScriptListViewItem* MLABListViewControl::insertRadioControllerItem ( MLABScriptListViewItem after  )  [slot]

insert a radio controller item after given item (or as first item if after is null)

MLABScriptListViewItem* MLABListViewControl::insertRadioControllerItem (  )  [slot]

insert a radio controller as first list item

MLABScriptListViewItem* MLABListViewControl::insertRadioItem ( MLABScriptListViewItem parent,
MLABScriptListViewItem after 
) [slot]

insert a radio item behind the after item of parent (if after is null, item is first in list)

make sure that after is a child of parent, otherwise an error occurs

MLABScriptListViewItem* MLABListViewControl::insertRadioItem ( MLABScriptListViewItem after  )  [slot]

insert a checkbox item after given item

must be put into a radio controller to work

bool MLABListViewControl::isColumnHidden ( int  column  )  [slot]

check if a column is hidden

bool MLABListViewControl::isSelected ( MLABScriptListViewItem item  )  [slot]

return if item is selected

bool MLABListViewControl::isSortOrderAscending (  )  const [slot]

return if the current sort order is ascending, undefined if sortColumn is -1

MLABScriptListViewItem* MLABListViewControl::itemForId ( int  id  )  [slot]

get item for given integer id (id can be get from an item with the id() method)

MLABScriptListViewItem* MLABListViewControl::lastItem (  )  [slot]

get the last child in the listview (expensive, because it needs to search the whole list!)

void MLABListViewControl::removeColumn ( int  idx  )  [slot]

remove column

void MLABListViewControl::removeColumns (  )  [slot]

clear all columns

void MLABListViewControl::removeItem ( MLABScriptListViewItem item  )  [slot]

remove the given item (being a normal item or child item) and all its children if any

void MLABListViewControl::resizeColumnsToContents (  )  [slot]

resizes all columns to their contents

MLABScriptListViewItem* MLABListViewControl::selectedItem (  )  const [slot]

get selected item (in single selection mode this is identical with currentItem(), otherwise always null)

QVariantList MLABListViewControl::selectedItemIds (  )  [slot]

returns list of selected items ids (especially useful for multiple selection) the individual items can then be get via itemForId()

Example:

    var ids = list.selectedItemIds();
    for (i = 0; i<ids.length; i++) {
    item = list.itemForId(ids[i]);
    }

void MLABListViewControl::setColumnPixmapFile ( int  column,
const QString &  file 
) [slot]

set the column pixmap for this file

void MLABListViewControl::setColumnText ( int  column,
const QString &  text 
) [slot]

set the text for given column

void MLABListViewControl::setColumnWidth ( int  column,
int  w 
) [slot]

set the column width for given column

void MLABListViewControl::setCurrentItem ( MLABScriptListViewItem item  )  [slot]

set the current item

void MLABListViewControl::setItemFilter ( int  column,
const QString &  pattern,
bool  caseSensitive = true,
bool  keepParents = false 
) [slot]

Set 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 Qt4: <http://doc.trolltech.com/4.6/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::setRootIsDecorated ( bool  flag  )  [slot]

set if root is decorated (for tree views)

void MLABListViewControl::setSelected ( MLABScriptListViewItem item,
bool  selected 
) [slot]

select an item

void MLABListViewControl::setSorting ( int  column,
bool  ascending 
) [slot]

set the sorting column to use, -1 means no sorting

void MLABListViewControl::setStringEditorValues ( const QStringList &  values,
int  flags = 0 
) [slot]

Set 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 if the user can enter his/her own values (default is not editable), EditorCaseSensitive makes the automatic string completion case sensitive (default is case insensitive).

void MLABListViewControl::showColumn ( int  column  )  [slot]

show column again

int MLABListViewControl::sortColumn (  )  const [slot]

get the current sort column, -1 if not sorted by column

void MLABListViewControl::unsetItemFilter (  )  [slot]

This will unset a filter previously set with setItemFilter.


Generated on Sat Sep 3 18:38:02 2011 for MeVisLab Scripting Reference by  doxygen 1.5.8