|
|
@ -351,8 +351,6 @@ void UBTeacherBarDropMediaZone::dropEvent(QDropEvent *pEvent) |
|
|
|
QString mimeType = UBFileSystemUtils::mimeTypeFromFileName(pEvent->mimeData()->urls().at(0).toLocalFile()); |
|
|
|
QString mimeType = UBFileSystemUtils::mimeTypeFromFileName(pEvent->mimeData()->urls().at(0).toLocalFile()); |
|
|
|
if(mimeType.contains("image")){ |
|
|
|
if(mimeType.contains("image")){ |
|
|
|
QPixmap pix = QPixmap(pEvent->mimeData()->urls().at(0).toLocalFile()); |
|
|
|
QPixmap pix = QPixmap(pEvent->mimeData()->urls().at(0).toLocalFile()); |
|
|
|
float ratio = (float)width()/(float)pix.width(); |
|
|
|
|
|
|
|
pix.transformed(QTransform::scale((float)pix.width()/ratio,(float)pix.height()/ratio)); |
|
|
|
|
|
|
|
QLabel* label = new QLabel(); |
|
|
|
QLabel* label = new QLabel(); |
|
|
|
label->setPixmap(pix); |
|
|
|
label->setPixmap(pix); |
|
|
|
label->setScaledContents(true); |
|
|
|
label->setScaledContents(true); |
|
|
|