- Timestamp:
- May 31, 2017 10:38:44 AM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector
- Files:
-
- 2 edited
-
UISnapshotDetailsWidget.cpp (modified) (5 diffs)
-
UISnapshotDetailsWidget.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotDetailsWidget.cpp
r67162 r67164 80 80 81 81 /** Holds whether this widget was polished. */ 82 bool m_fPolished;82 bool m_fPolished; 83 83 84 84 /** Holds the screenshot to show. */ 85 QPixmap m_pixmapScreenshot;85 QPixmap m_pixmapScreenshot; 86 86 /** Holds the snapshot name. */ 87 QString m_strSnapshotName;87 QString m_strSnapshotName; 88 88 /** Holds the machine name. */ 89 QString m_strMachineName;89 QString m_strMachineName; 90 90 91 91 /** Holds the scroll-area instance. */ 92 92 QScrollArea *m_pScrollArea; 93 93 /** Holds the picture label instance. */ 94 QLabel *m_pLabelPicture;94 QLabel *m_pLabelPicture; 95 95 96 96 /** Holds whether we are in zoom mode. */ 97 bool m_fZoomMode;97 bool m_fZoomMode; 98 98 }; 99 99 … … 340 340 } 341 341 342 void UISnapshotDetailsWidget::showEvent(QShowEvent *pEvent)343 {344 /* Call to base-class: */345 QIWithRetranslateUI<QWidget>::showEvent(pEvent);346 347 /* Make sure we should polish dialog: */348 if (m_fPolished)349 return;350 351 /* Call to polish-event: */352 polishEvent(pEvent);353 354 /* Mark dialog as polished: */355 m_fPolished = true;356 }357 358 void UISnapshotDetailsWidget::polishEvent(QShowEvent * /* pEvent */)359 {360 /* If we haven't assigned the thumbnail yet, do it now: */361 if (!mLbThumbnail->pixmap() && !m_pixmapThumbnail.isNull())362 {363 mLbThumbnail->setPixmap(m_pixmapThumbnail.scaled(QSize(1, mLbThumbnail->height()),364 Qt::KeepAspectRatioByExpanding,365 Qt::SmoothTransformation));366 /* Make sure tool-tip is translated afterwards: */367 retranslateUi();368 }369 }370 371 342 void UISnapshotDetailsWidget::sltHandleNameChange() 372 343 { … … 464 435 if (m_pixmapThumbnail.isNull()) 465 436 { 437 mLbThumbnail->setPixmap(QPixmap()); 438 466 439 pLayout->removeWidget(mLbThumbnail); 467 440 mLbThumbnail->setHidden(true); … … 474 447 else 475 448 { 449 const QStyle *pStyle = QApplication::style(); 450 const int iIconMetric = pStyle->pixelMetric(QStyle::PM_LargeIconSize); 451 mLbThumbnail->setPixmap(m_pixmapThumbnail.scaled(QSize(1, iIconMetric), 452 Qt::KeepAspectRatioByExpanding, 453 Qt::SmoothTransformation)); 454 476 455 pLayout->removeWidget(mLeName); 477 456 pLayout->removeWidget(mTxTaken); … … 494 473 AssertPtrReturnVoid(pLayout); 495 474 { 475 mLbThumbnail->setPixmap(QPixmap()); 476 496 477 pLayout->removeWidget(mLbThumbnail); 497 478 mLbThumbnail->setHidden(true); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotDetailsWidget.h
r67162 r67164 87 87 virtual void retranslateUi() /* override */; 88 88 89 /** Handles show @a pEvent. */90 virtual void showEvent(QShowEvent *pEvent) /* override */;91 /** Handles polish @a pEvent. */92 virtual void polishEvent(QShowEvent *pEvent);93 94 89 private slots: 95 90 … … 110 105 void notify(); 111 106 112 /** Holds whether this widget was polished. */113 bool m_fPolished;114 115 107 /** Holds the snapshot object to load data from. */ 116 CSnapshot m_comSnapshot;108 CSnapshot m_comSnapshot; 117 109 118 110 /** Holds the old data copy. */ … … 122 114 123 115 /** Holds the cached thumbnail. */ 124 QPixmap m_pixmapThumbnail;116 QPixmap m_pixmapThumbnail; 125 117 /** Holds the cached screenshot. */ 126 QPixmap m_pixmapScreenshot;118 QPixmap m_pixmapScreenshot; 127 119 }; 128 120
Note:
See TracChangeset
for help on using the changeset viewer.

