Friday

Qt C++: Solution for “error: variable 'QPointer label' has initializer but incomplete type”

Qt C++: Solution for “error: variable 'QPointer<QLabel> label' has initializer but incomplete type”

C++ Code with Error message:

void MainWindow::on_pushButton_clicked()
{
  QPointer<QLabel> label = ui->label1;

  label->setText("Label 1 text changed");
}

Solution:

You need to include the “#include <QPointer>“ at the top section in this implementation file.
 

No comments:

If a hater attacked your age and not the goodness of you

Whether young or old, I've always been known what endures. I've known the very idea of people that were all created equal and deserv...