单选按钮。
当你需要提供多个选项给用户选择,让用户只能从中选择其一时,你可以创建一个 GCtrlRadioButtonGroup 对象作为一个选项组;选项组可以包含任意数目的选项 GCtrlRadioButton ;如果没有选项组,选项将无法显示。
更多...
#include <gCtrlRadioButtonGroup.h>
继承自 GMCtrlItem .
|
| | GCtrlRadioButton (const GString &str, GCtrlForm *frm, GCtrlRadioButtonGroup *parent=0, const char *name=0, bool check=false) |
| | 使用指定的文字标题 str 构造一个单选按钮 更多...
|
| |
| virtual | ~GCtrlRadioButton () |
| |
| bool | isChecked () |
| | 返回该单选按钮是否被选中 更多...
|
| |
| virtual bool | isCtrlItem () |
| | 是否可以接收输入事件 更多...
|
| |
| bool | isFocusEnabled () |
| | 获取焦点是否被禁用;焦点被禁用后,此元素将不能获得焦点 ,不能处理各种输入事件。 更多...
|
| |
| void | setFocusEnabled (bool b) |
| | 设置是否禁此元素的焦点;焦点被禁用后,此元素将不能获得焦点 ,不能处理各种输入事件。 更多...
|
| |
| void | setFocus () |
| | 设置此元素到有焦点状态 更多...
|
| |
| bool | hasFocus () |
| | 返回此元素是否具有焦点 更多...
|
| |
| void | setTabIndex (unsigned int index) |
| | 设置此界面元素的tab index;在使用键盘来操作界面时,需要用到tab index 更多...
|
| |
| unsigned int | tabIndex () |
| | 获取此界面元素的tab index;在使用键盘来操作界面时,需要用到tab index 更多...
|
| |
| virtual void | hide () |
| | 隐藏此界面元素。相当于:
更多...
|
| |
| bool | fwKeyPress (GKeyEvent *e) |
| |
| bool | fwMousePress (GMouseEvent *e) |
| |
| bool | fwTap (GTapEvent *e) |
| |
| bool | fwSwipe (GSwipeEvent *e) |
| |
| bool | fwGestureScroll (GGestureScrollEvent *e) |
| |
| void | setX (int x) |
| | 设置此界面元素的x坐标 更多...
|
| |
| void | setY (int y) |
| | 设置此界面元素的y坐标 更多...
|
| |
| void | setZ (int z) |
| | 设置此界面元素的z坐标 更多...
|
| |
| void | setWidth (int w) |
| | 设置此界面元素的宽度 更多...
|
| |
| void | setHeight (int h) |
| | 设置此界面元素的高度 更多...
|
| |
| int | x () const |
| | 获取此界面元素的x坐标 更多...
|
| |
| int | y () const |
| | 获取此界面元素的y坐标 更多...
|
| |
| int | z () const |
| | 获取此界面元素的z坐标 更多...
|
| |
| int | width () const |
| | 获取此界面元素的宽度 更多...
|
| |
| int | height () const |
| | 获取此界面元素的高度 更多...
|
| |
| int | right () const |
| | 获取右边界的坐标 更多...
|
| |
| int | bottom () const |
| | 获取下边界的坐标 更多...
|
| |
| GRect | rect () const |
| | 获取此界面元素所占用的矩形区域 更多...
|
| |
| void | setPosition (int x, int y) |
| | 设置此界面元素的位置 更多...
|
| |
| void | setSize (int w, int h) |
| | 设置此界面元素的大小 更多...
|
| |
| void | setSize (const GSize &s) |
| | 设置此界面元素的大小 更多...
|
| |
| void | setGeometry (int x, int y, int w, int h) |
| | 设置此界面元素所占用的矩形区域,位置及大小 更多...
|
| |
| void | moveBy (int x, int y) |
| | 移动此界面元素;将此界面元素沿X轴移动 x 像素,沿Y轴移动 y 像素 更多...
|
| |
| void | setPaletteBackgroundColor (const GColor &c) |
| | 设置此界面元素的背景颜色 更多...
|
| |
| void | loadBackgroundPixmap (const uint16_t imgID) |
| | 加载一个图片作为此界面元素的背景 更多...
|
| |
| bool | isVisible () |
| | 返回此界面元素当前是否可见;show() 之后可见, hide() 之后不可见 更多...
|
| |
| void | setVisible (bool b) |
| | 设置此界面元素是否可见;(用户改变此界面元素的可见属性之后,需要调用 update() 或 repaint() ) 更多...
|
| |
| virtual void | show () |
| | 显示此界面元素。相当于:
更多...
|
| |
| virtual bool | isContainerItem () |
| |
| GCtrlForm * | form () |
| | 获取此界面元素所在的窗体 更多...
|
| |
| void | update () |
| | 更新此界面元素所在的矩形区域;这个函数不会立刻进行重新绘制——而是发送一个绘制事件到事件循环中,后续,事件循环会分发、处理该绘制事件。这样能得到比调用 repaint() 更快的速度和更少的闪烁。 更多...
|
| |
| virtual void | draw () |
| |
| QCtrlDefaultAppStyle * | getDefaultAppStyle () |
| |
| virtual bool | isComplex () |
| |
| const char * | name () const |
| | 获取对象名称 更多...
|
| |
| GObject * | parent () const |
| | 获取对象的parent 更多...
|
| |
| virtual bool | event (GEvent *) |
| | 开发者可以在子类中覆盖此函数,处理自己需要的事件 更多...
|
| |
|
| template<class Receiver , typename... Args> |
| static int | connect (GObject *sender, GSignal< void(Args...)> &signal, Receiver *receiver, void(Receiver::*SlotFunc)(Args...)) |
| | 将信号和槽建立连接。
Receiver代表接收者的类型 Args是槽函数/信号的参数列表。 更多...
|
| |
| template<class Receiver , typename... Args> |
| static int | disconnect (GObject *sender, GSignal< void(Args...)> &signal, Receiver *receiver, void(Receiver::*SlotFunc)(Args...)) |
| | 将信号和槽断开连接。
Receiver代表接收者的类型 Args是槽函数/信号的参数列表。 更多...
|
| |
| static bool | isObjectExist (GObject *obj) |
| | 判断对象是否已经被析构掉了。 更多...
|
| |
单选按钮。
当你需要提供多个选项给用户选择,让用户只能从中选择其一时,你可以创建一个 GCtrlRadioButtonGroup 对象作为一个选项组;选项组可以包含任意数目的选项 GCtrlRadioButton ;如果没有选项组,选项将无法显示。
使用指定的文字标题 str 构造一个单选按钮
- 参数
-
| str | 文字标题 |
| frm | ... |
| parent | ... |
| name | ... |
| check | true表示该单选按钮为选中状态,false表示该单选按钮为取消选中状态 |
| virtual GCtrlRadioButton::~GCtrlRadioButton |
( |
| ) |
|
|
virtual |
| int GMItem::bottom |
( |
| ) |
const |
|
inherited |
template<class Receiver , typename... Args>
| int GObject::connect |
( |
GObject * |
sender, |
|
|
GSignal< void(Args...)> & |
signal, |
|
|
Receiver * |
receiver, |
|
|
void(Receiver::*)(Args...) |
SlotFunc |
|
) |
| |
|
staticinherited |
将信号和槽建立连接。
Receiver代表接收者的类型 Args是槽函数/信号的参数列表。
- 参数
-
| sender | 指向发射者的指针 |
| signal | 指向信号的引用。 |
| receiver | 指向接收者的指针 |
| SlotFunc | 指向槽函数的指针 |
- 返回
- 0代表成功;非0代表失败
template<class Receiver , typename... Args>
| int GObject::disconnect |
( |
GObject * |
sender, |
|
|
GSignal< void(Args...)> & |
signal, |
|
|
Receiver * |
receiver, |
|
|
void(Receiver::*)(Args...) |
SlotFunc |
|
) |
| |
|
staticinherited |
将信号和槽断开连接。
Receiver代表接收者的类型 Args是槽函数/信号的参数列表。
- 参数
-
| sender | 指向发射者的指针 |
| signal | 指向信号的引用。 |
| receiver | 指向接收者的指针 |
| SlotFunc | 指向槽函数的指针 |
- 返回
- 0代表成功;非0代表失败
| virtual void GMItem::draw |
( |
| ) |
|
|
virtualinherited |
| virtual bool GObject::event |
( |
GEvent * |
| ) |
|
|
virtualinherited |
获取此界面元素所在的窗体
- 返回
- GCtrlForm*
|
|
protectedvirtualinherited |
| virtual bool GCtrlRadioButton::fwKeyPressEvent |
( |
GKeyEvent * |
| ) |
|
|
protectedvirtual |
| virtual bool GCtrlRadioButton::fwMousePressEvent |
( |
GMouseEvent * |
| ) |
|
|
protectedvirtual |
| virtual bool GMCtrlItem::fwSwipeEvent |
( |
GSwipeEvent * |
| ) |
|
|
protectedvirtualinherited |
| virtual bool GCtrlRadioButton::fwTapEvent |
( |
GTapEvent * |
| ) |
|
|
protectedvirtual |
|
|
protectedvirtualinherited |
用户可以在子类中覆盖这个函数处理滑动手势。用户不可以覆盖任何以fw开头的函数
- 参数
-
- 返回
- bool
| QCtrlDefaultAppStyle* GMItem::getDefaultAppStyle |
( |
| ) |
|
|
inherited |
| bool GMCtrlItem::hasFocus |
( |
| ) |
|
|
inherited |
| int GMItem::height |
( |
| ) |
const |
|
inherited |
| virtual void GMCtrlItem::hide |
( |
| ) |
|
|
virtualinherited |
| bool GCtrlRadioButton::isChecked |
( |
| ) |
|
| virtual bool GMItem::isComplex |
( |
| ) |
|
|
virtualinherited |
| virtual bool GMItem::isContainerItem |
( |
| ) |
|
|
virtualinherited |
| virtual bool GMCtrlItem::isCtrlItem |
( |
| ) |
|
|
virtualinherited |
| bool GMCtrlItem::isFocusEnabled |
( |
| ) |
|
|
inherited |
获取焦点是否被禁用;焦点被禁用后,此元素将不能获得焦点 ,不能处理各种输入事件。
- 返回
- bool
| static bool GObject::isObjectExist |
( |
GObject * |
obj | ) |
|
|
staticinherited |
判断对象是否已经被析构掉了。
- 参数
-
- 返回
- bool true表示对象健在,false表示对象已经被析构掉了
| bool GMItem::isVisible |
( |
| ) |
|
|
inherited |
返回此界面元素当前是否可见;show() 之后可见, hide() 之后不可见
- 返回
- bool
| virtual bool GMCtrlItem::keyPressEvent |
( |
GKeyEvent * |
| ) |
|
|
protectedvirtualinherited |
用户可以在子类中覆盖这个函数处理按键。用户不可以覆盖任何以fw开头的函数
- 参数
-
- 返回
- bool
| void GMItem::loadBackgroundPixmap |
( |
const uint16_t |
imgID | ) |
|
|
inherited |
加载一个图片作为此界面元素的背景
- 参数
-
- 返回
- void
| virtual bool GMCtrlItem::mousePressEvent |
( |
GMouseEvent * |
| ) |
|
|
protectedvirtualinherited |
用户可以在子类中覆盖这个函数处理鼠标事件。用户不可以覆盖任何以fw开头的函数
- 参数
-
- 返回
- bool
| void GMItem::moveBy |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
inherited |
移动此界面元素;将此界面元素沿X轴移动 x 像素,沿Y轴移动 y 像素
- 参数
-
- 返回
- void
| const char* GObject::name |
( |
| ) |
const |
|
inherited |
| virtual void GCtrlRadioButton::paintEvent |
( |
| ) |
|
|
protectedvirtual |
| GRect GMItem::rect |
( |
| ) |
const |
|
inherited |
| int GMItem::right |
( |
| ) |
const |
|
inherited |
| void GMCtrlItem::setFocus |
( |
| ) |
|
|
inherited |
| void GMCtrlItem::setFocusEnabled |
( |
bool |
b | ) |
|
|
inherited |
设置是否禁此元素的焦点;焦点被禁用后,此元素将不能获得焦点 ,不能处理各种输入事件。
- 参数
-
- 返回
- void
| void GMItem::setGeometry |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
w, |
|
|
int |
h |
|
) |
| |
|
inherited |
设置此界面元素所占用的矩形区域,位置及大小
- 参数
-
- 返回
- void
| void GMItem::setHeight |
( |
int |
h | ) |
|
|
inherited |
| void GMItem::setPaletteBackgroundColor |
( |
const GColor & |
c | ) |
|
|
inherited |
| void GMItem::setPosition |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
inherited |
| void GMItem::setSize |
( |
int |
w, |
|
|
int |
h |
|
) |
| |
|
inherited |
| void GMItem::setSize |
( |
const GSize & |
s | ) |
|
|
inherited |
| void GMCtrlItem::setTabIndex |
( |
unsigned int |
index | ) |
|
|
inherited |
设置此界面元素的tab index;在使用键盘来操作界面时,需要用到tab index
- 参数
-
- 返回
- void
| void GMItem::setVisible |
( |
bool |
b | ) |
|
|
inherited |
设置此界面元素是否可见;(用户改变此界面元素的可见属性之后,需要调用 update() 或 repaint() )
- 参数
-
- 返回
- void
| void GMItem::setWidth |
( |
int |
w | ) |
|
|
inherited |
| void GMItem::setX |
( |
int |
x | ) |
|
|
inherited |
| void GMItem::setY |
( |
int |
y | ) |
|
|
inherited |
| void GMItem::setZ |
( |
int |
z | ) |
|
|
inherited |
| virtual void GMItem::show |
( |
| ) |
|
|
virtualinherited |
显示此界面元素。相当于:
setVisible (true);
update();
- 返回
- void
|
|
protectedvirtualinherited |
用户可以在子类中覆盖这个函数处理滑动事件。用户不可以覆盖任何以fw开头的函数
- 参数
-
- 返回
- bool
| unsigned int GMCtrlItem::tabIndex |
( |
| ) |
|
|
inherited |
获取此界面元素的tab index;在使用键盘来操作界面时,需要用到tab index
- 返回
- unsigned int
| virtual bool GMCtrlItem::tapEvent |
( |
GTapEvent * |
| ) |
|
|
protectedvirtualinherited |
用户可以在子类中覆盖这个函数处理点击事件。用户不可以覆盖任何以fw开头的函数
- 参数
-
- 返回
- bool
更新此界面元素所在的矩形区域;这个函数不会立刻进行重新绘制——而是发送一个绘制事件到事件循环中,后续,事件循环会分发、处理该绘制事件。这样能得到比调用 repaint() 更快的速度和更少的闪烁。
- 返回
- void
| int GMItem::width |
( |
| ) |
const |
|
inherited |
| GSignal<void(void)> GCtrlRadioButton::checkedChanged |
当本按钮被选中、或者被取消选中时,该信号将立即发射。注意:初始状态下(程序刚启动时),将不会发射此信号。
| GSignal<void(void)> GMCtrlItem::getFocus |
|
inherited |
| GSignal<void(void)> GMCtrlItem::loseFocus |
|
inherited |
| GSignal<void(void)> GObject::sigDestroyed |
|
inherited |
该类的文档由以下文件生成: