C++ (Qt)#include "widget.h"#include "ui_widget.h" //QTimer* myTimer = new QTimer(); Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget){ ui->setupUi(this); ui->lcdNumber->setNumDigits(8); QTimer* myTimer = new QTimer(); QObject::connect(ui->pushButton_1, SIGNAL(clicked()), this, SLOT(MyEventButton_1())); QObject::connect(ui->pushButton_2, SIGNAL(clicked()), this, SLOT(MyEventButton_2())); QObject::connect(myTimer, SIGNAL(timeout()), this, SLOT(MyEventHandlerTimer()));} Widget::~Widget(){ delete myTimer; delete ui;} ......