VirtualBox

Changeset 100158 in vbox


Ignore:
Timestamp:
Jun 12, 2023 4:52:22 PM (18 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9080. Resize label pixmap in resizeEvent if it is visible.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp

    r100156 r100158  
    296296}
    297297
    298 void UIVisoCreatorWidget::paintEvent(QPaintEvent *pEvent)
     298void UIVisoCreatorWidget::resizeEvent(QResizeEvent *pEvent)
    299299{
    300300    Q_UNUSED(pEvent);
     301    if (m_pOverlayWidget && m_fShowSettingsDialog)
     302    {
     303        const QPixmap *pLabelPixmap = m_pOverlayWidget->pixmap();
     304        if (pLabelPixmap)
     305        {
     306            QPixmap newPixmap = pLabelPixmap->scaled(m_pOverlayWidget->size(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
     307            if (!newPixmap.isNull())
     308                m_pOverlayWidget->setPixmap(newPixmap);
     309        }
     310    }
    301311}
    302312
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.h

    r100156 r100158  
    9393
    9494    virtual void retranslateUi() final override;
    95     virtual void paintEvent(QPaintEvent *pEvent) final override;
     95    virtual void resizeEvent(QResizeEvent *pEvent) final override;
    9696
    9797private slots:
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