|
QtCanpool 3.3.0
|
自定义界面窗口 更多...
#include <qxribbon/ribboncustomizewidget.h>

Public 类型 | |
| enum | RibbonTreeShowType { ShowAllPage , ShowMainPage } |
| 定义ribbon树的显示类型 更多... | |
| enum | ItemRole { LevelRole = Qt::UserRole + 1 , PointerRole , CanCustomizeRole , CustomizeRole , CustomizeObjNameRole } |
| QStandardItem对应的role 更多... | |
Public 成员函数 | |
| RibbonCustomizeWidget (RibbonBar *ribbonBar, QWidget *parent=Q_NULLPTR, Qt::WindowFlags f=Qt::WindowFlags()) | |
| RibbonCustomizeWidget::RibbonCustomizeWidget | |
| ~RibbonCustomizeWidget () | |
| void | setupActionsManager (RibbonActionsManager *mgr) |
| 设置action管理器 | |
| bool | isChanged () const |
| const QStandardItemModel * | model () const |
| 获取model | |
| void | updateModel () |
| 根据当前的radiobutton选项来更新model | |
| void | updateModel (RibbonTreeShowType type) |
| 更新model | |
| bool | apply () |
| 应用所有设定 | |
| bool | toXml (QXmlStreamWriter *xml) const |
| 转换为xml | |
| bool | toXml (const QString &xmlpath) const |
| 把配置写入文件中 | |
| void | fromXml (QXmlStreamReader *xml) |
| 从xml中加载QList<RibbonCustomizeData> | |
| void | fromXml (const QString &xmlpath) |
| 从xml中加载QList<RibbonCustomizeData> | |
| void | clear () |
| 清除所有动作 | |
| void | onComboBoxActionIndexCurrentIndexChanged (int index) |
| void | onRadioButtonGroupButtonClicked (QAbstractButton *b) |
| void | onPushButtonNewPageClicked () |
| void | onPushButtonNewGroupClicked () |
| void | onPushButtonRenameClicked () |
| void | onPushButtonAddClicked () |
| void | onPushButtonDeleteClicked () |
| void | onListViewSelectClicked (const QModelIndex &index) |
| void | onTreeViewResultClicked (const QModelIndex &index) |
| void | onToolButtonUpClicked () |
| void | onToolButtonDownClicked () |
| void | onItemChanged (QStandardItem *item) |
| void | onLineEditSearchActionTextEdited (const QString &text) |
| void | onPushButtonResetClicked () |
静态 Public 成员函数 | |
| static bool | fromXml (QXmlStreamReader *xml, RibbonBar *bar, RibbonActionsManager *mgr) |
| 应用xml配置 | |
Protected 成员函数 | |
| void | simplify () |
| 精简 | |
| RibbonGroup::RowProportion | selectedRowProportion () const |
| 获取当前界面选中的行属性 | |
| QAction * | selectedAction () const |
| 获取listview中选中的action | |
| QAction * | itemToAction (QStandardItem *item) const |
| 把item转换为action | |
| QStandardItem * | selectedItem () const |
| 获取ribbon tree选中的item | |
| int | selectedRibbonLevel () const |
| 获取选中的ribbon tree 的level | |
| int | itemLevel (QStandardItem *item) const |
| 获取StandardItem 的level | |
| void | setSelectItem (QStandardItem *item, bool ensureVisible=true) |
| 设置某个item被选中 | |
| bool | isItemCanCustomize (QStandardItem *item) const |
| 判断itemn能否改动,可以改动返回true | |
| bool | isSelectedItemCanCustomize () const |
| bool | isCustomizeItem (QStandardItem *item) const |
| 判断itemn能否改动,可以改动返回true | |
| bool | isSelectedItemIsCustomize () const |
| void | removeItem (QStandardItem *item) |
自定义界面窗口
在文件 ribboncustomizewidget.h 第 29 行定义.
QStandardItem对应的role
在文件 ribboncustomizewidget.h 第 44 行定义.
定义ribbon树的显示类型
| 枚举值 | |
|---|---|
| ShowAllPage | 显示所有的页,包括上下文 |
| ShowMainPage | 显示主要的页,不包含上下文 |
在文件 ribboncustomizewidget.h 第 36 行定义.
| QxRibbon::RibbonCustomizeWidget::RibbonCustomizeWidget | ( | RibbonBar * | ribbonBar, |
| QWidget * | parent = Q_NULLPTR, |
||
| Qt::WindowFlags | f = Qt::WindowFlags() |
||
| ) |
RibbonCustomizeWidget::RibbonCustomizeWidget
| ribbonBar | 传入需要管理的ribbonBar指针 |
| parent | 用于界面生成的parent |
| f | 同QWidget::QWidget的第二个参数 |
在文件 ribboncustomizewidget.cpp 第 661 行定义.
| QxRibbon::RibbonCustomizeWidget::~RibbonCustomizeWidget | ( | ) |
在文件 ribboncustomizewidget.cpp 第 675 行定义.
| bool QxRibbon::RibbonCustomizeWidget::apply | ( | ) |
应用所有设定
先apply再simplify,保证操作都被应用到。
如果先simplify后apply会存在如下问题: 比如: 1.先添加一个元素,执行apply,元素被添加到ribbonBar 2.接着删除该元素,执行apply,由于先simplify,那么添加和删除相互抵消, 再apply时,元素将无法从ribbonBar中删除
在文件 ribboncustomizewidget.cpp 第 787 行定义.
| void QxRibbon::RibbonCustomizeWidget::clear | ( | ) |
| void QxRibbon::RibbonCustomizeWidget::fromXml | ( | const QString & | xmlpath | ) |
从xml中加载QList<RibbonCustomizeData>
对于基于配置文件的设置,对话框显示前建议调用此函数,保证叠加设置的正确记录
| xmlpath |
在文件 ribboncustomizewidget.cpp 第 889 行定义.
| void QxRibbon::RibbonCustomizeWidget::fromXml | ( | QXmlStreamReader * | xml | ) |
从xml中加载QList<RibbonCustomizeData>
对于基于配置文件的设置,对话框显示前建议调用此函数,保证叠加设置的正确记录
| xml |
在文件 ribboncustomizewidget.cpp 第 874 行定义.
|
static |
应用xml配置
| xml | |
| bar | |
| mgr |
在文件 ribboncustomizewidget.cpp 第 925 行定义.
| bool QxRibbon::RibbonCustomizeWidget::isChanged | ( | ) | const |
在文件 ribboncustomizewidget.cpp 第 731 行定义.
|
protected |
|
protected |
|
protected |
在文件 ribboncustomizewidget.cpp 第 1059 行定义.
|
protected |
在文件 ribboncustomizewidget.cpp 第 1074 行定义.
|
protected |
|
protected |
| const QStandardItemModel * QxRibbon::RibbonCustomizeWidget::model | ( | ) | const |
| void QxRibbon::RibbonCustomizeWidget::onComboBoxActionIndexCurrentIndexChanged | ( | int | index | ) |
在文件 ribboncustomizewidget.cpp 第 1088 行定义.
| void QxRibbon::RibbonCustomizeWidget::onItemChanged | ( | QStandardItem * | item | ) |
在文件 ribboncustomizewidget.cpp 第 1434 行定义.
| void QxRibbon::RibbonCustomizeWidget::onLineEditSearchActionTextEdited | ( | const QString & | text | ) |
在文件 ribboncustomizewidget.cpp 第 1451 行定义.
| void QxRibbon::RibbonCustomizeWidget::onListViewSelectClicked | ( | const QModelIndex & | index | ) |
在文件 ribboncustomizewidget.cpp 第 1302 行定义.
| void QxRibbon::RibbonCustomizeWidget::onPushButtonAddClicked | ( | ) |
在文件 ribboncustomizewidget.cpp 第 1223 行定义.
| void QxRibbon::RibbonCustomizeWidget::onPushButtonDeleteClicked | ( | ) |
在文件 ribboncustomizewidget.cpp 第 1259 行定义.
| void QxRibbon::RibbonCustomizeWidget::onPushButtonNewGroupClicked | ( | ) |
在文件 ribboncustomizewidget.cpp 第 1132 行定义.
| void QxRibbon::RibbonCustomizeWidget::onPushButtonNewPageClicked | ( | ) |
在文件 ribboncustomizewidget.cpp 第 1100 行定义.
| void QxRibbon::RibbonCustomizeWidget::onPushButtonRenameClicked | ( | ) |
在文件 ribboncustomizewidget.cpp 第 1183 行定义.
| void QxRibbon::RibbonCustomizeWidget::onPushButtonResetClicked | ( | ) |
在文件 ribboncustomizewidget.cpp 第 1456 行定义.
| void QxRibbon::RibbonCustomizeWidget::onRadioButtonGroupButtonClicked | ( | QAbstractButton * | b | ) |
在文件 ribboncustomizewidget.cpp 第 1095 行定义.
| void QxRibbon::RibbonCustomizeWidget::onToolButtonDownClicked | ( | ) |
在文件 ribboncustomizewidget.cpp 第 1380 行定义.
| void QxRibbon::RibbonCustomizeWidget::onToolButtonUpClicked | ( | ) |
在文件 ribboncustomizewidget.cpp 第 1336 行定义.
| void QxRibbon::RibbonCustomizeWidget::onTreeViewResultClicked | ( | const QModelIndex & | index | ) |
在文件 ribboncustomizewidget.cpp 第 1311 行定义.
|
protected |
在文件 ribboncustomizewidget.cpp 第 1079 行定义.
|
protected |
获取listview中选中的action
在文件 ribboncustomizewidget.cpp 第 963 行定义.
|
protected |
|
protected |
获取选中的ribbon tree 的level
在文件 ribboncustomizewidget.cpp 第 1005 行定义.
|
protected |
|
protected |
| void QxRibbon::RibbonCustomizeWidget::setupActionsManager | ( | RibbonActionsManager * | mgr | ) |
|
protected |
精简
在文件 ribboncustomizewidget.cpp 第 944 行定义.
| bool QxRibbon::RibbonCustomizeWidget::toXml | ( | const QString & | xmlpath | ) | const |
| bool QxRibbon::RibbonCustomizeWidget::toXml | ( | QXmlStreamWriter * | xml | ) | const |
转换为xml
此函数仅会写element,不会写document相关内容,因此如果需要写document, 需要在此函数前调用QXmlStreamWriter::writeStartDocument(),在此函数后调用QXmlStreamWriter::writeEndDocument()
在文件 ribboncustomizewidget.cpp 第 832 行定义.
| void QxRibbon::RibbonCustomizeWidget::updateModel | ( | ) |
根据当前的radiobutton选项来更新model
在文件 ribboncustomizewidget.cpp 第 748 行定义.
| void QxRibbon::RibbonCustomizeWidget::updateModel | ( | RibbonTreeShowType | type | ) |
更新model
在文件 ribboncustomizewidget.cpp 第 767 行定义.