CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
CFxUITreeView Class Reference

#include <FxUITreeView.h>

Inheritance diagram for CFxUITreeView:
CFxUIBaseView CFxUIObject

Public Types

enum  UIHeaderAlignment {
  AlignLeft = 0x0001 , AlignRight = 0x0002 , AlignHCenter = 0x0004 , AlignTop = 0x0020 ,
  AlignBottom = 0x0040 , AlignVCenter = 0x0080
}
 
enum  UISelectionBehavior { SelectItems , SelectRows , SelectColumns }
 
enum  UISelectionMode {
  NoSelection , SingleSelection , MultiSelection , ExtendedSelection ,
  ContiguousSelection
}
 
enum  UIHeaderResizeMode {
  Interactive , Stretch , Fixed , ResizeToContents ,
  Custom = Fixed
}
 
enum  UISelectionFlag {
  NoUpdate = 0x0000 , Clear = 0x0001 , Select = 0x0002 , Deselect = 0x0004 ,
  Rows = 0x0020 , Columns = 0x0040 , ClearAndSelect = Clear | Select
}
 
- Public Types inherited from CFxUIBaseView
enum  TextAlignment {
  AlignLeft = 0x0001 , AlignRight = 0x0002 , AlignHCenter = 0x0004 , AlignJustify = 0x0008 ,
  AlignTop = 0x0020 , AlignBottom = 0x0040 , AlignVCenter = 0x0080 , AlignBaseline = 0x0100 ,
  AlignCenter = AlignVCenter | AlignHCenter
}
 
enum  FocusPolicyType {
  eNoFocus = 0 , eTabFocus = 0x1 , eClickFocus = 0x2 , eStrongFocus = eTabFocus | eClickFocus | 0x8 ,
  eWheelFocus = eStrongFocus | 0x4 , eKeyboardOnSetfocus = 0x10
}
 
enum  UIWidthSizePolicy {
  eExpanding = -1 , eXS = 0 , eS , eM ,
  eL , eXL
}
 

Public Member Functions

 CFxUITreeView ()
 
 ~CFxUITreeView ()
 
void setParentNodeIcon (const CFxUIIcon &icon)
 
void setChildNodeIcon (const CFxUIIcon &icon)
 
void setMoveCursorMode (bool bItemMode)
 
void setHeaderAlignment (CFxUITreeView::UIHeaderAlignment align)
 
void setHeaderResizeSection (CFxUITreeView::UIHeaderResizeMode mode, int iColumn)
 
void setHeaderResizeSection (CFxUITreeView::UIHeaderResizeMode mode)
 
void setHeaderStretchLastSection (bool bEnable)
 
void setSortingEnabled (bool bEnable)
 
void setSelectionBehavior (CFxUITreeView::UISelectionBehavior behavior)
 
void setSelectionMode (CFxUITreeView::UISelectionMode mode)
 
void setRootIsDecorated (bool bShow)
 
void setAlternatingRowColors (bool bEnable)
 
void setColumnWidth (int iColumn, int iWidth)
 
void setModel (CFxUIAbstractItemModel *model)
 
CFxUIAbstractItemModelgetModel ()
 
void setCurrentIndex (CFxUIModelIndex index)
 
CFxUIModelIndex currentIndex () const
 
void setAutoScroll (bool bEnable)
 
void setCollapse (CFxUIModelIndex index)
 
void setExpand (CFxUIModelIndex index)
 
void setColumnHidden (int iColumn, bool bHide)
 
void selectRow (CFxUITreeView::UISelectionFlag flag, CFxUIModelIndex index)
 
void clearSelection ()
 
void expandAll ()
 
void collapseAll ()
 
void setExpandsOnDoubleClick (bool bEnable)
 
CFxUISignal< void(const CFxUIModelIndex &)> & itemClicked ()
 
CFxUISignal< void(const CFxUIModelIndex &)> & itemDoubleClicked ()
 
CFxUISignal< void(void)> & selectionChanged ()
 
CFxUISignal< void(int, int) > & keyWentDown ()
 
CFxUISignal< void(const CFxUIModelIndex &)> & collapsed ()
 
CFxUISignal< void(const CFxUIModelIndex &)> & expanded ()
 
- Public Member Functions inherited from CFxUIBaseView
 CFxUIBaseView ()
 
virtual ~CFxUIBaseView ()
 
