I'm creating an application using Qt 4.7.1 and MinGW. I recently re-arranged my code into different functions, but when I try to compile my code with 'mingw32-make' this happens:

mainwindow.cpp:14: error: 'class QWidget' has no member named 'setSize'

In mainwindow.cpp on line 14 I have:

Qt Code:
  1. createSLabel();
To copy to clipboard, switch view to plain text mode 

This is the createSLabel function:

Qt Code:
  1. void MainWindow::createLLabel()
  2. {
  3. localLabel = new QLabel(tr("Local view"), centralWidget);
  4. localLabel->setAlignment(Qt::AlignCenter);
  5. }
To copy to clipboard, switch view to plain text mode 

I also have another function that's called that has exactly the same code as this but with a different QLabel, but no errors occur for that. I don't see what's wrong with my code. Why is this happening?