fork download
  1. ui->comboBox_2->addItems([]() -> QStringList {
  2. QDate date = QDate::currentDate();
  3. int current_year = date.toString("yyyy").toInt();
  4. QStringList year_list;
  5. for (int i = 0; i < 50; i++) {
  6. year_list << QString::number(current_year - (50 - i));
  7. }
  8. return year_list;
  9. });
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:1: error: 'ui' does not name a type
 ui->comboBox_2->addItems([]() -> QStringList {
 ^
prog.cpp:9:6: error: expected unqualified-id before ')' token
     });
      ^
stdout
Standard output is empty