ganeswidgets/tsrc/fute/HgWidgetTest/src/hgwidgettestdatamodel.cpp
changeset 5 4fa04caf0f43
parent 2 49c70dcc3f17
child 6 1cdcc61142d2
child 8 15f034b8a3b5
--- a/ganeswidgets/tsrc/fute/HgWidgetTest/src/hgwidgettestdatamodel.cpp	Thu May 27 13:59:05 2010 +0300
+++ b/ganeswidgets/tsrc/fute/HgWidgetTest/src/hgwidgettestdatamodel.cpp	Fri Jun 11 14:43:11 2010 +0300
@@ -101,6 +101,7 @@
             if (s.indexOf(QString(".jpg"),0,Qt::CaseInsensitive)>0){
                 mFiles.append(s);
                 mImages.append(QImage());
+                mPixmaps.append(QPixmap());
                 mVisibility.append(true);
             }
         }
@@ -269,7 +270,15 @@
                     break;
                     case ImageTypeHbIcon:
                     {
-                        returnValue = mHbIcon;
+                    QPixmap pixmap = mPixmaps.at(row);
+                    if (!pixmap.isNull()) {
+                        QIcon qicon(mPixmaps.at(row));
+                        if (!qicon.isNull()){
+                            returnValue = HbIcon(qicon);
+                        }else {
+                            returnValue = mHbIcon;
+                        }
+                    }
                     }
                     break;
                     case ImageTypeQIcon:
@@ -509,7 +518,7 @@
     delete mBufferManager;
     mBufferManager = 0;
     mBufferManager = new BufferManager(this, buffer, treshhold, 0, mFiles.count());
-    if (mImageType == ImageTypeQPixmap)
+    if (mImageType == ImageTypeQPixmap || mImageType == ImageTypeHbIcon)
     {
         for (int i = 0; i<mPixmaps.count();i++) {
             mPixmaps.replace(i, QPixmap());
@@ -589,7 +598,7 @@
 {
     if (!error && !pixmap.isNull() ){
 //        int idx = reinterpret_cast<int>(data);
-        if (mImageType == ImageTypeQPixmap)
+        if (mImageType == ImageTypeQPixmap || mImageType == ImageTypeHbIcon)
         {
             mPixmaps.replace(mThumbnailRequestIndex, pixmap);
         }