Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Public Types | Properties | Public Member Functions | Protected Slots | Protected Member Functions | Static Protected Member Functions | Protected Attributes
qMRMLColorModel Class Reference

#include <Libs/MRML/Widgets/qMRMLColorModel.h>

Inheritance diagram for qMRMLColorModel:
Inheritance graph
Collaboration diagram for qMRMLColorModel:
Collaboration graph

Public Types

enum  ItemDataRole { ColorEntryRole = Qt::UserRole, PointerRole, ColorRole }
typedef QAbstractItemModel Superclass


int checkableColumn
int colorColumn
int labelColumn
bool noneEnabled
int opacityColumn

Public Member Functions

int checkableColumn () const
int colorColumn () const
int colorFromIndex (const QModelIndex &index) const
int colorFromItem (QStandardItem *item) const
int colorFromName (const QString &name) const
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
QModelIndexList indexes (int color) const
QStandardItem * itemFromColor (int color, int column=0) const
int labelColumn () const
vtkMRMLColorNodemrmlColorNode () const
QString nameFromColor (int colorEntry) const
bool noneEnabled () const
int opacityColumn () const
QColor qcolorFromColor (int color) const
QColor qcolorFromIndex (const QModelIndex &nodeIndex) const
QColor qcolorFromItem (QStandardItem *nodeItem) const
 qMRMLColorModel (QObject *parent=nullptr)
void setCheckableColumn (int column)
void setColorColumn (int column)
void setLabelColumn (int column)
void setMRMLColorNode (vtkMRMLColorNode *node)
void setNoneEnabled (bool enable)
void setOpacityColumn (int column)
 ~qMRMLColorModel () override

Protected Slots

void onItemChanged (QStandardItem *item)
void onMRMLColorNodeModified (vtkObject *node)

Protected Member Functions

 qMRMLColorModel (qMRMLColorModelPrivate *pimpl, QObject *parent=nullptr)
virtual void updateColorFromItem (int color, QStandardItem *item)
virtual void updateItemFromColor (QStandardItem *item, int color, int column)
virtual void updateNode ()

Static Protected Member Functions

static void onMRMLNodeEvent (vtkObject *vtk_obj, unsigned long event, void *client_data, void *call_data)

Protected Attributes

QScopedPointer< qMRMLColorModelPrivate > d_ptr

Detailed Description

Definition at line 42 of file qMRMLColorModel.h.

Member Typedef Documentation

◆ Superclass

typedef QAbstractItemModel qMRMLColorModel::Superclass

Definition at line 73 of file qMRMLColorModel.h.

Member Enumeration Documentation

◆ ItemDataRole

ColorRole is an invivisble role that contains the true color (QColor) when Qt::DecorationRole contains a pixmap of the color.


Definition at line 79 of file qMRMLColorModel.h.

Property Documentation

◆ checkableColumn

int qMRMLColorModel::checkableColumn

The checkable column adds a checkbox for each entry. Note that the checkboxes are unlinked to the color table node. -1 by default

See also
checkableColumn(), setCheckableColumn(), colorColumn, labelColumn, opacityColumn

Definition at line 70 of file qMRMLColorModel.h.

◆ colorColumn

int qMRMLColorModel::colorColumn

The color column contains a Qt::DecorationRole with a pixmap of the color, the ColorRole with the color QColor, the colorName as Qt::TooltipRole 0 by default.

See also
colorColumn(), setColorColumn(), labelColumn, opacityColumn, checkableColumn

Definition at line 54 of file qMRMLColorModel.h.

◆ labelColumn

int qMRMLColorModel::labelColumn

The label column contains the colorName as Qt::DisplayRole. 1 by default.

See also
labelColumn(), setLabelColumn(), colorColumn, opacityColumn, checkableColumn

Definition at line 59 of file qMRMLColorModel.h.

◆ noneEnabled

bool qMRMLColorModel::noneEnabled

Definition at line 47 of file qMRMLColorModel.h.

◆ opacityColumn

int qMRMLColorModel::opacityColumn

The opacity column contains the color opacity as Qt::DisplayRole 2 by default.

See also
opacityColumn(), setOpacityColumn(), colorColumn, labelColumn, checkableColumn

Definition at line 64 of file qMRMLColorModel.h.

Constructor & Destructor Documentation

◆ qMRMLColorModel() [1/2]

qMRMLColorModel::qMRMLColorModel ( QObject *  parent = nullptr)

