SARibbon 2.2.3
SARibbon wiki
载入中...
搜索中...
未找到
SARibbonGallery类 参考

Gallery控件 更多...

#include <SARibbonGallery.h>

类 SARibbonGallery 继承关系图:

class  PrivateData
 The SARibbonGalleryPrivate class 更多...
 

Public 槽

virtual void pageUp ()
 下翻页
 
virtual void pageDown ()
 上翻页
 
virtual void showMoreDetail ()
 显示更多触发,默认弹出内部管理的SARibbonGalleryViewport,用户可重载此函数实现自定义的弹出
 

信号

void triggered (QAction *action)
 转发管理的SARibbonGalleryGroup::triggered 所有加入SARibbonGallery的action都会被一个QActionGroup管理,可以通过
 
void hovered (QAction *action)
 转发管理的SARibbonGalleryGroup::hovered
 

Public 成员函数

 SARibbonGallery (QWidget *parent=0)
 
virtual QSize sizeHint () const Q_DECL_OVERRIDE
 
SARibbonGalleryGroupaddGalleryGroup ()
 获取一个空白SARibbonGalleryGroup
 
void addGalleryGroup (SARibbonGalleryGroup *group)
 添加一组SARibbonGalleryGroup
 
SARibbonGalleryGroupaddCategoryActions (const QString &title, QList< QAction * > actions)
 添加一组actions
 
void setCurrentViewGroup (SARibbonGalleryGroup *group)
 
SARibbonGalleryGroupcurrentViewGroup () const
 
SARibbonGalleryViewportgetPopupViewPort () const
 获取弹出窗口
 

静态 Public 成员函数

static void setGalleryButtonMaximumWidth (int w)
 设置最右边三个控制按钮的最大宽度(默认15)
 

Protected 槽

void onItemClicked (const QModelIndex &index)
 
virtual void onTriggered (QAction *action)
 

Protected 成员函数

void resizeEvent (QResizeEvent *event) Q_DECL_OVERRIDE
 
void paintEvent (QPaintEvent *event) Q_DECL_OVERRIDE
 

详细描述

Gallery控件

Gallery控件是由一个当前激活的

参见
SARibbonGalleryGroup 和弹出的
SARibbonGalleryViewport 组成
SARibbonGalleryGroup 是继承
QListView actions通过icon展示出来,相关的属性可以按照QListView设置
SARibbonGalleryViewport 是一个内部有垂直布局的窗体,在弹出激活时,把管理的SARibbonGalleryGroup都展示出来

示例如下:

SARibbonGallery* gallery = pannel1->addGallery();
QList< QAction* > galleryActions;
...create many actions ...
SARibbonGalleryGroup* group1 = gallery->addCategoryActions(tr("Files"), galleryActions);
galleryActions.clear();
...create many actions ...
gallery->addCategoryActions(tr("Apps"), galleryActions);
gallery->setCurrentViewGroup(group1);

成员函数说明

◆ addCategoryActions()

SARibbonGalleryGroup * SARibbonGallery::addCategoryActions ( const QString & title,
QList< QAction * > actions )

添加一组actions

参数
titleactions组的名字
actions
返回
返回SARibbonGalleryGroup,用户可以通过修改SARibbonGalleryGroup属性控制其显示方法

◆ addGalleryGroup() [1/2]

SARibbonGalleryGroup * SARibbonGallery::addGalleryGroup ( )

获取一个空白SARibbonGalleryGroup

返回

◆ addGalleryGroup() [2/2]

void SARibbonGallery::addGalleryGroup ( SARibbonGalleryGroup * group)

添加一组SARibbonGalleryGroup

参数
group

◆ getPopupViewPort()

SARibbonGalleryViewport * SARibbonGallery::getPopupViewPort ( ) const

获取弹出窗口

返回

◆ hovered

void SARibbonGallery::hovered ( QAction * action)
signal

转发管理的SARibbonGalleryGroup::hovered

注解
此属性需要确保SARibbonGalleryGroup::setMouseTracking(true)
参数
action

◆ setGalleryButtonMaximumWidth()

void SARibbonGallery::setGalleryButtonMaximumWidth ( int w)
static

设置最右边三个控制按钮的最大宽度(默认15)

参数
w

◆ triggered

void SARibbonGallery::triggered ( QAction * action)
signal

转发管理的SARibbonGalleryGroup::triggered 所有加入SARibbonGallery的action都会被一个QActionGroup管理,可以通过

参见
getActionGroup 获取到对应的actiongroup
参数
action

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