DtkWidget 5.6.0.2
DTK Widget module
信号 | Public 成员函数 | 友元 | 所有成员列表
Dtk::Widget::DButtonBox类 参考

DButtonBox 类似于 QButtonGroup 的类. 更多...

类 Dtk::Widget::DButtonBox 继承关系图:
Inheritance graph
[图例]
Dtk::Widget::DButtonBox 的协作图:
Collaboration graph
[图例]

信号

void buttonClicked (QAbstractButton *)
 
void buttonPressed (QAbstractButton *)
 
void buttonReleased (QAbstractButton *)
 
void buttonToggled (QAbstractButton *, bool)
 

Public 成员函数

 DButtonBox (QWidget *parent=nullptr)
 DButtonBox::DButtonBox 构造函数. 更多...
 
Qt::Orientation orientation () const
 DButtonBox::orientation 返回布局方向. 更多...
 
void setOrientation (Qt::Orientation orientation)
 DButtonBox::setOrientation 设置布局方向. 更多...
 
void setButtonList (const QList< DButtonBoxButton * > &list, bool checkable)
 DButtonBox::setButtonList将按钮进添加到组中. 更多...
 
QList< QAbstractButton * > buttonList () const
 DButtonBox::buttonList. 更多...
 
QAbstractButton * checkedButton () const
 DButtonBox::checkedButton. 更多...
 
QAbstractButton * button (int id) const
 DButtonBox::button 更多...
 
void setId (QAbstractButton *button, int id)
 设置按钮 id . 更多...
 
int id (QAbstractButton *button) const
 返回按钮 id . 更多...
 
int checkedId () const
 返回已选中按钮 id . 更多...
 

友元

class DButtonBoxButton
 

详细描述

DButtonBox 类似于 QButtonGroup 的类.

\inmodule dtkwidget

DButtonBox 提供了对按钮的布局方向

示例代码
DButtonBoxButton *btn1 = new DButtonBoxButton("btn1");
DButtonBoxButton *btn2 = new DButtonBoxButton("btn2");
btn1->setIcon(QStyle::StandardPixmap::SP_ArrowUp);
box.setButtonList({btn1, btn2}, true);
DButtonBox(QWidget *parent=nullptr)
DButtonBox::DButtonBox 构造函数.
Definition: dbuttonbox.cpp:402
参见
Dtk::Widget::DButtonBoxButton

构造及析构函数说明

◆ DButtonBox()

Dtk::Widget::DButtonBox::DButtonBox ( QWidget *  parent = nullptr)
explicit

DButtonBox::DButtonBox 构造函数.

parent 参数被发送到 QWidget 构造函数

成员函数说明

◆ button()

QAbstractButton * Dtk::Widget::DButtonBox::button ( int  id) const

DButtonBox::button

id 按钮的ID,与 DButtonBox::setId 设置的参数一致.

返回
返回对应id 的按钮,不存在返回 nullptr .
参见
QButtonGroup::button()

◆ buttonList()

QList< QAbstractButton * > Dtk::Widget::DButtonBox::buttonList ( ) const

DButtonBox::buttonList.

返回
返回按钮列表.
参见
QButtonGroup::buttons()

◆ checkedButton()

QAbstractButton * Dtk::Widget::DButtonBox::checkedButton ( ) const

DButtonBox::checkedButton.

返回
返回 checked 状态的按钮.
参见
QButtonGroup::checkedButton()

◆ checkedId()

int Dtk::Widget::DButtonBox::checkedId ( ) const

返回已选中按钮 id .

返回
返回已选中按钮 id .
参见
QButtonGroup

◆ id()

int Dtk::Widget::DButtonBox::id ( QAbstractButton *  button) const

返回按钮 id .

button 对应的按钮.

参见
QButtonGroup::id()

◆ orientation()

Qt::Orientation Dtk::Widget::DButtonBox::orientation ( ) const

DButtonBox::orientation 返回布局方向.

参见
Qt::Orientation

◆ setButtonList()

void Dtk::Widget::DButtonBox::setButtonList ( const QList< DButtonBoxButton * > &  list,
bool  checkable 
)

DButtonBox::setButtonList将按钮进添加到组中.

list 存储按钮的 QList 列表 checkable 按钮是否可选中

◆ setId()

void Dtk::Widget::DButtonBox::setId ( QAbstractButton *  button,
int  id 
)

设置按钮 id .

button 用于设置 id 的按钮。

参见
QButtonGroup::setId()

◆ setOrientation()

void Dtk::Widget::DButtonBox::setOrientation ( Qt::Orientation  orientation)

DButtonBox::setOrientation 设置布局方向.

orientation

参见
Qt::Orientation

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