Редакция 165 | К новейшей редакции | Весь файл | Учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 165 | Редакция 167 | ||
---|---|---|---|
Строка 306... | Строка 306... | ||
306 | if (currentImage.isValid()) { |
306 | if (currentImage.isValid()) { |
307 | m_pxPicture.loadFromData(bytes); |
307 | m_pxPicture.loadFromData(bytes); |
308 | }
|
308 | }
|
309 | else { |
309 | else { |
310 | //QItemDelegate::paint(painter, option, index);
|
310 | //QItemDelegate::paint(painter, option, index);
|
- | 311 | ||
- | 312 | ||
311 | return; |
313 | return; |
312 | }
|
314 | }
|
313 | icnFrm->setPixmap(m_pxPicture); |
315 | icnFrm->setPixmap(m_pxPicture); |
314 | }
|
316 | }
|
315 | 317 | ||
Строка 319... | Строка 321... | ||
319 | void CPictureDelegate::setModelData( |
321 | void CPictureDelegate::setModelData( |
320 | QWidget *editor,
|
322 | QWidget *editor,
|
321 | QAbstractItemModel *model,
|
323 | QAbstractItemModel *model,
|
322 | const QModelIndex& index) const { |
324 | const QModelIndex& index) const { |
323 | IconForm *icnFrm = static_cast<IconForm*>(editor); |
325 | IconForm *icnFrm = static_cast<IconForm*>(editor); |
- | 326 | if (!(icnFrm->dataIsChanged())) return; |
|
- | 327 | ||
324 | m_pxPicture = icnFrm->pixmap(); |
328 | m_pxPicture = icnFrm->pixmap(); |
325 | QImage currentImage = m_pxPicture.toImage(); |
329 | QImage currentImage = m_pxPicture.toImage(); |
326 | QByteArray bytes;
|
330 | QByteArray bytes;
|
327 | QBuffer buffer(&bytes); |
331 | QBuffer buffer(&bytes); |
328 | buffer.open(QIODevice::WriteOnly); |
332 | buffer.open(QIODevice::WriteOnly); |