VirtualBox

Changeset 90633 in vbox


Ignore:
Timestamp:
Aug 11, 2021 6:25:25 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: Fixing a paint bug causing an infinite paint loop.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QILineEdit.cpp

    r90107 r90633  
    2424#include <QPalette>
    2525#include <QStyleOptionFrame>
     26#include <QTime>
    2627
    2728/* GUI includes: */
     
    100101void QILineEdit::paintEvent(QPaintEvent *pPaintEvent)
    101102{
     103    printf("%d\n", QTime::currentTime().second());
    102104    QLineEdit::paintEvent(pPaintEvent);
    103105
    104106    if (m_fMarkForError)
    105107    {
    106         const int iIconMargin = 1. * QApplication::style()->pixelMetric(QStyle::PM_LayoutTopMargin);
    107         int iIconSize = height() - 2 * iIconMargin;
    108108        if (!m_pIconLabel)
    109109            m_pIconLabel = new QLabel(this);
    110         m_pIconLabel->setPixmap(m_markIcon.pixmap(windowHandle(), QSize(iIconSize, iIconSize)));
    111         m_pIconLabel->setToolTip(m_strErrorMessage);
    112         m_pIconLabel->move(width() - iIconSize - iIconMargin, iIconMargin);
    113         m_pIconLabel->show();
     110
     111        if (m_pIconLabel && m_pIconLabel->isHidden())
     112        {
     113            const int iIconMargin = 1. * QApplication::style()->pixelMetric(QStyle::PM_LayoutTopMargin);
     114            int iIconSize = height() - 2 * iIconMargin;
     115            m_pIconLabel->setPixmap(m_markIcon.pixmap(windowHandle(), QSize(iIconSize, iIconSize)));
     116            m_pIconLabel->setToolTip(m_strErrorMessage);
     117            m_pIconLabel->move(width() - iIconSize - iIconMargin, iIconMargin);
     118            m_pIconLabel->show();
     119        }
    114120    }
    115121    else
    116122    {
    117         if (m_pIconLabel)
     123        if (m_pIconLabel && m_pIconLabel->isVisible())
    118124            m_pIconLabel->hide();
    119125    }
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