◆ ~qMRMLColorModel()

qMRMLColorModel::~qMRMLColorModel ( )

◆ qMRMLColorModel() [2/2]

qMRMLColorModel::qMRMLColorModel ( qMRMLColorModelPrivate *  pimpl,
QObject *  parent = nullptr 

Member Function Documentation

◆ checkableColumn()

int qMRMLColorModel::checkableColumn ( ) const

◆ colorColumn()

int qMRMLColorModel::colorColumn ( ) const

◆ colorFromIndex()

int qMRMLColorModel::colorFromIndex ( const QModelIndex &  index) const

Return the color entry associated to the index. -1 if the index is not in the model.

See also
colorFromItem(), nameFromColor(), colorFromName()

Definition at line 155 of file qMRMLColorModel.h.

◆ colorFromItem()

int qMRMLColorModel::colorFromItem ( QStandardItem *  item) const

Return the color entry associated to the item. -1 if the item is not in the model.

See also
colorFromIndex(), nameFromColor(), colorFromName()

◆ colorFromName()

int qMRMLColorModel::colorFromName ( const QString &  name) const

Return the color entry of the first color with name name.

See also
nameFromColor(), colorFromIndex(), colorFromItem()

◆ headerData()

QVariant qMRMLColorModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const

Overload the header data method for the vertical header so that can return the color index rather than the row

◆ indexes()

QModelIndexList qMRMLColorModel::indexes ( int  color) const

◆ itemFromColor()

QStandardItem* qMRMLColorModel::itemFromColor ( int  color,
int  column = 0 
) const

◆ labelColumn()

int qMRMLColorModel::labelColumn ( ) const

◆ mrmlColorNode()

vtkMRMLColorNode* qMRMLColorModel::mrmlColorNode ( ) const

◆ nameFromColor()

QString qMRMLColorModel::nameFromColor ( int  colorEntry) const

Return the name of the color colorEntry

See also
colorFromName(), colorFromIndex(), colorFromItem()

◆ noneEnabled()

bool qMRMLColorModel::noneEnabled ( ) const

◆ onItemChanged

void qMRMLColorModel::onItemChanged ( QStandardItem *  item)

◆ onMRMLColorNodeModified

void qMRMLColorModel::onMRMLColorNodeModified ( vtkObject *  node)

◆ onMRMLNodeEvent()

static void qMRMLColorModel::onMRMLNodeEvent ( vtkObject *  vtk_obj,
unsigned long  event,
void *  client_data,
void *  call_data 

◆ opacityColumn()

int qMRMLColorModel::opacityColumn ( ) const

◆ qcolorFromColor()

QColor qMRMLColorModel::qcolorFromColor ( int  color) const

◆ qcolorFromIndex()

QColor qMRMLColorModel::qcolorFromIndex ( const QModelIndex &  nodeIndex) const

Definition at line 161 of file qMRMLColorModel.h.

◆ qcolorFromItem()

QColor qMRMLColorModel::qcolorFromItem ( QStandardItem *  nodeItem) const

Definition at line 167 of file qMRMLColorModel.h.

◆ setCheckableColumn()

void qMRMLColorModel::setCheckableColumn ( int  column)

◆ setColorColumn()

void qMRMLColorModel::setColorColumn ( int  column)

◆ setLabelColumn()

void qMRMLColorModel::setLabelColumn ( int  column)

◆ setMRMLColorNode()

void qMRMLColorModel::setMRMLColorNode ( vtkMRMLColorNode node)

◆ setNoneEnabled()

void qMRMLColorModel::setNoneEnabled ( bool  enable)

Set/Get NoneEnabled flags An additional item is added into the menu list, where the user can select "None".

◆ setOpacityColumn()

void qMRMLColorModel::setOpacityColumn ( int  column)

◆ updateColorFromItem()

virtual void qMRMLColorModel::updateColorFromItem ( int  color,
QStandardItem *  item 

◆ updateItemFromColor()

virtual void qMRMLColorModel::updateItemFromColor ( QStandardItem *  item,
int  color,
int  column 

◆ updateNode()

virtual void qMRMLColorModel::updateNode ( )

Member Data Documentation

◆ d_ptr

QScopedPointer<qMRMLColorModelPrivate> qMRMLColorModel::d_ptr

Definition at line 147 of file qMRMLColorModel.h.

The documentation for this class was generated from the following file: