Giveda® Embedded Midware  1.2.0
本文档受《版权法》、《版权公约》保护。深圳技达®版权所有
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义 
Public 成员函数 | 静态 Public 成员函数 | Public 属性 | Protected 成员函数 | 友元 | 所有成员列表
GCtrlRadioButton类 参考

单选按钮。
当你需要提供多个选项给用户选择,让用户只能从中选择其一时,你可以创建一个 GCtrlRadioButtonGroup 对象作为一个选项组;选项组可以包含任意数目的选项 GCtrlRadioButton ;如果没有选项组,选项将无法显示。 更多...

#include <gCtrlRadioButtonGroup.h>

继承自 GMCtrlItem .

Public 成员函数

 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 ()
 
GCtrlFormform ()
 获取此界面元素所在的窗体 更多...
 
void update ()
 更新此界面元素所在的矩形区域;这个函数不会立刻进行重新绘制——而是发送一个绘制事件到事件循环中,后续,事件循环会分发、处理该绘制事件。这样能得到比调用 repaint() 更快的速度和更少的闪烁。 更多...
 
virtual void draw ()
 
QCtrlDefaultAppStyle * getDefaultAppStyle ()
 
virtual bool isComplex ()
 
const char * name () const
 获取对象名称 更多...
 
GObjectparent () const
 获取对象的parent 更多...
 
virtual bool event (GEvent *)
 开发者可以在子类中覆盖此函数,处理自己需要的事件 更多...
 

静态 Public 成员函数

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)
 判断对象是否已经被析构掉了。 更多...
 

Public 属性

GSignal< void(void)> checkedChanged
 当本按钮被选中、或者被取消选中时,该信号将立即发射。注意:初始状态下(程序刚启动时),将不会发射此信号。 更多...
 
GSignal< void(void)> loseFocus
 当此元素失去焦点时,会立即发射此信号 更多...
 
GSignal< void(void)> getFocus
 当此元素获得焦点时,会立即发射此信号 更多...
 
GSignal< void(void)> sigDestroyed
 当对象被析构时,会发射此信号 更多...
 

Protected 成员函数

virtual bool fwKeyPressEvent (GKeyEvent *)
 
virtual void paintEvent ()
 
virtual bool fwMousePressEvent (GMouseEvent *)
 
virtual bool fwTapEvent (GTapEvent *)
 
virtual bool keyPressEvent (GKeyEvent *)
 用户可以在子类中覆盖这个函数处理按键。用户不可以覆盖任何以fw开头的函数 更多...
 
virtual bool mousePressEvent (GMouseEvent *)
 用户可以在子类中覆盖这个函数处理鼠标事件。用户不可以覆盖任何以fw开头的函数 更多...
 
virtual bool tapEvent (GTapEvent *)
 用户可以在子类中覆盖这个函数处理点击事件。用户不可以覆盖任何以fw开头的函数 更多...
 
virtual bool swipeEvent (GSwipeEvent *)
 用户可以在子类中覆盖这个函数处理滑动事件。用户不可以覆盖任何以fw开头的函数 更多...
 
virtual bool gestureScrollEvent (GGestureScrollEvent *)
 用户可以在子类中覆盖这个函数处理滑动手势。用户不可以覆盖任何以fw开头的函数 更多...
 
virtual bool fwGestureScrollEvent (GGestureScrollEvent *)
 
virtual bool fwSwipeEvent (GSwipeEvent *)
 

友元

class GCtrlRadioButtonGroup
 

详细描述

单选按钮。
当你需要提供多个选项给用户选择,让用户只能从中选择其一时,你可以创建一个 GCtrlRadioButtonGroup 对象作为一个选项组;选项组可以包含任意数目的选项 GCtrlRadioButton ;如果没有选项组,选项将无法显示。

构造及析构函数说明

GCtrlRadioButton::GCtrlRadioButton ( const GString str,
GCtrlForm frm,
GCtrlRadioButtonGroup parent = 0,
const char *  name = 0,
bool  check = false 
)

使用指定的文字标题 str 构造一个单选按钮

参数
str文字标题
frm...
parent...
name...
checktrue表示该单选按钮为选中状态,false表示该单选按钮为取消选中状态
virtual GCtrlRadioButton::~GCtrlRadioButton ( )
virtual

成员函数说明

int GMItem::bottom ( ) const
inherited

获取下边界的坐标

返回
int
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

开发者可以在子类中覆盖此函数,处理自己需要的事件

参数
...
返回
bool

GTcpSocket, GTimer, GUdpSocket , 以及 GTcpServer 重载.

GCtrlForm* GMItem::form ( )
inherited

获取此界面元素所在的窗体

返回
GCtrlForm*
bool GMCtrlItem::fwGestureScroll ( GGestureScrollEvent e)
inherited
virtual bool GMCtrlItem::fwGestureScrollEvent ( GGestureScrollEvent )
protectedvirtualinherited

GMProgressBar 重载.

bool GMCtrlItem::fwKeyPress ( GKeyEvent e)
inherited
virtual bool GCtrlRadioButton::fwKeyPressEvent ( GKeyEvent )
protectedvirtual

重载 GMCtrlItem .

bool GMCtrlItem::fwMousePress ( GMouseEvent e)
inherited
virtual bool GCtrlRadioButton::fwMousePressEvent ( GMouseEvent )
protectedvirtual

重载 GMCtrlItem .

bool GMCtrlItem::fwSwipe ( GSwipeEvent e)
inherited
virtual bool GMCtrlItem::fwSwipeEvent ( GSwipeEvent )
protectedvirtualinherited

GCtrlListBox 重载.

bool GMCtrlItem::fwTap ( GTapEvent e)
inherited
virtual bool GCtrlRadioButton::fwTapEvent ( GTapEvent )
protectedvirtual

重载 GMCtrlItem .

virtual bool GMCtrlItem::gestureScrollEvent ( GGestureScrollEvent )
protectedvirtualinherited

用户可以在子类中覆盖这个函数处理滑动手势。用户不可以覆盖任何以fw开头的函数

参数
...
返回
bool
QCtrlDefaultAppStyle* GMItem::getDefaultAppStyle ( )
inherited
bool GMCtrlItem::hasFocus ( )
inherited

返回此元素是否具有焦点

返回
bool
int GMItem::height ( ) const
inherited

获取此界面元素的高度

返回
int
virtual void GMCtrlItem::hide ( )
virtualinherited

隐藏此界面元素。相当于:

setVisible (false);
update();
返回
void

重载 GMItem .

bool GCtrlRadioButton::isChecked ( )

返回该单选按钮是否被选中

返回
bool
virtual bool GMItem::isComplex ( )
virtualinherited
virtual bool GMItem::isContainerItem ( )
virtualinherited

GMContainerItem 重载.

virtual bool GMCtrlItem::isCtrlItem ( )
virtualinherited

是否可以接收输入事件

返回
bool

重载 GMItem .

bool GMCtrlItem::isFocusEnabled ( )
inherited

获取焦点是否被禁用;焦点被禁用后,此元素将不能获得焦点 ,不能处理各种输入事件。

返回
bool
static bool GObject::isObjectExist ( GObject obj)
staticinherited

判断对象是否已经被析构掉了。

参数
obj...
返回
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

加载一个图片作为此界面元素的背景

参数
imgID图片的数字ID
返回
void
virtual bool GMCtrlItem::mousePressEvent ( GMouseEvent )
protectedvirtualinherited

用户可以在子类中覆盖这个函数处理鼠标事件。用户不可以覆盖任何以fw开头的函数

参数
...
返回
bool
void GMItem::moveBy ( int  x,
int  y 
)
inherited

移动此界面元素;将此界面元素沿X轴移动 x 像素,沿Y轴移动 y 像素

参数
x...
y...
返回
void
const char* GObject::name ( ) const
inherited

获取对象名称

返回
const char*
virtual void GCtrlRadioButton::paintEvent ( )
protectedvirtual

重载 GMItem .

GObject* GObject::parent ( ) const
inherited

获取对象的parent

返回
GObject*
GRect GMItem::rect ( ) const
inherited

获取此界面元素所占用的矩形区域

返回
GRect
int GMItem::right ( ) const
inherited

