QT 记录一次窗口构造函数中访问UI控件报错问题
HomeModelTaskItem::HomeModelTaskItem(QWidget *parent, QString name, QString desc, QString date, QString url) : QWidget(parent), ui(new Ui::HomeModelTaskItem) { qDebug() << this->ui->labModelTaskName; ui->setupUi(this); }
访问控件时,必须在调用ui->setupUi(this)方法之后,在之前就会直接报错