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:

Measure execution time with Julia, example using sorting algorithms

# random integers between 1 and 100 inclusive, generate thousands of them x = rand ( 1 : 100 , 100000 ) @time sort (x; alg=InsertionSort, r...