Auto status change to "Under Review"
@@ -14,6 +14,8 | |||||
14 |
|
14 | |||
15 | Q_LOGGING_CATEGORY(LOG_VisualizationDragDropContainer, "VisualizationDragDropContainer") |
|
15 | Q_LOGGING_CATEGORY(LOG_VisualizationDragDropContainer, "VisualizationDragDropContainer") | |
16 |
|
16 | |||
|
17 | auto DRAGGED_MINIATURE_WIDTH = 200; // in pixels | |||
|
18 | ||||
17 | struct VisualizationDragDropContainer::VisualizationDragDropContainerPrivate { |
|
19 | struct VisualizationDragDropContainer::VisualizationDragDropContainerPrivate { | |
18 |
|
20 | |||
19 | QVBoxLayout *m_Layout; |
|
21 | QVBoxLayout *m_Layout; | |
@@ -183,14 +185,14 void VisualizationDragDropContainer::startDrag(VisualizationDragWidget *dragWidg | |||||
183 |
|
185 | |||
184 | // Note: The management of the drag object is done by Qt |
|
186 | // Note: The management of the drag object is done by Qt | |
185 | auto drag = new QDrag{dragWidget}; |
|
187 | auto drag = new QDrag{dragWidget}; | |
186 | drag->setHotSpot(dragPosition); |
|
|||
187 |
|
188 | |||
188 | auto mimeData = dragWidget->mimeData(); |
|
189 | auto mimeData = dragWidget->mimeData(); | |
189 | drag->setMimeData(mimeData); |
|
190 | drag->setMimeData(mimeData); | |
190 |
|
191 | |||
191 | auto pixmap = QPixmap(dragWidget->size()); |
|
192 | auto pixmap = QPixmap(dragWidget->size()); | |
192 | dragWidget->render(&pixmap); |
|
193 | dragWidget->render(&pixmap); | |
193 | drag->setPixmap(pixmap); |
|
194 | drag->setPixmap(pixmap.scaled(DRAGGED_MINIATURE_WIDTH, DRAGGED_MINIATURE_WIDTH, | |
|
195 | Qt::KeepAspectRatio, Qt::SmoothTransformation)); | |||
194 |
|
196 | |||
195 | auto image = pixmap.toImage(); |
|
197 | auto image = pixmap.toImage(); | |
196 | mimeData->setImageData(image); |
|
198 | mimeData->setImageData(image); |
General Comments 1
You need to be logged in to leave comments.
Login now