MeVisLab Scripting Reference
MLABListViewItem Class Reference

Inherits QObject.

Public Member Functions

CheckBox scripting access.
bool isCheckBox () const
 
bool isOn (int column=0) const
 
void setOn (bool flag)
 
void setCheckBoxOn (int column, bool flag)
 
void setAutomaticCheckBox (int column, bool flag=true)
 
Deprecated
void setOpen (bool flag)
 
bool isOpen () const
 
void setRenameEnabled (int column, bool flag)
 
bool isRenameEnabled (int column) const
 
void startRename (int column)
 

Scripting access.

QString text (int column) const
 
QStringList texts () const
 
void setText (int column, const QString &text)
 
void setTexts (const QStringList &list)
 
QVariant value (int column) const
 
QVariantList values () const
 
void setValue (int column, const QVariant &value)
 
void setValues (const QVariantList &list)
 
void setPixmapFile (int column, const QString &pixmapfile)
 
void setPixmap (int column, const QPixmap &pixmap)
 
bool hasPixmap (int column) const
 
QPixmap pixmap (int column) const
 
void setForegroundColor (int column, const QColor &c)
 
QColor foregroundColor (int column) const
 
void setBackgroundColor (int column, const QColor &c)
 
QColor backgroundColor (int column) const
 
void setBoldFont (int column, bool bold=true)
 
bool isBoldFont (int column)
 
void setItalicFont (int column, bool italic=true)
 
bool isItalicFont (int column)
 
void setRelativeFontSize (int column, int relSize)
 
void setToolTip (int column, const QString &toolTip)
 
QString toolTip (int column) const
 
void setUserData (const QVariant &data)
 
QVariant userData () const
 
int childCount () const
 
int numChildren () const
 
MLABListViewItemappendItem (const QStringList &texts)
 
MLABListViewIteminsertItem (MLABListViewItem *after, const QStringList &texts)
 
QList< MLABListViewItem * > children () const
 
MLABListViewItemfirstChild ()
 
MLABListViewItemnextSibling ()
 
MLABListViewItemparent ()
 
MLABListViewItemitemAbove ()
 
MLABListViewItemitemBelow ()
 
void setEnabled (bool b)
 
bool isEnabled () const
 
void setMultiLinesEnabled (bool b)
 
void setVisible (bool flag)
 
bool isVisible () const
 
void setExpanded (bool flag)
 
bool isExpanded () const
 
void setSelected (bool flag)
 
bool isSelected () const
 
void setEditable (int column, bool flag)
 
bool isEditable (int column) const
 
void startEditing (int column)
 
void showChildren (bool flag)
 
bool isFiltered () const
 
int id () const
 

Detailed Description

A single ListView item which contains texts and images for each column used in an MLABListViewControl.

New items can be created via the insertItem() and insertChildItem() methods. You can use MLABListViewItem::setUserData() to store any Python object as part of the list view items.

MDL reference: ListView

Each item has a unique id within the ListViewControl, which can be get via id().

Member Function Documentation

MLABListViewItem* MLABListViewItem::appendItem ( const QStringList &  texts)
slot

Appends a new child item to the end of the children list.

QColor MLABListViewItem::backgroundColor ( int  column) const
slot

Returns the background color for the column, is invalid if not set.

int MLABListViewItem::childCount ( ) const
slot

Returns the number of child items.

QList<MLABListViewItem*> MLABListViewItem::children ( ) const
slot

Returns a list of the direct children.

MLABListViewItem* MLABListViewItem::firstChild ( )
inlineslot

Returns first child if any, NULL otherwise.

QColor MLABListViewItem::foregroundColor ( int  column) const
slot

Returns the foreground color for the column, is invalid if not set.

bool MLABListViewItem::hasPixmap ( int  column) const
slot

Returns whether item has pixmap.

int MLABListViewItem::id ( ) const
inline

Returns a unique integer id for this item (unique in this list view).

MLABListViewItem* MLABListViewItem::insertItem ( MLABListViewItem after,
const QStringList &  texts 
)
slot

Inserts a new child item after the given item.

The after item needs to have this item as its parent.

bool MLABListViewItem::isBoldFont ( int  column)
slot

Returns if the font is bold.

bool MLABListViewItem::isCheckBox ( ) const
inline

Returns whether item is a check box or a radio item.

bool MLABListViewItem::isEditable ( int  column) const

Returns whether editing is enabled on the given column.

bool MLABListViewItem::isEnabled ( ) const
inlineslot

Returns whether item is enabled.

bool MLABListViewItem::isExpanded ( ) const

Returns whether item is expanded (when it has children).

bool MLABListViewItem::isFiltered ( ) const

Returns whether the item is filtered away by a filter set on the control with setItemFilter.

setVisible, setOpen, setSelected will have no effect, isVisible, isOpen and isSelected will return false.

bool MLABListViewItem::isItalicFont ( int  column)
slot

Returns if the font is italic.

bool MLABListViewItem::isOn ( int  column = 0) const

Returns the checked state of the check box.

bool MLABListViewItem::isOpen ( ) const
inline
bool MLABListViewItem::isRenameEnabled ( int  column) const
inline
bool MLABListViewItem::isSelected ( ) const

