SARibbon 2.5.2
SARibbon wiki
载入中...
搜索中...
未找到
SARibbonCustomizeWidget类 参考

#include <SARibbonCustomizeWidget.h>

类 SARibbonCustomizeWidget 继承关系图:

class  PrivateData
 

Public 类型

enum  RibbonTreeShowType { ShowAllCategory , ShowMainCategory }
 
enum  ItemRole {
  LevelRole = Qt::UserRole + 1 , PointerRole = Qt::UserRole + 2 , CanCustomizeRole = Qt::UserRole + 3 , CustomizeRole = Qt::UserRole + 4 ,
  CustomizeObjNameRole = Qt::UserRole + 5
}
 

Public 成员函数

 SARibbonCustomizeWidget (SARibbonMainWindow *ribbonWindow, QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
 Constructor using SARibbonMainWindow
 
 SARibbonCustomizeWidget (SARibbonBar *ribbonbar, QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
 Constructor using SARibbonBar directly
 
void setupActionsManager (SARibbonActionsManager *mgr)
 Set the action manager
 
bool isApplied () const
 Check if there is content to store, corresponding to save action
 
bool isCached () const
 Check if there are modified contents, corresponding to apply action
 
const QStandardItemModel * model () const
 Get the model
 
void updateModel ()
 Update model based on current radiobutton selection
 
void updateModel (RibbonTreeShowType type)
 Update model with specified type
 
bool applys ()
 Apply all settings
 
bool toXml (QXmlStreamWriter *xml) const
 Convert to XML
 
bool toXml (const QString &xmlpath) const
 Convert to XML file
 
void fromXml (QXmlStreamReader *xml)
 Load from XML, for file-based settings, it is recommended to call this function before the dialog is displayed
 
void fromXml (const QString &xmlpath)
 Load from XML file
 
void makeActionsApplied ()
 Cache applied actions, these actions will not be cleared by clear(), used for local storage
 
void clearApplied ()
 Clear applied actions, need to clear applied actions after cancel operation
 
void clearCache ()
 Clear cached actions, after executing applys function, if you want to continue calling, you should clear, otherwise it will cause exceptions
 
void clear ()
 Clear all actions, excluding locally read data
 

静态 Public 成员函数

static bool fromXml (QXmlStreamReader *xml, SARibbonBar *bar, SARibbonActionsManager *mgr)
 Apply XML configuration
 

Protected 成员函数

void simplify ()
 Simplify QList<SARibbonCustomizeData>, merge some actions
 
SARibbonPanelItem::RowProportion selectedRowProportion () const
 Get the row proportion selected in the current interface
 
QAction * selectedAction () const
 Get the action selected in listview
 
QAction * itemToAction (QStandardItem *item) const
 Convert item to action
 
QStandardItem * selectedItem () const
 Get the selected item in ribbon tree
 
int selectedRibbonLevel () const
 Get the level of selected ribbon tree item
 
int itemLevel (QStandardItem *item) const
 Get the level based on selected item
 
void setSelectItem (QStandardItem *item, bool ensureVisible=true)
 Set an item to be selected
 
bool isItemCanCustomize (QStandardItem *item) const
 Check if item can be customized
 
bool isSelectedItemCanCustomize () const
 
bool isCustomizeItem (QStandardItem *item) const
 Check if item is a customize item
 
bool isSelectedItemIsCustomize () const
 
void removeItem (QStandardItem *item)
 Remove an item
 

详细描述

成员枚举类型说明

◆ ItemRole

枚举值
LevelRole 

Level: 0=category, 1=panel, 2=item

PointerRole 

Pointer storage, cast based on LevelRole

CanCustomizeRole 

Whether this item can be customized (bool)

CustomizeRole 

Whether this is a custom item (bool), mainly for self-added tabs and panels

CustomizeObjNameRole 

Temporary custom content object name (QString)

◆ RibbonTreeShowType

枚举值
ShowAllCategory 

Show all categories including context categories

ShowMainCategory 

Show main categories only, excluding context categories

构造及析构函数说明

◆ SARibbonCustomizeWidget()

SARibbonCustomizeWidget::SARibbonCustomizeWidget ( SARibbonMainWindow ribbonWindow,
QWidget *  parent = nullptr,
Qt::WindowFlags  f = Qt::WindowFlags() 
)
explicit

Constructor using SARibbonMainWindow

成员函数说明

◆ applys()

bool SARibbonCustomizeWidget::applys ( )

Apply all settings

◆ clear()

void SARibbonCustomizeWidget::clear ( )

Clear all actions, excluding locally read data

◆ clearApplied()

void SARibbonCustomizeWidget::clearApplied ( )

Clear applied actions, need to clear applied actions after cancel operation

◆ clearCache()

void SARibbonCustomizeWidget::clearCache ( )

Clear cached actions, after executing applys function, if you want to continue calling, you should clear, otherwise it will cause exceptions

◆ fromXml() [1/3]

void SARibbonCustomizeWidget::fromXml ( const QString &  xmlpath)

Load from XML file

◆ fromXml() [2/3]

void SARibbonCustomizeWidget::fromXml ( QXmlStreamReader *  xml)

Load from XML, for file-based settings, it is recommended to call this function before the dialog is displayed

◆ fromXml() [3/3]

bool SARibbonCustomizeWidget::fromXml ( QXmlStreamReader *  xml,
SARibbonBar bar,
SARibbonActionsManager mgr 
)
static

Apply XML configuration

◆ isApplied()

bool SARibbonCustomizeWidget::isApplied ( ) const

Check if there is content to store, corresponding to save action

◆ isCached()

bool SARibbonCustomizeWidget::isCached ( ) const

Check if there are modified contents, corresponding to apply action

◆ isCustomizeItem()

bool SARibbonCustomizeWidget::isCustomizeItem ( QStandardItem *  item) const
protected

Check if item is a customize item

◆ isItemCanCustomize()

bool SARibbonCustomizeWidget::isItemCanCustomize ( QStandardItem *  item) const
protected

Check if item can be customized

◆ itemLevel()

int SARibbonCustomizeWidget::itemLevel ( QStandardItem *  item) const
protected

Get the level based on selected item

◆ itemToAction()

QAction * SARibbonCustomizeWidget::itemToAction ( QStandardItem *  item) const
protected

Convert item to action

◆ makeActionsApplied()

void SARibbonCustomizeWidget::makeActionsApplied ( )

Cache applied actions, these actions will not be cleared by clear(), used for local storage

◆ model()

const QStandardItemModel * SARibbonCustomizeWidget::model ( ) const

Get the model

◆ selectedAction()

QAction * SARibbonCustomizeWidget::selectedAction ( ) const
protected

Get the action selected in listview

◆ selectedItem()

QStandardItem * SARibbonCustomizeWidget::selectedItem ( ) const
protected

Get the selected item in ribbon tree

◆ selectedRibbonLevel()

int SARibbonCustomizeWidget::selectedRibbonLevel ( ) const
protected

Get the level of selected ribbon tree item

◆ selectedRowProportion()

SARibbonPanelItem::RowProportion SARibbonCustomizeWidget::selectedRowProportion ( ) const
protected

Get the row proportion selected in the current interface

◆ setSelectItem()

void SARibbonCustomizeWidget::setSelectItem ( QStandardItem *  item,
bool  ensureVisible = true 
)
protected

Set an item to be selected

◆ setupActionsManager()

void SARibbonCustomizeWidget::setupActionsManager ( SARibbonActionsManager mgr)

Set the action manager

◆ simplify()

void SARibbonCustomizeWidget::simplify ( )
protected

Simplify QList<SARibbonCustomizeData>, merge some actions

◆ toXml() [1/2]

bool SARibbonCustomizeWidget::toXml ( const QString &  xmlpath) const

Convert to XML file

◆ toXml() [2/2]

bool SARibbonCustomizeWidget::toXml ( QXmlStreamWriter *  xml) const

Convert to XML

◆ updateModel() [1/2]

void SARibbonCustomizeWidget::updateModel ( )

Update model based on current radiobutton selection

◆ updateModel() [2/2]

void SARibbonCustomizeWidget::updateModel ( RibbonTreeShowType  type)

Update model with specified type


该类的文档由以下文件生成: