0

I keep getting an error when using: ui->setupUi(this) error If anyone knows what the error might be, I would be very grateful.

MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
   ui->setupUi(this); // This is where the error occurs 
   scanningNow = false;
   setBackground = false;
   displayRef = false;
   fileName = "NIR Spectra";
   initCalib();
   initSettings();

   initUI();
   USB_Init();

   emit checkUSB();

   #ifdef USB_POLL_ENABLED
      usbPollTimer = new QTimer(this);
      usbPollTimer -> setInterval(5000);
      connect(usbPollTimer, SIGNAL(timeout()), this, SLOT(timerTimeout()));
      usbPollTimer -> start();
   #endif

}

The error is: 'cannot initialize object parameter of type 'Ui_MainWindow' with an expression of type 'Ui::MainWindow'

John Smith
  • 31
  • 1
  • 6

0 Answers0