VirtualBox

Changeset 105327 in vbox


Ignore:
Timestamp:
Jul 15, 2024 2:48:33 PM (5 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10672: Runtime UI: Moderate QIStatusBarIndicator cleanup.

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

Legend:

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

    r101561 r105327  
    55
    66/*
    7  * Copyright (C) 2006-2023 Oracle and/or its affiliates.
     7 * Copyright (C) 2006-2024 Oracle and/or its affiliates.
    88 *
    99 * This file is part of VirtualBox base platform packages, as
     
    3030#include <QHBoxLayout>
    3131#include <QLabel>
    32 #include <QIcon>
    3332#include <QPainter>
    3433#include <QStyle>
     
    7069        if (cme.isAccepted())
    7170            pEvent->accept();
    72         else
    73             QWidget::mousePressEvent(pEvent);
    7471    }
    75     else
    76         QWidget::mousePressEvent(pEvent);
     72
     73    /* Call to base-class: */
     74    QWidget::mousePressEvent(pEvent);
    7775}
    7876#endif /* VBOX_WS_MAC */
     
    139137    , m_pLabel(0)
    140138{
    141     /* Create main-layout: */
     139    /* Prepare main-layout: */
    142140    QHBoxLayout *pMainLayout = new QHBoxLayout(this);
    143141    if (pMainLayout)
    144142    {
    145         /* Configure main-layout: */
    146143        pMainLayout->setContentsMargins(0, 0, 0, 0);
    147144        pMainLayout->setSpacing(0);
     145
    148146        /* Create label: */
    149         m_pLabel = new QLabel;
     147        m_pLabel = new QLabel(this);
    150148        if (m_pLabel)
    151         {
    152             /* Add label into main-layout: */
    153149            pMainLayout->addWidget(m_pLabel);
    154         }
    155150    }
    156151}
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIStatusBarIndicator.h

    r103977 r105327  
    55
    66/*
    7  * Copyright (C) 2006-2023 Oracle and/or its affiliates.
     7 * Copyright (C) 2006-2024 Oracle and/or its affiliates.
    88 *
    99 * This file is part of VirtualBox base platform packages, as
     
    3535#include <QIcon>
    3636#include <QMap>
     37#include <QSize>
    3738#include <QWidget>
    3839
     
    4142
    4243/* Forward declarations: */
    43 class QIcon;
    4444class QLabel;
    45 class QSize;
    46 class QString;
    47 class QWidget;
    4845
    4946
     
    8178
    8279    /** Holds currently cached size. */
    83     QSize m_size;
     80    QSize  m_size;
    8481};
    8582
     
    105102public slots:
    106103
    107     /** Defines int @a state. */
     104    /** Defines int @a iState. */
    108105    virtual void setState(int iState) { m_iState = iState; repaint(); }
    109     /** Defines bool @a state. */
    110     void setState(bool fState) { setState((int)fState); }
    111106
    112107protected:
     
    121116
    122117    /** Holds current state. */
    123     int m_iState;
     118    int               m_iState;
    124119    /** Holds cached state icons. */
    125     QMap<int, QIcon> m_icons;
     120    QMap<int, QIcon>  m_icons;
    126121};
    127122
    128123
    129 /** QIStatusBarIndicator extension used as status-bar state indicator. */
     124/** QIStatusBarIndicator extension used as status-bar text indicator. */
    130125class SHARED_LIBRARY_STUFF QITextStatusBarIndicator : public QIStatusBarIndicator
    131126{
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