Version: 9.15.0
SUIT_ShortcutTree Class Reference

#include <SUIT_ShortcutEditor.h>

Inheritance diagram for SUIT_ShortcutTree:
Inheritance graph

Public Types

enum  ColumnIdx { Name , KeySequence , ToolTip , NotExist }
 
enum class  SortKey { ID , Name , ToolTip , KeySequence }
 

Public Member Functions

virtual ~SUIT_ShortcutTree ()=default
 
SUIT_ShortcutTabWidgetparentTabWidget () const
 
const SUIT_ShortcutContainershortcutContainer () const
 
const QString & moduleID () const
 
void setLang (const QString &theLang)
 
const QString & name () const
 
const QString & toolTip () const
 
void sort (SUIT_ShortcutTree::SortKey theLeadingKey, Qt::SortOrder theOrder)
 

Static Public Member Functions

static SUIT_FoundActionTree::ColumnIdx toFoundActionTreeColIdx (const SUIT_ShortcutTree::ColumnIdx theColumnIdx)
 
static SUIT_ShortcutTree::SortKey toSortKey (const SUIT_ShortcutTree::ColumnIdx theColumnIdx)
 
static SUIT_ShortcutTree::ColumnIdx toColumnIdx (const SUIT_ShortcutTree::SortKey theSortKey)
 

Public Attributes

const std::shared_ptr< const SUIT_ShortcutModuleAssetsmyAssets
 

Static Public Attributes

static const QList< std::pair< SUIT_ShortcutTree::SortKey, Qt::SortOrder > > DEFAULT_SORT_SCHEMA
 

Private Slots

void onItemExpanded (QTreeWidgetItem *theItem)
 
void onItemCollapsed (QTreeWidgetItem *theItem)
 
void onHeaderItemClicked (int theColIdx)
 
void onItemDoubleClicked (QTreeWidgetItem *theWidgetItem, int theColIdx)
 

Private Member Functions

 SUIT_ShortcutTree (SUIT_ShortcutTabWidget *theParent, std::shared_ptr< const SUIT_ShortcutModuleAssets > theAssets, const QString &theLang)
 
 SUIT_ShortcutTree (const SUIT_ShortcutTree &)=delete
 
SUIT_ShortcutTreeoperator= (const SUIT_ShortcutTree &)=delete
 
void sortRecursive (QTreeWidgetItem *theParentItem)
 
bool updateItems (bool theHighlightModified)
 
bool updateChildrenItemsRecursively (bool theHighlightModified, QTreeWidgetItem *const theItem, bool theItemIsInvisibleRoot=false)
 
bool updateItemShortcut (SUIT_ShortcutTreeItem *const theItem, const std::map< QString, QKeySequence > &theModuleShortcuts, bool theHighlightModified) const
 
SUIT_ShortcutTreeItemfindItem (QStringList theRelativeIDTokens, const QTreeWidgetItem *theAncestorItem=nullptr) const
 
std::set< SUIT_ShortcutTreeItem *, std::function< bool(SUIT_ShortcutTreeItem *, SUIT_ShortcutTreeItem *)> > getSortedChildren (QTreeWidgetItem *theParentItem)
 
void insertChild (QTreeWidgetItem *theParentItem, std::set< SUIT_ShortcutTreeItem *, std::function< bool(SUIT_ShortcutTreeItem *, SUIT_ShortcutTreeItem *)>> &theSortedChildren, SUIT_ShortcutTreeItem *theChildItem)
 Inserts theChildItem to theParentItem and theSortedChildren. Does not check whether theSortedChildren are actually child items of theParentItem. Does not check whether current item sort schema is same as one of theSortedChildren. More...
 

Private Attributes

SUIT_ShortcutTabWidget *const myParentTabWidget
 
SUIT_ShortcutTree::SortKey myLeadingSortKey
 
std::map< SUIT_ShortcutTree::SortKey, Qt::SortOrder > mySortSchema
 
QString myName
 
QString myToolTip
 
bool myIsPopulated
 

Friends

class SUIT_ShortcutTabWidget
 

Member Enumeration Documentation

◆ ColumnIdx

Enumerator
Name 
KeySequence 
ToolTip 
NotExist 

◆ SortKey

Enumerator
ID 
Name 
ToolTip 
KeySequence 

Constructor & Destructor Documentation

◆ SUIT_ShortcutTree() [1/2]

SUIT_ShortcutTree::SUIT_ShortcutTree ( SUIT_ShortcutTabWidget theParent,
std::shared_ptr< const SUIT_ShortcutModuleAssets theAssets,
const QString &  theLang 
)
private
Parameters
theParentmust not be nullptr.
theAssetsmust not be nullptr.

References DEFAULT_SORT_SCHEMA, myLeadingSortKey, mySortSchema, onHeaderItemClicked(), onItemCollapsed(), onItemDoubleClicked(), onItemExpanded(), setLang(), and toColumnIdx().

◆ SUIT_ShortcutTree() [2/2]

SUIT_ShortcutTree::SUIT_ShortcutTree ( const SUIT_ShortcutTree )
privatedelete

◆ ~SUIT_ShortcutTree()

virtual SUIT_ShortcutTree::~SUIT_ShortcutTree ( )
virtualdefault

Member Function Documentation

◆ findItem()

SUIT_ShortcutTreeItem * SUIT_ShortcutTree::findItem ( QStringList  theRelativeIDTokens,
const QTreeWidgetItem theAncestorItem = nullptr 
) const
private

◆ getSortedChildren()

