VirtualBox

Changeset 67164 in vbox for trunk


Ignore:
Timestamp:
May 31, 2017 10:38:44 AM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: Selector UI: Tools pane: Snapshot pane: Fixing missed thumbnail regression of r115822.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/selector
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotDetailsWidget.cpp

    r67162 r67164  
    8080
    8181    /** Holds whether this widget was polished. */
    82     bool m_fPolished;
     82    bool  m_fPolished;
    8383
    8484    /** Holds the screenshot to show. */
    85     QPixmap m_pixmapScreenshot;
     85    QPixmap  m_pixmapScreenshot;
    8686    /** Holds the snapshot name. */
    87     QString m_strSnapshotName;
     87    QString  m_strSnapshotName;
    8888    /** Holds the machine name. */
    89     QString m_strMachineName;
     89    QString  m_strMachineName;
    9090
    9191    /** Holds the scroll-area instance. */
    9292    QScrollArea *m_pScrollArea;
    9393    /** Holds the picture label instance. */
    94     QLabel *m_pLabelPicture;
     94    QLabel      *m_pLabelPicture;
    9595
    9696    /** Holds whether we are in zoom mode. */
    97     bool m_fZoomMode;
     97    bool  m_fZoomMode;
    9898};
    9999
     
    340340}
    341341
    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 
    371342void UISnapshotDetailsWidget::sltHandleNameChange()
    372343{
     
    464435        if (m_pixmapThumbnail.isNull())
    465436        {
     437            mLbThumbnail->setPixmap(QPixmap());
     438
    466439            pLayout->removeWidget(mLbThumbnail);
    467440            mLbThumbnail->setHidden(true);
     
    474447        else
    475448        {
     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
    476455            pLayout->removeWidget(mLeName);
    477456            pLayout->removeWidget(mTxTaken);
     
    494473        AssertPtrReturnVoid(pLayout);
    495474        {
     475            mLbThumbnail->setPixmap(QPixmap());
     476
    496477            pLayout->removeWidget(mLbThumbnail);
    497478            mLbThumbnail->setHidden(true);
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotDetailsWidget.h

    r67162 r67164  
    8787    virtual void retranslateUi() /* override */;
    8888
    89     /** Handles show @a pEvent. */
    90     virtual void showEvent(QShowEvent *pEvent) /* override */;
    91     /** Handles polish @a pEvent. */
    92     virtual void polishEvent(QShowEvent *pEvent);
    93 
    9489private slots:
    9590
     
    110105    void notify();
    111106
    112     /** Holds whether this widget was polished. */
    113     bool m_fPolished;
    114 
    115107    /** Holds the snapshot object to load data from. */
    116     CSnapshot m_comSnapshot;
     108    CSnapshot  m_comSnapshot;
    117109
    118110    /** Holds the old data copy. */
     
    122114
    123115    /** Holds the cached thumbnail. */
    124     QPixmap m_pixmapThumbnail;
     116    QPixmap  m_pixmapThumbnail;
    125117    /** Holds the cached screenshot. */
    126     QPixmap m_pixmapScreenshot;
     118    QPixmap  m_pixmapScreenshot;
    127119};
    128120
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette