其他分享
首页 > 其他分享> > 对象树

对象树

作者:互联网

#include "widget.h"
#include "ui_widget.h"
#include "mypushbutton.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    MyPushButton *pushButton = new MyPushButton(this);
}
#include "mypushbutton.h"
#include "ui_mypushbutton.h"
#include <QDebug>

MyPushButton::MyPushButton(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::MyPushButton)
{
    qDebug() << "MyPushButton";

    ui->setupUi(this);
}

MyPushButton::~MyPushButton()
{
    qDebug() << "~MyPushButton";

    delete ui;
}
18:45:35: Starting ...
MyPushButton
~MyPushButton

标签:parent,对象,MyPushButton,ui,QWidget,include,mypushbutton
来源: https://www.cnblogs.com/zhangxuechao/p/16541467.html