std::set< SUIT_ShortcutTreeItem *, std::function< bool(SUIT_ShortcutTreeItem *, SUIT_ShortcutTreeItem *)> > SUIT_ShortcutTree::getSortedChildren ( QTreeWidgetItem theParentItem)
private
Returns
Children of theParentItem being sorted according to current sort mode and order.

References DEFAULT_SORT_SCHEMA, SUIT_ShortcutTreeItem::getValue(), SUIT_ShortcutTreeItem::isFolder(), myLeadingSortKey, and mySortSchema.

◆ insertChild()

void SUIT_ShortcutTree::insertChild ( QTreeWidgetItem theParentItem,
std::set< SUIT_ShortcutTreeItem *, std::function< bool(SUIT_ShortcutTreeItem *, SUIT_ShortcutTreeItem *)>> &  theSortedChildren,
SUIT_ShortcutTreeItem theChildItem 
)
private

Inserts theChildItem to theParentItem and theSortedChildren. Does not check whether theSortedChildren are actually child items of theParentItem. Does not check whether current item sort schema is same as one of theSortedChildren.

References SUIT_tools::distanceFromBegin().

◆ moduleID()

const QString & SUIT_ShortcutTree::moduleID ( ) const

References myAssets.

◆ name()

const QString & SUIT_ShortcutTree::name ( ) const

References myName.

◆ onHeaderItemClicked

void SUIT_ShortcutTree::onHeaderItemClicked ( int  theColIdx)
privateslot

◆ onItemCollapsed

void SUIT_ShortcutTree::onItemCollapsed ( QTreeWidgetItem theItem)
privateslot

◆ onItemDoubleClicked

void SUIT_ShortcutTree::onItemDoubleClicked ( QTreeWidgetItem theWidgetItem,
int  theColIdx 
)
privateslot

◆ onItemExpanded

void SUIT_ShortcutTree::onItemExpanded ( QTreeWidgetItem theItem)
privateslot

◆ operator=()

SUIT_ShortcutTree& SUIT_ShortcutTree::operator= ( const SUIT_ShortcutTree )
privatedelete

◆ parentTabWidget()

SUIT_ShortcutTabWidget * SUIT_ShortcutTree::parentTabWidget ( ) const

References myParentTabWidget.

◆ setLang()

void SUIT_ShortcutTree::setLang ( const QString &  theLang)

References myAssets, myName, and myToolTip.

◆ shortcutContainer()

const SUIT_ShortcutContainer & SUIT_ShortcutTree::shortcutContainer ( ) const

◆ sort()

void SUIT_ShortcutTree::sort ( SUIT_ShortcutTree::SortKey  theLeadingKey,
Qt::SortOrder  theOrder 
)

◆ sortRecursive()

void SUIT_ShortcutTree::sortRecursive ( QTreeWidgetItem theParentItem)
private

References getSortedChildren().

◆ toColumnIdx()

SUIT_ShortcutTree::ColumnIdx SUIT_ShortcutTree::toColumnIdx ( const SUIT_ShortcutTree::SortKey  theSortKey)
static

References KeySequence, Name, and ToolTip.

◆ toFoundActionTreeColIdx()

SUIT_FoundActionTree::ColumnIdx SUIT_ShortcutTree::toFoundActionTreeColIdx ( const SUIT_ShortcutTree::ColumnIdx  theColumnIdx)
static

◆ toolTip()

const QString & SUIT_ShortcutTree::toolTip ( ) const

References myToolTip.

◆ toSortKey()

SUIT_ShortcutTree::SortKey SUIT_ShortcutTree::toSortKey ( const SUIT_ShortcutTree::ColumnIdx  theColumnIdx)
static

References KeySequence, Name, and ToolTip.

◆ updateChildrenItemsRecursively()

bool SUIT_ShortcutTree::updateChildrenItemsRecursively ( bool  theHighlightModified,
QTreeWidgetItem *const  theItem,
bool  theItemIsInvisibleRoot = false 
)
private

◆ updateItems()

bool SUIT_ShortcutTree::updateItems ( bool  theHighlightModified)
private
Returns
True, if at least one key sequence is modified (differs from applied one).

References SUIT_ShortcutMgr::get(), SUIT_ShortcutMgr::getModuleAssets(), moduleID(), myIsPopulated, and updateChildrenItemsRecursively().

◆ updateItemShortcut()

bool SUIT_ShortcutTree::updateItemShortcut ( SUIT_ShortcutTreeItem *const  theItem,
const std::map< QString, QKeySequence > &  theModuleShortcuts,
bool  theHighlightModified 
) const
private

Friends And Related Function Documentation

◆ SUIT_ShortcutTabWidget

friend class SUIT_ShortcutTabWidget
friend

Member Data Documentation

◆ DEFAULT_SORT_SCHEMA

const QList< std::pair< SUIT_ShortcutTree::SortKey, Qt::SortOrder > > SUIT_ShortcutTree::DEFAULT_SORT_SCHEMA
static
Initial value:

◆ myAssets

const std::shared_ptr<const SUIT_ShortcutModuleAssets> SUIT_ShortcutTree::myAssets

◆ myIsPopulated

bool SUIT_ShortcutTree::myIsPopulated
private

◆ myLeadingSortKey

SUIT_ShortcutTree::SortKey SUIT_ShortcutTree::myLeadingSortKey
private

◆ myName

QString SUIT_ShortcutTree::myName
private

◆ myParentTabWidget

SUIT_ShortcutTabWidget* const SUIT_ShortcutTree::myParentTabWidget
private

◆ mySortSchema

std::map<SUIT_ShortcutTree::SortKey, Qt::SortOrder> SUIT_ShortcutTree::mySortSchema
private

◆ myToolTip

QString SUIT_ShortcutTree::myToolTip
private

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