void setDisabled (bool on)
 
void setEnabled (bool on)
 
bool isEnabled () const
 
CFxUIPalette::ColorRole backgroundRole ()
 
void setPalette (const CFxUIPalette &)
 
const CFxUIPalettepalette () const
 
bool isVisible ()
 
void setVisible (bool bVisible)
 
bool hasFocus () const
 
void setFocus ()
 
void setFocus (int iReason)
 
void setFocusPolicy (int iPolicy)
 
int width ()
 
void setWidth (int w)
 
int height ()
 
void setHeight (int h)
 
void update ()
 
void setBusyState (bool bBusy=false)
 
void resize (int w, int h)
 
void setCornerRadius (float radius)
 
void setBorderWidth (float width)
 
void setBorderWidth (float left, float top, float right, float bottom)
 
void setBorderColor (int r, int g, int b)
 
virtual void showEvent (CFxUIShowEvent *event)
 
virtual void hideEvent (CFxUIHideEvent *event)
 
virtual void paintEvent (CFxUIPaintEvent *event)
 
virtual void resizeEvent (CFxUIResizeEvent *event)
 
virtual void focusInEvent (CFxUIFocusEvent *focusInEvent)
 
virtual void focusOutEvent (CFxUIFocusEvent *focusOutEvent)
 
void setEventAccepted (bool bAccepted=false)
 
void addView (CFxUIBaseView *pChild, float fWeight=0.0)
 
void insertView (CFxUIBaseView *pChild, int index=0, float fWeight=0.0)
 
int indexOf (CFxUIBaseView *pChild)
 
void removeView (CFxUIBaseView *pChild)
 
void setPreferableSize (int w, int h)
 
void setMinimumWidth (int iWidth)
 
void setMinimumHeight (int iHeight)
 
void setMinimumSize (const CFxUISize &size)
 
void setMaximumWidth (int iWidth)
 
void setMaximumHeight (int iHeight)
 
void setMaximumSize (const CFxUISize &size)
 
int minimumWidth ()
 
int minimumHeight ()
 
int maximumWidth ()
 
int maximumHeight ()
 
void setToolTip (const CFxUIString &sToolTip)
 
const CFxUIString toolTip ()
 
CFxUISignal< void(void)> & aboutToPassEventToParent ()
 
CFxUISignal< void(void)> & aboutToShow ()
 
CFxUISignal< void(void)> & hoverEnter ()
 
CFxUISignal< void(void)> & hoverLeave ()
 
CFxUISignal< void(bool)> & visibilityChanged ()
 
- Public Member Functions inherited from CFxUIObject
 CFxUIObject ()
 
virtual ~CFxUIObject ()
 
FxNativeHandle getHandle () const
 
void setHandle (FxNativeHandle handle)
 
void setParent (CFxUIObject *parent)
 
CFxUIObjectparent ()
 
const CFxUIObjectparent () const
 
void setObjectName (const CFxUIString &objectName)
 
CFxUIString objectName () const
 
bool setProperty (const char *name, const CFxUIVariant &value)
 
CFxUIVariant property (const char *name)
 
CFxUIList< CFxUIObject * > children () const
 
template<typename T >
CFxUIList< T > findChildren (const CFxUIString &name=CFxUIString())
 
void blockSignals (bool block)
 
bool signalsBlocked () const
 

Additional Inherited Members

- Static Public Member Functions inherited from CFxUIBaseView
static void setTabOrder (CFxUIObject *first, CFxUIObject *second)
 
- Protected Member Functions inherited from CFxUIObject
CFxUIObjectsender ()
 
- Protected Attributes inherited from CFxUIObject
CFxUIObjectImpl * m_pImpl
 
CFxUIObjectData * m_pData
 

Detailed Description

Class CFxUITreeView provides a default model/view implementation of a tree view.

Definition at line 27 of file FxUITreeView.h.

Member Enumeration Documentation

◆ UIHeaderAlignment

This enum type defines the alignment of header.

Enumerator
AlignLeft 

This enum aligns text with the left edge.

AlignRight 

This enum aligns text with the right edge.

AlignHCenter 

This enum centers horizontally in the available space.

AlignTop 

This enum aligns text with the top.

AlignBottom 

This enum aligns text with the bottom.

AlignVCenter 

This enum centers vertically in the available space.

