标签对象初始显示0,每次单击标签对象后,其显示内容就加1,依次变为1、2、3等。
#ifndef DIALOG_H
#define DIALOG_H
#include <QDialog>
#include <QPushButton> //包含命令按钮类
#include "MyLabel.h"
class Dialog : public QDialog
{
Q_OBJECT
public:
Dialog(QWidget *parent = 0);
~Dialog();
private:
MyLabel* label; //定义标签
QPushButton* btn; //定义命令按钮
};
#endif // DIALOG_H