Subversion Repositories OpenInventory

Rev

Rev 165 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 165 Rev 167
Line 306... Line 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
316
318
Line 319... Line 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);