I've been having a mysterious problem with my QTabWidget.

This is not working.
Qt Code:
  1. ui->TabWidget->setCurrentIndex(settings.value("tab_index", 1));
To copy to clipboard, switch view to plain text mode 

It throws this error:
Qt Code:
  1. error: no matching function for call to 'QTabWidget::setCurrentIndex(QVariant)
To copy to clipboard, switch view to plain text mode 

However, this code works:
Qt Code:
  1. settings.setValue("tab_index", ui->TabWidget->currentIndex());
To copy to clipboard, switch view to plain text mode