Returns whether item is selected.

bool MLABListViewItem::isVisible ( ) const

Returns whether the item is visible (doesn't mean its visible on the screen at all).

MLABListViewItem* MLABListViewItem::itemAbove ( )
slot

Returns visible item above this item (only works if this item is visible), NULL otherwise.

MLABListViewItem* MLABListViewItem::itemBelow ( )
slot

Returns visible item below this item (only works if this item is visible), NULL otherwise.

MLABListViewItem* MLABListViewItem::nextSibling ( )
inlineslot

Returns next sibling.

int MLABListViewItem::numChildren ( ) const
inlineslot

Returns the number of child items.

MLABListViewItem* MLABListViewItem::parent ( )
slot

Returns parent if any, NULL otherwise.

QPixmap MLABListViewItem::pixmap ( int  column) const
slot

Returns the pixmap at column.

void MLABListViewItem::setAutomaticCheckBox ( int  column,
bool  flag = true 
)

Makes given column an automatic check box representing its child item's check boxes in the same column.

A "partial" state may be displayed if child check boxes have different states. Clicking the check box will change its child item's states (as will a call to setOn or setCheckBoxOn).

Note: Because of their update behavior automatic check boxes will be slower if they have a lot of child items (quadratic behavior).

isOn will return whether any child item has a checked check box for automatic check boxes. The checkListItemChangedCommand will not be called for automatic check boxes, only for its children.

void MLABListViewItem::setBackgroundColor ( int  column,
const QColor &  c 
)
slot

Sets background color for the column.

Use the Color class as argument under JavaScript, QColor under Python.

void MLABListViewItem::setBoldFont ( int  column,
bool  bold = true 
)
slot

Sets the column to be displayed in bold font.

void MLABListViewItem::setCheckBoxOn ( int  column,
bool  flag 
)

Sets the checked state of the check box for any column (shows a new check box if there wasn't one yet).

void MLABListViewItem::setEditable ( int  column,
bool  flag 
)

Enables editing for given column of the item.

void MLABListViewItem::setEnabled ( bool  b)
slot

Enables the item (disabled items are grayed out).

void MLABListViewItem::setExpanded ( bool  flag)

Sets whether item is expanded (when it has children).

void MLABListViewItem::setForegroundColor ( int  column,
const QColor &  c 
)
slot

Sets foreground color for the column.

Use the Color class as argument under JavaScript, QColor under Python.

void MLABListViewItem::setItalicFont ( int  column,
bool  italic = true 
)
slot

Sets the column to be displayed in italic font.

void MLABListViewItem::setMultiLinesEnabled ( bool  b)

Enables multi line texts.

void MLABListViewItem::setOn ( bool  flag)

Sets the checked state of the check box.

void MLABListViewItem::setOpen ( bool  flag)
inline
void MLABListViewItem::setPixmap ( int  column,
const QPixmap &  pixmap 
)
slot

Sets pixmap from pixmap for column.

void MLABListViewItem::setPixmapFile ( int  column,
const QString &  pixmapfile 
)
slot

Sets a pixmap from file for column.

void MLABListViewItem::setRelativeFontSize ( int  column,
int  relSize 
)
slot

Sets the column to be displayed in a smaller/larger font, according to relSize.

A relative size of 0 means unchanged.

void MLABListViewItem::setRenameEnabled ( int  column,
bool  flag 
)
inline
void MLABListViewItem::setSelected ( bool  flag)

Sets whether item is selected.

void MLABListViewItem::setText ( int  column,
const QString &  text 
)
slot

Sets the text for column.

void MLABListViewItem::setTexts ( const QStringList &  list)
slot

Sets all texts from column 0 to n.

void MLABListViewItem::setToolTip ( int  column,
const QString &  toolTip 
)
slot

Sets the tool tip text for the column.

void MLABListViewItem::setUserData ( const QVariant &  data)
slot

Sets a user data object.

This can store any QVariant, even a Python object provided by the caller.

void MLABListViewItem::setValue ( int  column,
const QVariant &  value 
)
slot

Sets value for column - the value can be (practically) a string type or a numerical type.

void MLABListViewItem::setValues ( const QVariantList &  list)
slot

Sets all values from column 0 to n.

void MLABListViewItem::setVisible ( bool  flag)

Sets whether the item is visible.

void MLABListViewItem::showChildren ( bool  flag)

Shows/hides the children of this item (default is that items are shown, new items that are added are always shown).

This has the same effect as calling setVisible(flag) on each child item.

void MLABListViewItem::startEditing ( int  column)

Starts the editing by placing the cursor in the given column, only works if setEditable() was set to true for that column.

void MLABListViewItem::startRename ( int  column)
inline
QString MLABListViewItem::text ( int  column) const
slot

Returns the text for column.

QStringList MLABListViewItem::texts ( ) const
slot

Returns all texts from column 0 to n.

QString MLABListViewItem::toolTip ( int  column) const
slot

Returns the tool tip text for the column.

QVariant MLABListViewItem::userData ( ) const
slot

Returns user data object set by user.

QVariant MLABListViewItem::value ( int  column) const
slot

Returns value for column.

QVariantList MLABListViewItem::values ( ) const
slot

Returns all values from column 0 to n.