Редакция 167 | Весь файл | Не учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 167 | Редакция 182 | ||
---|---|---|---|
Строка 323... | Строка 323... | ||
323 | QAbstractItemModel *model,
|
323 | QAbstractItemModel *model,
|
324 | const QModelIndex& index) const { |
324 | const QModelIndex& index) const { |
325 | IconForm *icnFrm = static_cast<IconForm*>(editor); |
325 | IconForm *icnFrm = static_cast<IconForm*>(editor); |
326 | if (!(icnFrm->dataIsChanged())) return; |
326 | if (!(icnFrm->dataIsChanged())) return; |
327 | 327 | ||
- | 328 | if (!(icnFrm->pixmap().isNull())){ // åñëè íå óäàëèëè èêîíêó |
|
328 | m_pxPicture = icnFrm->pixmap(); |
329 | m_pxPicture = icnFrm->pixmap(); |
329 | QImage currentImage = m_pxPicture.toImage(); |
330 | QImage currentImage = m_pxPicture.toImage(); |
330 | QByteArray bytes;
|
331 | QByteArray bytes;
|
331 | QBuffer buffer(&bytes); |
332 | QBuffer buffer(&bytes); |
332 | buffer.open(QIODevice::WriteOnly); |
333 | buffer.open(QIODevice::WriteOnly); |
Строка 339... | Строка 340... | ||
339 | 340 | ||
340 | // int widht = m_pxPicture.width();
|
341 | // int widht = m_pxPicture.width();
|
341 | // int heigh = m_pxPicture.height();
|
342 | // int heigh = m_pxPicture.height();
|
342 | // tblView->setRowHeight(index.row(), heigh + 10);
|
343 | // tblView->setRowHeight(index.row(), heigh + 10);
|
343 | // model->submitAll();
|
344 | // model->submitAll();
|
344 | 345 | }
|
|
- | 346 | else { // èêîíêó óäàëèëè |
|
- | 347 | QVariant val_null;
|
|
- | 348 | model->setData(index, val_null, Qt::EditRole); |
|
345 | 349 | }
|
|
346 | 350 | ||
347 | 351 | ||
348 | // model->setData(index, value);
|
352 | // model->setData(index, value);
|
349 | }
|
353 | }
|
350 | 354 | ||
Строка 374... | Строка 378... | ||
374 | const QAbstractItemModel * model = index.model(); |
378 | const QAbstractItemModel * model = index.model(); |
375 | QString sFileName = model->data( index, Qt::DisplayRole ).toString(); |
379 | QString sFileName = model->data( index, Qt::DisplayRole ).toString(); |
376 | 380 | ||
377 | QVariant currentImage = model->data(index,0); |
381 | QVariant currentImage = model->data(index,0); |
378 | 382 | ||
379 | - | ||
380 | QByteArray bytes = currentImage.toByteArray(); |
383 | QByteArray bytes = currentImage.toByteArray(); |
381 | // QImage image;
|
384 | // QImage image;
|
382 | // image.loadFromData(bytes);
|
385 | // image.loadFromData(bytes);
|
383 | 386 | ||
384 | 387 | ||
385 | if (currentImage.isValid()) { |
388 | if (currentImage.isValid()) { |
386 | m_pxPicture.loadFromData(bytes); |
389 | m_pxPicture.loadFromData(bytes); |
387 | 390 | ||
388 | }
|
391 | }
|
389 | else { |
392 | else { |
- | 393 | int i; |
|
- | 394 | i++; |
|
390 | //QItemDelegate::paint(painter, option, index);
|
395 | //QItemDelegate::paint(painter, option, index);
|
391 | return; |
396 | return; |
392 | }
|
397 | }
|
393 | 398 | ||
394 | 399 |