Qt学习记录---Signal

创建QObject时,我们会传递一个QObject指针作为它的父对象,此时 ,该QObject将会自动添加到它的父对象的children()列表中。Qt为了防止内存泄漏,我们创建的QObject对象如果不添加到对象树中,就会被delete。

当这个对象析构时,所有子对象都会被释放(递归式的)

添加新文件

自定义控件时,可选择Base Class。这样新建文件,Qt会自动在Qmake中添加,放止编译出错。

使用QDebug 

#include <QDebug>

...

qDebug() << 1;

...

文档:

qDebug(const char *message, ...)

Calls the message handler with the debug message message. If no message handler has been installed, the message is printed to stderr. Under Windows the message is sent to the console, if it is a console application; otherwise, it is sent to the debugger. On QNX, the message is sent to slogger2. This function does nothing if QT_NO_DEBUG_OUTPUT was defined during compilation.

If you pass the function a format string and a list of arguments, it works in similar way to the C printf() fu

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值