获取右边界的坐标

返回
int
void GMCtrlItem::setFocus ( )
inherited

设置此元素到有焦点状态

返回
bool
void GMCtrlItem::setFocusEnabled ( bool  b)
inherited

设置是否禁此元素的焦点;焦点被禁用后,此元素将不能获得焦点 ,不能处理各种输入事件。

参数
b...
返回
void
void GMItem::setGeometry ( int  x,
int  y,
int  w,
int  h 
)
inherited

设置此界面元素所占用的矩形区域,位置及大小

参数
x...
y...
w...
h...
返回
void
void GMItem::setHeight ( int  h)
inherited

设置此界面元素的高度

参数
h...
返回
void
void GMItem::setPaletteBackgroundColor ( const GColor c)
inherited

设置此界面元素的背景颜色

参数
c...
返回
void
void GMItem::setPosition ( int  x,
int  y 
)
inherited

设置此界面元素的位置

参数
x...
y...
返回
void
void GMItem::setSize ( int  w,
int  h 
)
inherited

设置此界面元素的大小

参数
w...
h...
返回
void
void GMItem::setSize ( const GSize s)
inherited

设置此界面元素的大小

参数
s...
返回
void
void GMCtrlItem::setTabIndex ( unsigned int  index)
inherited

设置此界面元素的tab index;在使用键盘来操作界面时,需要用到tab index

参数
index...
返回
void
void GMItem::setVisible ( bool  b)
inherited

设置此界面元素是否可见;(用户改变此界面元素的可见属性之后,需要调用 update() 或 repaint() )

参数
b...
返回
void
void GMItem::setWidth ( int  w)
inherited

设置此界面元素的宽度

参数
w...
返回
void
void GMItem::setX ( int  x)
inherited

设置此界面元素的x坐标

参数
x...
返回
void
void GMItem::setY ( int  y)
inherited

设置此界面元素的y坐标

参数
y...
返回
void
void GMItem::setZ ( int  z)
inherited

设置此界面元素的z坐标

参数
z...
返回
void
virtual void GMItem::show ( )
virtualinherited

显示此界面元素。相当于:

setVisible (true);
update();
返回
void
virtual bool GMCtrlItem::swipeEvent ( GSwipeEvent )
protectedvirtualinherited

用户可以在子类中覆盖这个函数处理滑动事件。用户不可以覆盖任何以fw开头的函数

参数
...
返回
bool
unsigned int GMCtrlItem::tabIndex ( )
inherited

获取此界面元素的tab index;在使用键盘来操作界面时,需要用到tab index

返回
unsigned int
virtual bool GMCtrlItem::tapEvent ( GTapEvent )
protectedvirtualinherited

用户可以在子类中覆盖这个函数处理点击事件。用户不可以覆盖任何以fw开头的函数

参数
...
返回
bool
void GMItem::update ( )
inherited

更新此界面元素所在的矩形区域;这个函数不会立刻进行重新绘制——而是发送一个绘制事件到事件循环中,后续,事件循环会分发、处理该绘制事件。这样能得到比调用 repaint() 更快的速度和更少的闪烁。

返回
void
int GMItem::width ( ) const
inherited

获取此界面元素的宽度

返回
int
int GMItem::x ( ) const
inherited

获取此界面元素的x坐标

返回
int
int GMItem::y ( ) const
inherited

获取此界面元素的y坐标

返回
int
int GMItem::z ( ) const
inherited

获取此界面元素的z坐标

返回
int

友元及相关函数文档

friend class GCtrlRadioButtonGroup
friend

类成员变量说明

GSignal<void(void)> GCtrlRadioButton::checkedChanged

当本按钮被选中、或者被取消选中时,该信号将立即发射。注意:初始状态下(程序刚启动时),将不会发射此信号。

GSignal<void(void)> GMCtrlItem::getFocus
inherited

当此元素获得焦点时,会立即发射此信号

GSignal<void(void)> GMCtrlItem::loseFocus
inherited

当此元素失去焦点时,会立即发射此信号

GSignal<void(void)> GObject::sigDestroyed
inherited

当对象被析构时,会发射此信号


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