C:\Projects\QTProjects\SampleProject\mainsample.cpp:18: 错误:'class QPlainTextEdit' 没有名为'text' 的成员
#include "mainsample.h"
#include "ui_mainsample.h"
MainSample::MainSample(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainSample)
{
ui->setupUi(this);
}
MainSample::~MainSample()
{
delete ui;
}
void MainSample::on_pushButton_clicked()
{
ui->TxtAns->text(TxtFnum->text().toInt() + ui->TxtSnum->text().toInt());
}
似乎是什么问题?