소스 검색

Comply with changed interface of ctkDICOMImage

Ivo Wolf 14 년 전
부모
커밋
b1600fce25
1개의 변경된 파일10개의 추가작업 그리고 2개의 파일을 삭제
  1. 10 2
      Plugins/org.commontk.dah.exampleapp/ctkExampleDicomAppLogic.cpp

+ 10 - 2
Plugins/org.commontk.dah.exampleapp/ctkExampleDicomAppLogic.cpp

@@ -230,8 +230,16 @@ void ctkExampleDicomAppLogic::buttonClicked()
     ctkDICOMImage ctkImage(&dcmtkImage);
 
     QLabel* qtImage = new QLabel;
-    qtImage->setPixmap(ctkImage.getPixmap(0));
-    qtImage->show();
+    QPixmap pixmap = QPixmap::fromImage(ctkImage.getImage(0),Qt::AvoidDither);
+    if (pixmap.isNull())
+    {
+      qCritical() << "Failed to convert QImage to QPixmap" ;
+    }
+    else
+    {
+      qtImage->setPixmap(pixmap);
+      qtImage->show();
+    }
   }
   this->Button->setText(s);
 }