窗体、窗口、window;GUI软件由若干个窗口组成, GCtrlForm 类代表窗口;窗口可以包含任意数目的控件 GMItem ;如果没有窗口,控件将无法显示。
更多...
#include <gCtrlForm.h>
继承自 GObject .
被 GCtrlMsgBox 继承.
|
| 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) |
| | 判断对象是否已经被析构掉了。 更多...
|
| |
窗体、窗口、window;GUI软件由若干个窗口组成, GCtrlForm 类代表窗口;窗口可以包含任意数目的控件 GMItem ;如果没有窗口,控件将无法显示。
在处理键盘按键事件时,窗体能够管理控件焦点,管理控件焦点的模式有手动、自动两种
| 枚举值 |
|---|
| Auto_Focus |
由窗体自动管理控件焦点,窗体会使用键盘的上下左右方向键来自动切换控件焦点
|
| Manual_Focus |
由用户来管理控件焦点,用户须自己处理事件,调用控件的 GMCtrlItem::setFocus 等焦点管理函数
|
| GCtrlForm::GCtrlForm |
( |
GCtrlForm * |
parent = 0, |
|
|
const char * |
name = 0 |
|
) |
| |
| virtual GCtrlForm::~GCtrlForm |
( |
| ) |
|
|
virtual |
| void GCtrlForm::appendItem |
( |
GMItem * |
| ) |
|
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 bool GObject::event |
( |
GEvent * |
| ) |
|
|
virtualinherited |
| DLL_LOCAL QCtrlDefaultAppStyle* GCtrlForm::getDefaultAppStyle |
( |
| ) |
|
获取默认的app style
- 返回
- QCtrlDefaultAppStyle*
| void GCtrlForm::getFocus |
( |
| ) |
|
返回当前具有焦点的控件
- 返回
- GMCtrlItem*
| bool GCtrlForm::hasFocus |
( |
| ) |
|
| int GCtrlForm::height |
( |
| ) |
const |
| virtual void GCtrlForm::hide |
( |
| ) |
|
|
virtual |
隐藏窗体。相当于:
setVisible (false);
update();
- 返回
- void
| bool GCtrlForm::isFocusEnabled |
( |
| ) |
|
获取窗体焦点是否被禁用;窗体焦点被禁用后,窗体将不能获得焦点 ,不能处理各种输入事件。
- 返回
- bool
| static bool GObject::isObjectExist |
( |
GObject * |
obj | ) |
|
|
staticinherited |
判断对象是否已经被析构掉了。
- 参数
-
- 返回
- bool true表示对象健在,false表示对象已经被析构掉了
| bool GCtrlForm::isVisible |
( |
| ) |
|
返回窗体当前是否可见;show() 之后可见, hide() 之后不可见
- 返回
- bool
| virtual bool GCtrlForm::keyPressEvent |
( |
GKeyEvent * |
| ) |
|
|
protectedvirtual |
| void GCtrlForm::loadBackgroundPixmap |
( |
const uint16_t |
imgID | ) |
|
| void GCtrlForm::loadBackgroundPixmap |
( |
const GImage & |
px | ) |
|
| void GCtrlForm::loseFocus |
( |
| ) |
|
| void GCtrlForm::moveBy |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
移动窗体;将窗体沿X轴移动 x 像素,沿Y轴移动 y 像素
- 参数
-
- 返回
- void
| const char* GObject::name |
( |
| ) |
const |
|
inherited |
| virtual void GCtrlForm::paintEvent |
( |
| ) |
|
|
virtual |
| GRect GCtrlForm::rect |
( |
| ) |
const |
| void GCtrlForm::repaint |
( |
GRect |
r | ) |
|
更新给定的矩形区域;这个函数会立刻进行重新绘制。
- 参数
-
- 返回
- void
| void GCtrlForm::repaint |
( |
| ) |
|
更新窗体所在的矩形区域;这个函数会立刻进行重新绘制
- 返回
- void
| void GCtrlForm::setFocus |
( |
| ) |
|
让窗体获得焦点;窗体获得焦点后,能够接收到各种输入事件(比如键盘、鼠标、触摸等输入事件)
- 返回
- void
| void GCtrlForm::setFocusEnabled |
( |
bool |
b | ) |
|
设置是否禁用窗体的焦点;窗体焦点被禁用后,窗体将不能获得焦点 ,不能处理各种输入事件。
- 参数
-
- 返回
- void
设置窗体处理键盘事件时所使用的控件焦点模式
- 参数
-
- 返回
- void
| void GCtrlForm::setGeometry |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
w, |
|
|
int |
h |
|
) |
| |
设置窗体所占用的矩形区域,位置及大小
- 参数
-
- 返回
- void
| void GCtrlForm::setHeight |
( |
int |
h | ) |
|
| void GCtrlForm::setPaletteBackgroundColor |
( |
const GColor & |
c | ) |
|
| void GCtrlForm::setPosition |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
| void GCtrlForm::setSize |
( |
int |
w, |
|
|
int |
h |
|
) |
| |
| void GCtrlForm::setVisible |
( |
bool |
b | ) |
|
| void GCtrlForm::setWidth |
( |
int |
w | ) |
|
| void GCtrlForm::setX |
( |
int |
x | ) |
|
| void GCtrlForm::setY |
( |
int |
y | ) |
|
| void GCtrlForm::setZ |
( |
int |
z | ) |
|
| virtual void GCtrlForm::show |
( |
| ) |
|
|
virtual |
显示窗体。相当于:
setVisible (true);
update();
- 返回
- void
| virtual bool GCtrlForm::tapEvent |
( |
GTapEvent * |
| ) |
|
|
protectedvirtual |
| void GCtrlForm::update |
( |
GRect |
r | ) |
|
更新给定的矩形区域;这个函数不会立刻进行重新绘制——而是发送一个绘制事件到事件循环中,后续,事件循环会分发、处理该绘制事件。这样能得到比调用 repaint() 更快的速度和更少的闪烁。
- 参数
-
- 返回
- void
| void GCtrlForm::update |
( |
| ) |
|
更新窗体所在的矩形区域;这个函数不会立刻进行重新绘制——而是发送一个绘制事件到事件循环中,后续,事件循环会分发、处理该绘制事件。这样能得到比调用 repaint() 更快的速度和更少的闪烁。
- 返回
- void
| int GCtrlForm::width |
( |
| ) |
const |
| int GCtrlForm::x |
( |
| ) |
const |
| int GCtrlForm::y |
( |
| ) |
const |
| int GCtrlForm::z |
( |
| ) |
const |
| GSignal<void(void)> GObject::sigDestroyed |
|
inherited |
该类的文档由以下文件生成: