VirtualBox

Changeset 71408 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 20, 2018 3:25:41 PM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9049: Small cleanup for QIStatusBarIndicator.

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

Legend:

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

    r69500 r71408  
    55
    66/*
    7  * Copyright (C) 2006-2017 Oracle Corporation
     7 * Copyright (C) 2006-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2121
    2222/* Qt includes: */
     23# include <QApplication>
     24# include <QHBoxLayout>
     25# include <QLabel>
    2326# include <QIcon>
    2427# include <QPainter>
    25 # include <QHBoxLayout>
    26 # include <QApplication>
    2728# include <QStyle>
    28 # include <QLabel>
    2929# ifdef VBOX_WS_MAC
    3030#  include <QContextMenuEvent>
     
    4040
    4141
     42/*********************************************************************************************************************************
     43*   Class QIStatusBarIndicator implementation.                                                                                   *
     44*********************************************************************************************************************************/
    4245
    4346QIStatusBarIndicator::QIStatusBarIndicator(QWidget *pParent /* = 0 */)
     
    5154void QIStatusBarIndicator::mousePressEvent(QMouseEvent *pEvent)
    5255{
    53     /* Do this for the left mouse button event only, cause in the case of the
    54      * right mouse button it could happen that the context menu event is
    55      * triggered twice. Also this isn't necessary for the middle mouse button
    56      * which would be some kind of overstated. */
     56    // WORKAROUND:
     57    // Do this for the left mouse button event only, cause in the case of the
     58    // right mouse button it could happen that the context menu event is
     59    // triggered twice. Also this isn't necessary for the middle mouse button
     60    // which would be some kind of overstated.
    5761    if (pEvent->button() == Qt::LeftButton)
    5862    {
     
    8084
    8185
     86/*********************************************************************************************************************************
     87*   Class QIStateStatusBarIndicator implementation.                                                                              *
     88*********************************************************************************************************************************/
     89
    8290QIStateStatusBarIndicator::QIStateStatusBarIndicator(QWidget *pParent /* = 0 */)
    8391  : QIStatusBarIndicator(pParent)
     
    102110}
    103111
    104 void QIStateStatusBarIndicator::paintEvent(QPaintEvent*)
     112void QIStateStatusBarIndicator::paintEvent(QPaintEvent *)
    105113{
    106114    QPainter painter(this);
     
    114122}
    115123
     124
     125/*********************************************************************************************************************************
     126*   Class QITextStatusBarIndicator implementation.                                                                               *
     127*********************************************************************************************************************************/
    116128
    117129QITextStatusBarIndicator::QITextStatusBarIndicator(QWidget *pParent /* = 0 */)
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIStatusBarIndicator.h

    r69500 r71408  
    55
    66/*
    7  * Copyright (C) 2006-2017 Oracle Corporation
     7 * Copyright (C) 2006-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2020
    2121/* Qt includes: */
     22#include <QIcon>
     23#include <QMap>
    2224#include <QWidget>
    23 #include <QMap>
    24 #include <QIcon>
    2525
    2626/* Forward declarations: */
     27class QIcon;
    2728class QLabel;
     29class QSize;
     30class QString;
     31class QWidget;
     32
    2833
    2934/** QWidget extension used as status-bar indicator. */
     
    4146public:
    4247
    43     /** Constructor, passes @a pParent to the QWidget constructor. */
     48    /** Constructs status-bar indicator passing @a pParent to the base-class. */
    4449    QIStatusBarIndicator(QWidget *pParent = 0);
    4550
     
    5055
    5156#ifdef VBOX_WS_MAC
    52     /** Mac OS X: Mouse-press-event handler.
    53       *           Make the left button also show the context-menu to make things
    54       *           simpler for users with single mouse button mice (laptops++). */
    55     virtual void mousePressEvent(QMouseEvent *pEvent);
     57    /** Handles mouse-press @a pEvent. */
     58    virtual void mousePressEvent(QMouseEvent *pEvent) /* override */;
    5659#endif /* VBOX_WS_MAC */
    57     /** Mouse-double-click-event handler. */
    58     virtual void mouseDoubleClickEvent(QMouseEvent *pEvent);
    59     /** Context-menu-event handler. */
    60     virtual void contextMenuEvent(QContextMenuEvent *pEvent);
     60    /** Handles mouse-double-click @a pEvent. */
     61    virtual void mouseDoubleClickEvent(QMouseEvent *pEvent) /* override */;
     62
     63    /** Handles context-menu @a pEvent. */
     64    virtual void contextMenuEvent(QContextMenuEvent *pEvent) /* override */;
    6165
    6266    /** Holds currently cached size. */
    6367    QSize m_size;
    6468};
     69
    6570
    6671/** QIStatusBarIndicator extension used as status-bar state indicator. */
     
    7176public:
    7277
    73     /** Constructor, passes @a pParent to the QIStatusBarIndicator constructor. */
     78    /** Constructs state status-bar indicator passing @a pParent to the base-class. */
    7479    QIStateStatusBarIndicator(QWidget *pParent = 0);
    7580
     
    9196protected:
    9297
    93     /** Paint-event handler. */
    94     virtual void paintEvent(QPaintEvent *pEvent);
     98    /** Handles paint @a pEvent. */
     99    virtual void paintEvent(QPaintEvent *pEvent) /* override */;
    95100
    96     /** Draw-contents routine. */
     101    /** Draws contents using passed @a pPainter. */
    97102    virtual void drawContents(QPainter *pPainter);
    98103
     
    105110};
    106111
     112
    107113/** QIStatusBarIndicator extension used as status-bar state indicator. */
    108114class QITextStatusBarIndicator : public QIStatusBarIndicator
     
    112118public:
    113119
    114     /** Constructor, passes @a pParent to the QIStatusBarIndicator constructor. */
     120    /** Constructs text status-bar indicator passing @a pParent to the base-class. */
    115121    QITextStatusBarIndicator(QWidget *pParent = 0);
    116122
     
    126132};
    127133
     134
    128135#endif /* !___QIStatusBarIndicators_h___ */
     136
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