Definition at line 34 of file FxUITreeView.h.

◆ UIHeaderResizeMode

This enum defines the behavior of the header sections.

Enumerator
Interactive 

The user can resize the section.

Stretch 

HeaderView will automatically resize the section to fill the available space.

Fixed 

The user cannot resize the section.

ResizeToContents 

HeaderView will automatically resize the section to its optimal size based on the contents of the entire column or row.

Custom 

Use Fixed instead.

Definition at line 72 of file FxUITreeView.h.

◆ UISelectionBehavior

This enum type defines the selection behavior of items in FxUITreeView.

Enumerator
SelectItems 

This enum selects the single items.

SelectRows 

This enum selects only the rows.

SelectColumns 

This enum selects only the columns.

Definition at line 47 of file FxUITreeView.h.

◆ UISelectionFlag

This enum defines way the selection will be updated.

Enumerator
NoUpdate 

No selection will be made.

Clear 

The complete selection will be cleared.

Select 

All specified indexes will be selected.

Deselect 

All specified indexes will be deselected.

Rows 

All indexes will be expanded to span rows.

Columns 

All indexes will be expanded to span columns.

ClearAndSelect 

A combination of Clear and Select, provided for convenience.

Definition at line 84 of file FxUITreeView.h.

◆ UISelectionMode

This enum indicates how the view responds to user selections.

Enumerator
NoSelection 

Items cannot be selected.

SingleSelection 

When the user selects an item, any already-selected item becomes unselected, and the user cannot unselect the selected item by clicking on it.

MultiSelection 

When the user selects an item in the usual way, the selection status of that item is toggled and the other items are left alone. Multiple items can be toggled by dragging the mouse over them.

ExtendedSelection 

If the user presses the Ctrl key when clicking on an item, the clicked item gets toggled and all other items are left untouched. If the user presses the Shift key while clicking on an item, all items between the current item and the clicked item are selected or unselected, depending on the state of the clicked item. Multiple items can be selected by dragging the mouse over them.

ContiguousSelection 

If the user presses the Shift key while clicking on an item, all items between the current item and the clicked item are selected or unselected, depending on the state of the clicked item.

Definition at line 57 of file FxUITreeView.h.

Constructor & Destructor Documentation

◆ CFxUITreeView()

CFxUITreeView::CFxUITreeView ( )

Constructor

◆ ~CFxUITreeView()

CFxUITreeView::~CFxUITreeView ( )

Destructor

Member Function Documentation

◆ clearSelection()

void CFxUITreeView::clearSelection ( )

Sets the selection of view clear.

◆ collapseAll()

void CFxUITreeView::collapseAll ( )

Sets all items of tree view to collpased state.

◆ collapsed()

CFxUISignal< void(const CFxUIModelIndex &)> & CFxUITreeView::collapsed ( )

◆ currentIndex()

CFxUIModelIndex CFxUITreeView::currentIndex ( ) const

Gets the current index of item.

Returns
the index.

◆ expandAll()

void CFxUITreeView::expandAll ( )

Sets all items of tree view to expanded state.

◆ expanded()

CFxUISignal< void(const CFxUIModelIndex &)> & CFxUITreeView::expanded ( )

◆ getModel()

CFxUIAbstractItemModel * CFxUITreeView::getModel ( )

◆ itemClicked()

CFxUISignal< void(const CFxUIModelIndex &)> & CFxUITreeView::itemClicked ( )

Signal is emitted when item is clicked.

◆ itemDoubleClicked()

CFxUISignal< void(const CFxUIModelIndex &)> & CFxUITreeView::itemDoubleClicked ( )

Signal is emitted when item is double clicked.

◆ keyWentDown()

CFxUISignal< void(int, int) > & CFxUITreeView::keyWentDown ( )

Signal is emitted when any keyboard key is pressed.

◆ selectionChanged()

CFxUISignal< void(void)> & CFxUITreeView::selectionChanged ( )

Signal is emitted when selection of view is changed.

◆ selectRow()

void CFxUITreeView::selectRow ( CFxUITreeView::UISelectionFlag  flag,
CFxUIModelIndex  index 
)

Sets the row selected.

Parameters
firstflag Input.This enum is of type CFxUITreeView::UISelectionFlag.
secondindex Input. Selects the row at provided index.

◆ setAlternatingRowColors()

