MeVisLab Scripting Reference
MLABListViewItem Class Reference

#include <mlabScriptListViewModel.h>

Inherits QObject.

Public Slots

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
 
void setSortData (int column, QVariant sortData)
 
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)
 

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

◆ appendItem

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

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

◆ backgroundColor

QColor MLABListViewItem::backgroundColor ( int column) const
slot

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

◆ childCount

int MLABListViewItem::childCount ( ) const
slot

Returns the number of child items.

◆ children

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

Returns a list of the direct children.

◆ firstChild

MLABListViewItem * MLABListViewItem::firstChild ( )
inlineslot

Returns first child if any, NULL otherwise.

◆ foregroundColor

QColor MLABListViewItem::foregroundColor ( int column) const
slot

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

◆ hasPixmap

bool MLABListViewItem::hasPixmap ( int column) const
slot

Returns whether item has pixmap.

◆ id

int MLABListViewItem::id ( ) const
inlineslot

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

◆ insertItem

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.

◆ isBoldFont

bool MLABListViewItem::isBoldFont ( int column)
slot

Returns if the font is bold.

◆ isCheckBox

bool MLABListViewItem::isCheckBox ( ) const
inlineslot

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

◆ isEditable

bool MLABListViewItem::isEditable ( int column) const
slot

Returns whether editing is enabled on the given column.

◆ isEnabled

bool MLABListViewItem::isEnabled ( ) const
inlineslot

Returns whether item is enabled.

◆ isExpanded

bool MLABListViewItem::isExpanded ( ) const
slot

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

◆ isFiltered

bool MLABListViewItem::isFiltered ( ) const
slot

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.

◆ isItalicFont

bool MLABListViewItem::isItalicFont ( int column)
slot

Returns if the font is italic.

◆ isOn

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

Returns the checked state of the check box.

◆ isOpen

bool MLABListViewItem::isOpen ( ) const
inlineslot

◆ isRenameEnabled

bool MLABListViewItem::isRenameEnabled ( int column) const
inlineslot

◆ isSelected

bool MLABListViewItem::isSelected ( ) const
slot

Returns whether item is selected.

◆ isVisible

bool MLABListViewItem::isVisible ( ) const
slot

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

◆ itemAbove

MLABListViewItem * MLABListViewItem::itemAbove ( )
slot

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

◆ itemBelow

MLABListViewItem * MLABListViewItem::itemBelow ( )
slot

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

◆ nextSibling

MLABListViewItem * MLABListViewItem::nextSibling ( )
inlineslot

Returns next sibling.

◆ numChildren

int MLABListViewItem::numChildren ( ) const
inlineslot

Returns the number of child items.

◆ parent

MLABListViewItem * MLABListViewItem::parent ( )
slot

Returns parent if any, NULL otherwise.

◆ pixmap

QPixmap MLABListViewItem::pixmap ( int column) const
slot

Returns the pixmap at column.

◆ setAutomaticCheckBox

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

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.

◆ setBackgroundColor

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

Sets background color for the column.

◆ setBoldFont

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

Sets the column to be displayed in bold font.

◆ setCheckBoxOn

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

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

◆ setEditable

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

Enables editing for given column of the item.

◆ setEnabled

void MLABListViewItem::setEnabled ( bool b)
slot

Enables the item (disabled items are grayed out).

◆ setExpanded

void MLABListViewItem::setExpanded ( bool flag)
slot

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

◆ setForegroundColor

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

Sets foreground color for the column.

◆ setItalicFont

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

Sets the column to be displayed in italic font.

◆ setMultiLinesEnabled

void MLABListViewItem::setMultiLinesEnabled ( bool b)
slot

Enables multi line texts.

◆ setOn

void MLABListViewItem::setOn ( bool flag)
slot

Sets the checked state of the check box.

◆ setOpen

void MLABListViewItem::setOpen ( bool flag)
inlineslot

◆ setPixmap

void MLABListViewItem::setPixmap ( int column,
const QPixmap & pixmap )
slot

Sets pixmap from pixmap for column.

◆ setPixmapFile

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

Sets a pixmap from file for column.

◆ setRelativeFontSize

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.

◆ setRenameEnabled

void MLABListViewItem::setRenameEnabled ( int column,
bool flag )
inlineslot

◆ setSelected

void MLABListViewItem::setSelected ( bool flag)
slot

Sets whether item is selected.

◆ setSortData

void MLABListViewItem::setSortData ( int column,
QVariant sortData )
inlineslot

Sets the data that is used when sorting the items. By default, if no sort data is set, the item text is used.

◆ setText

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

Sets the text for column.

◆ setTexts

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

Sets all texts from column 0 to n.

◆ setToolTip

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

Sets the tool tip text for the column.

◆ setUserData

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.

◆ setValue

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.

◆ setValues

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

Sets all values from column 0 to n.

◆ setVisible

void MLABListViewItem::setVisible ( bool flag)
slot

Sets whether the item is visible.

◆ showChildren

void MLABListViewItem::showChildren ( bool flag)
slot

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.

◆ startEditing

void MLABListViewItem::startEditing ( int column)
slot

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

◆ startRename

void MLABListViewItem::startRename ( int column)
inlineslot

◆ text

QString MLABListViewItem::text ( int column) const
slot

Returns the text for column.

◆ texts

QStringList MLABListViewItem::texts ( ) const
slot

Returns all texts from column 0 to n.

◆ toolTip

QString MLABListViewItem::toolTip ( int column) const
slot

Returns the tool tip text for the column.

◆ userData

QVariant MLABListViewItem::userData ( ) const
slot

Returns user data object set by user.

◆ value

QVariant MLABListViewItem::value ( int column) const
slot

Returns value for column.

◆ values

QVariantList MLABListViewItem::values ( ) const
slot

Returns all values from column 0 to n.