Customer::Customer(QWidget *parent) :
QWidget(parent),
ui(new Ui::Customer)
{
ui->setupUi(this);
ui->label->setText(tr("当前ID:%1").arg(ID));
}
你在构造函数给他值,他能得到?
你应该在 c.ID=10000后; 在调用 ui->label->setText(tr("当前ID:%1").arg(ID));他就可以了
不过说实话,你c++基础需要加强了