void CFxUITreeView::setAlternatingRowColors ( bool  bEnable)

Sets whether whether to draw the background using alternating colors.

Parameters
_bEnable_Input.

◆ setAutoScroll()

void CFxUITreeView::setAutoScroll ( bool  bEnable)

Sets whether autoscrolling in drag move events is enabled.

Parameters
_bEnable_Input.

◆ setChildNodeIcon()

void CFxUITreeView::setChildNodeIcon ( const CFxUIIcon icon)

Sets the icon.

Parameters
_icon_Input

◆ setCollapse()

void CFxUITreeView::setCollapse ( CFxUIModelIndex  index)

Sets item to collapse state at provided index.

Parameters
_index_ Input.

◆ setColumnHidden()

void CFxUITreeView::setColumnHidden ( int  iColumn,
bool  bHide 
)

Sets the column hidden.

Parameters
firstiColumn Input.
secondbHide Input. If true, column is hidden.

◆ setColumnWidth()

void CFxUITreeView::setColumnWidth ( int  iColumn,
int  iWidth 
)

Sets the width of the given column to the width specified.

Parameters
firstiColumn Input.
secondiWidth Input.

◆ setCurrentIndex()

void CFxUITreeView::setCurrentIndex ( CFxUIModelIndex  index)

Sets the current item to be the item at index.

Parameters
_index_Input.

◆ setExpand()

void CFxUITreeView::setExpand ( CFxUIModelIndex  index)

Sets item to expand state at provided index.

Parameters
_index_ Input.

◆ setExpandsOnDoubleClick()

void CFxUITreeView::setExpandsOnDoubleClick ( bool  bEnable)

Sets item to expand on double click.

Parameters
_bEnable_ Input.

◆ setHeaderAlignment()

void CFxUITreeView::setHeaderAlignment ( CFxUITreeView::UIHeaderAlignment  align)

Sets the alignment.

Parameters
_align_Input. This is an enum defined in CFxUITreeView::UIHeaderAlignment.

◆ setHeaderResizeSection() [1/2]

void CFxUITreeView::setHeaderResizeSection ( CFxUITreeView::UIHeaderResizeMode  mode)

Sets the resize mode for all columns.

Parameters
_mode_Input. This is an enum defined in CFxUITreeView::UIHeaderResizeMode.

◆ setHeaderResizeSection() [2/2]

void CFxUITreeView::setHeaderResizeSection ( CFxUITreeView::UIHeaderResizeMode  mode,
int  iColumn 
)

Sets the resize mode for column.

Parameters
firstmode Input. This is an enum defined in CFxUITreeView::UIHeaderResizeMode.
secondiColumn Input.

◆ setHeaderStretchLastSection()

void CFxUITreeView::setHeaderStretchLastSection ( bool  bEnable)

Sets whether the last visible section in the header takes up all the available space.

Parameters
_bEnable_Input.

◆ setModel()

void CFxUITreeView::setModel ( CFxUIAbstractItemModel model)

Sets the model for the view to present.

Parameters
_model_Input.

◆ setMoveCursorMode()

void CFxUITreeView::setMoveCursorMode ( bool  bItemMode)

◆ setParentNodeIcon()

void CFxUITreeView::setParentNodeIcon ( const CFxUIIcon icon)

Sets the icon.

Parameters
_icon_Input

◆ setRootIsDecorated()

void CFxUITreeView::setRootIsDecorated ( bool  bShow)

Sets whether to show controls for expanding and collapsing top-level items.

Parameters
_bShow_Input.

◆ setSelectionBehavior()

void CFxUITreeView::setSelectionBehavior ( CFxUITreeView::UISelectionBehavior  behavior)

Sets the selection behavior for tree.

Parameters
_behavior_Input. This is an enum defined in CFxUITreeView::UISelectionBehavior.

◆ setSelectionMode()

void CFxUITreeView::setSelectionMode ( CFxUITreeView::UISelectionMode  mode)

Sets the selection mode for tree.

Parameters
_mode_Input. This is an enum defined in CFxUITreeView::UISelectionMode.

◆ setSortingEnabled()

void CFxUITreeView::setSortingEnabled ( bool  bEnable)

Sets whether whether sorting is enabled.

Parameters
_bEnable_Input. If true, sorting is enabled for the tree; if false, sorting is not enabled.

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