Jon
Jon

Reputation: 2399

UI::MainWindow cannot find member

I have created a .ui file that contains several UI Item Table Widgets named houseTable, carTable, and personTable. In my cpp file, I try to reference these widgets but I get the error 'class UI::MainWindow' has no member named 'houseTable'. I am confused why this is happening when in my .ui file I have my object named 'houseTable'.

//mainwindow.cpp
ui->houseTable->setDescription("All houses:");

Upvotes: 0

Views: 6915

Answers (1)

Soumya Kundu
Soumya Kundu

Reputation: 832

#include "ui_calculatorform.h"
class CalculatorForm : public QWidget
{
   ........................
   ...........................
private:
    Ui::CalculatorForm ui;
};

CalculatorForm::CalculatorForm(QWidget *parent)
    : QWidget(parent)
{
    ui.setupUi(this);
}

If I'm not wrong these steps should help.

Upvotes: 1

Related Questions