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:
createSLabel();
createSLabel();
To copy to clipboard, switch view to plain text mode
This is the createSLabel function:
void MainWindow::createLLabel()
{
localLabel
= new QLabel(tr
("Local view"), centralWidget
);
localLabel->setAlignment(Qt::AlignCenter);
}
void MainWindow::createLLabel()
{
localLabel = new QLabel(tr("Local view"), centralWidget);
localLabel->setAlignment(Qt::AlignCenter);
}
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?
Bookmarks