Hi!

I have an application that aims to resize some pictures, listed in a QTreeWidget.
If I try to do it with a loop in the MainWindow (with a large number of pictures) it causes the GUI to freeze:
Qt Code:
  1. for (int i = 0; i < ui->listTreeWidget->selectedItems().count(); i++)
  2. {
  3. QImage image(ui->listTreeWidget->selectedItems().at(i)->text(5));
  4. image.save("test" + QString::number(i), ui->formatComboBox->currentText().toLower().toAscii(), 100);
  5. }
To copy to clipboard, switch view to plain text mode 

I know that a solution is to use a separate thread, so the GUI won't freeze anymore. I know how to do this, but I can't access the QTreeWidget properties from the QThread, and so I can't load the QImage.
Is there a way to do this? Maybe pass some argument to the QThread from the MainWindow?
Or is there any other solution except using a separate thread?

Thanks for help