0

So, I have QTableView in my dialog, subclassed QAbstractTableModel, and a list of URLs of images to show using Qt::DecorationRole. Data called by reimplemented MyModel::data(const QModelIndex &index, int role) const method. I can load an image using QNetworkAccessManager. The question is, how to get an image before data-method is called for a specific cell, or recall data when the image is ready? When access manager is done with loading it can only call the slot.

While True
  • 423
  • 2
  • 15
  • If list of urls was given to constructor than may be you can pre download them?or you can return an empty QIcon object or may be QIcon with some downloading.gif and when downloaded return a Real image or what evere you need – Ruslan F. Dec 25 '12 at 09:35
  • Sorry for being inactive so long. You see, if i try to predownload them, then somehow the order is missing, yeah there are all of the pictures but they are not in the right place. And if I do the second thing, I dont know how to recall the data-method, and pass it new image. – While True Dec 26 '12 at 20:19
  • acording to second proposition you shoud emit a signal dataChanged ( const QModelIndex & bot, const QModelIndex & top) – Ruslan F. Dec 27 '12 at 14:40

0 Answers0