|
QtCanpool 3.3.0
|
记录所有自定义操作的数据类 更多...
#include <qxribbon/ribboncustomizedata.h>
Public 成员函数 | |
| RibbonCustomizeData () | |
| RibbonCustomizeData | |
| RibbonCustomizeData (ActionType type, RibbonActionsManager *mgr=Q_NULLPTR) | |
| ActionType | actionType () const |
| 获取CustomizeData的action type | |
| void | setActionType (ActionType a) |
| 设置CustomizeData的action type | |
| bool | isValid () const |
| 判断是否是一个正常的CustomizeData | |
| bool | apply (RibbonBar *bar) |
| 应用RibbonCustomizeData到RibbonBar | |
| RibbonActionsManager * | actionsManager () |
| void | setActionsManager (RibbonActionsManager *mgr) |
静态 Public 成员函数 | |
| static RibbonCustomizeData | makeAddPageCustomizeData (const QString &title, int index, const QString &objName) |
| static RibbonCustomizeData | makeAddGroupCustomizeData (const QString &title, int index, const QString &pageObjName, const QString &objName) |
| 创建一个AddGroupActionType的RibbonCustomizeData | |
| static RibbonCustomizeData | makeAddActionCustomizeData (const QString &key, RibbonActionsManager *mgr, RibbonGroup::RowProportion rp, const QString &pageObjName, const QString &groupObjName) |
| 添加action | |
| static RibbonCustomizeData | makeRenamePageCustomizeData (const QString &newName, const QString &pageObjName) |
| static RibbonCustomizeData | makeRenameGroupCustomizeData (const QString &newName, const QString &pageObjName, const QString &groupObjName) |
| static RibbonCustomizeData | makeRemovePageCustomizeData (const QString &pageObjName) |
| static RibbonCustomizeData | makeChangePageOrderCustomizeData (const QString &pageObjName, int moveIndex) |
| 对应ChangePageOrderActionType | |
| static RibbonCustomizeData | makeChangeGroupOrderCustomizeData (const QString &pageObjName, const QString &groupObjName, int moveIndex) |
| 对应ChangeGroupOrderActionType | |
| static RibbonCustomizeData | makeChangeActionOrderCustomizeData (const QString &pageObjName, const QString &groupObjName, const QString &key, RibbonActionsManager *mgr, int moveIndex) |
| 对应ChangeActionOrderActionType | |
| static RibbonCustomizeData | makeRemoveGroupCustomizeData (const QString &pageObjName, const QString &groupObjName) |
| static RibbonCustomizeData | makeRemoveActionCustomizeData (const QString &pageObjName, const QString &groupObjName, const QString &key, RibbonActionsManager *mgr) |
| 对应RemoveActionActionType | |
| static RibbonCustomizeData | makeVisiblePageCustomizeData (const QString &pageObjName, bool isShow) |
| RibbonCustomizeData::makeVisiblePageCustomizeData | |
| static bool | isCanCustomize (QObject *obj) |
| static void | setCanCustomize (QObject *obj, bool canbe=true) |
| static QList< RibbonCustomizeData > | simplify (const QList< RibbonCustomizeData > &csd) |
| 对QList<RibbonCustomizeData>进行简化操作 | |
Public 属性 | |
| int | indexValue |
| 记录顺序的参数 | |
| QString | keyValue |
| 记录标题、索引等参数 | |
| QString | pageObjNameValue |
| 记录pageObjName,用于定位Page | |
| QString | groupObjNameValue |
| 记录groupObjName,ribbon的Customize索引大部分基于objname | |
| RibbonGroup::RowProportion | actionRowProportionValue |
记录所有自定义操作的数据类
在文件 ribboncustomizedata.h 第 21 行定义.
在文件 ribboncustomizedata.h 第 24 行定义.
| QxRibbon::RibbonCustomizeData::RibbonCustomizeData | ( | ) |
在文件 ribboncustomizedata.cpp 第 39 行定义.
| QxRibbon::RibbonCustomizeData::RibbonCustomizeData | ( | ActionType | type, |
| RibbonActionsManager * | mgr = Q_NULLPTR |
||
| ) |
在文件 ribboncustomizedata.cpp 第 48 行定义.
| RibbonActionsManager * QxRibbon::RibbonCustomizeData::actionsManager | ( | ) |
在文件 ribboncustomizedata.cpp 第 280 行定义.
| RibbonCustomizeData::ActionType QxRibbon::RibbonCustomizeData::actionType | ( | ) | const |
| bool QxRibbon::RibbonCustomizeData::apply | ( | RibbonBar * | bar | ) |
应用RibbonCustomizeData到RibbonBar
| bar |
在文件 ribboncustomizedata.cpp 第 91 行定义.
|
static |
在文件 ribboncustomizedata.cpp 第 556 行定义.
| bool QxRibbon::RibbonCustomizeData::isValid | ( | ) | const |
判断是否是一个正常的CustomizeData
实际逻辑actionType() != UnknowActionType
在文件 ribboncustomizedata.cpp 第 81 行定义.
|
static |
添加action
| key | action的索引 |
| mgr | action管理器 |
| rp | 定义action的占位情况 |
| pageObjName | action添加到的page的objname |
| groupObjName | action添加到的page下的group的objname |
在文件 ribboncustomizedata.cpp 第 336 行定义.
|
static |
创建一个AddGroupActionType的RibbonCustomizeData
| title | group的标题 |
| index | group的index |
| pageObjName | group的page的objectname |
| objName | group的objname |
在文件 ribboncustomizedata.cpp 第 312 行定义.
|
static |
在文件 ribboncustomizedata.cpp 第 290 行定义.
|
static |
对应ChangeActionOrderActionType
| pageObjName | 需要移动的group对应的pageobjName |
| groupObjName | 需要移动的groupObjName |
| key | RibbonActionsManager管理的key名 |
| mgr | RibbonActionsManager指针 |
| moveIndex | 移动位置,-1代表向上(向左)移动一个位置,1带表向下(向右)移动一个位置 |
在文件 ribboncustomizedata.cpp 第 447 行定义.
|
static |
对应ChangeGroupOrderActionType
| pageObjName | 需要移动的group对应的pageobjName |
| groupObjName | 需要移动的groupObjName |
| moveIndex | 移动位置,-1代表向上(向左)移动一个位置,1带表向下(向右)移动一个位置 |
在文件 ribboncustomizedata.cpp 第 418 行定义.
|
static |
对应ChangePageOrderActionType
| pageObjName | 需要移动的pageobjName |
| moveIndex | 移动位置,-1代表向上(向左)移动一个位置,1带表向下(向右)移动一个位置 |
在文件 ribboncustomizedata.cpp 第 393 行定义.
|
static |
对应RemoveActionActionType
| pageObjName | group对应的page的obj name |
| groupObjName | group对应的 obj name |
| key | RibbonActionsManager管理的key名 |
| mgr | RibbonActionsManager指针 |
在文件 ribboncustomizedata.cpp 第 514 行定义.
|
static |
在文件 ribboncustomizedata.cpp 第 487 行定义.
|
static |
在文件 ribboncustomizedata.cpp 第 470 行定义.
|
static |
在文件 ribboncustomizedata.cpp 第 369 行定义.
|
static |
在文件 ribboncustomizedata.cpp 第 353 行定义.
|
static |
RibbonCustomizeData::makeVisiblePageCustomizeData
| pageObjName | |
| isShow |
在文件 ribboncustomizedata.cpp 第 541 行定义.
| void QxRibbon::RibbonCustomizeData::setActionsManager | ( | RibbonActionsManager * | mgr | ) |
在文件 ribboncustomizedata.cpp 第 285 行定义.
| void QxRibbon::RibbonCustomizeData::setActionType | ( | RibbonCustomizeData::ActionType | a | ) |
|
static |
在文件 ribboncustomizedata.cpp 第 566 行定义.
|
static |
对QList<RibbonCustomizeData>进行简化操作
此函数会执行如下操作: 1、针对同一个元素出现添加和删除操作的进行移除(先添加,后删除) 2、针对VisiblePageActionType,对于多次出现的操作只保留最后一步 3、针对RenamePageActionType和RenameGroupActionType操作,先只保留最后一个,然后直接修改 4、针对连续的ChangePageOrderActionType,ChangeGroupOrderActionType,ChangeActionOrderActionType进行合并为一个动作, 如果合并后原地不动,则删除
| csd |
首先针对添加和删除操作进行优化
筛选VisiblePageActionType,对于多次出现的操作只保留最后一步
针对RenamePageActionType和RenameGroupActionType操作,只需保留最后一个
对于RenamePageActionType和RenameGroupActionType操作,直接修改,不留到apply时
针对连续的ChangePageOrderActionType,ChangeGroupOrderActionType,ChangeActionOrderActionType进行合并
上一步操作可能会产生indexvalue为0的情况,此操作把indexvalue为0的删除
在文件 ribboncustomizedata.cpp 第 584 行定义.
| RibbonGroup::RowProportion QxRibbon::RibbonCustomizeData::actionRowProportionValue |
在文件 ribboncustomizedata.h 第 141 行定义.
| QString QxRibbon::RibbonCustomizeData::groupObjNameValue |
记录groupObjName,ribbon的Customize索引大部分基于objname
行的占比,ribbon中有large,medium和small三种占比,见 RibbonGroup::RowProportion
在文件 ribboncustomizedata.h 第 138 行定义.
| int QxRibbon::RibbonCustomizeData::indexValue |
记录顺序的参数
在actionType==AddPageActionType时,此参数记录Page的insert位置, 在actionType==AddGroupActionType时,此参数记录group的insert位置, 在actionType==AddActionActionType时,此参数记录group的insert位置
在文件 ribboncustomizedata.h 第 119 行定义.
| QString QxRibbon::RibbonCustomizeData::keyValue |
记录标题、索引等参数
在actionType==AddPageActionType时,key为page标题, 在actionType==AddGroupActionType时,key为group标题, 在actionType==AddActionActionType时,key为action的查询依据,基于RibbonActionsManager::action查询
在文件 ribboncustomizedata.h 第 128 行定义.
| QString QxRibbon::RibbonCustomizeData::pageObjNameValue |
记录pageObjName,用于定位Page
在文件 ribboncustomizedata.h 第 133 行定义.