VirtualBox

Changeset 64109 in vbox for trunk/src


Ignore:
Timestamp:
Sep 30, 2016 1:16:49 PM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6899: Accessibility support (step 65): Cleanup for QITreeWidget.

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

Legend:

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

    r62493 r64109  
    2020#else  /* !VBOX_WITH_PRECOMPILED_HEADERS */
    2121
    22 /* Global includes */
     22/* Qt includes: */
    2323# include <QPainter>
    2424# include <QResizeEvent>
    2525
    26 /* Local includes */
     26/* GUI includes: */
    2727# include "QITreeWidget.h"
    2828
     
    3030
    3131
    32 QITreeWidget::QITreeWidget (QWidget *aParent)
    33     : QTreeWidget (aParent)
     32QITreeWidget::QITreeWidget(QWidget *aParent)
     33    : QTreeWidget(aParent)
    3434{
    3535}
     
    3737void QITreeWidget::setSizeHintForItems(const QSize &sizeHint)
    3838{
     39    /* Pass the sizeHint to all the top-level items: */
    3940    for (int i = 0; i < topLevelItemCount(); ++i)
    4041        topLevelItem(i)->setSizeHint(0, sizeHint);
    4142}
    4243
    43 void QITreeWidget::paintEvent (QPaintEvent *aEvent)
     44void QITreeWidget::paintEvent(QPaintEvent *pEvent)
    4445{
    45     /* Opens Items Painter */
     46    /* Create item painter: */
    4647    QPainter painter;
    47     painter.begin (viewport());
     48    painter.begin(viewport());
    4849
    49     /* Notify connected objects about painting */
    50     QTreeWidgetItemIterator it (this);
     50    /* Notify listeners about painting: */
     51    QTreeWidgetItemIterator it(this);
    5152    while (*it)
    5253    {
    53         emit painted (*it, &painter);
    54         ++ it;
     54        emit painted(*it, &painter);
     55        ++it;
    5556    }
    5657
    57     /* Close Items Painter */
     58    /* Close item painter: */
    5859    painter.end();
    5960
    60     /* Base-class paint-event */
    61     QTreeWidget::paintEvent (aEvent);
     61    /* Call to base-class: */
     62    QTreeWidget::paintEvent(pEvent);
    6263}
    6364
    64 void QITreeWidget::resizeEvent (QResizeEvent *aEvent)
     65void QITreeWidget::resizeEvent(QResizeEvent *pEvent)
    6566{
    66     /* Base-class resize-event */
    67     QTreeWidget::resizeEvent (aEvent);
     67    /* Call to base-class: */
     68    QTreeWidget::resizeEvent(pEvent);
    6869
    69     /* Notify connected objects about resize */
    70     emit resized (aEvent->size(), aEvent->oldSize());
     70    /* Notify listeners about resizing: */
     71    emit resized(pEvent->size(), pEvent->oldSize());
    7172}
    7273
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QITreeWidget.h

    r62493 r64109  
    1616 */
    1717
    18 #ifndef __QITreeWidget_h__
    19 #define __QITreeWidget_h__
     18#ifndef ___QITreeWidget_h___
     19#define ___QITreeWidget_h___
    2020
    21 /* Global includes */
     21/* Qt includes: */
    2222#include <QTreeWidget>
    2323
    24 /*
    25  * QTreeWidget class which extends standard QTreeWidget's functionality.
    26  */
    27 class QITreeWidget: public QTreeWidget
     24
     25/** QTreeWidget subclass extending standard functionality. */
     26class QITreeWidget : public QTreeWidget
    2827{
    2928    Q_OBJECT;
    3029
     30signals:
     31
     32    /** Notifies about particular tree-widget @a pItem is painted with @a pPainter. */
     33    void painted(QTreeWidgetItem *pItem, QPainter *pPainter);
     34    /** Notifies about tree-widget being resized from @a oldSize to @a size. */
     35    void resized(const QSize &size, const QSize &oldSize);
     36
    3137public:
    3238
    33     QITreeWidget (QWidget *aParent = 0);
     39    /** Constructs tree-widget passing @a pParent to the base-class. */
     40    QITreeWidget(QWidget *pParent = 0);
    3441
     42    /** Defines @a sizeHint for tree-widget items. */
    3543    void setSizeHintForItems(const QSize &sizeHint);
    36 
    37 signals:
    38 
    39     void painted (QTreeWidgetItem *aItem, QPainter *aPainter);
    40     void resized (const QSize &aSize, const QSize &aOldSize);
    4144
    4245protected:
    4346
    44     void paintEvent (QPaintEvent *aEvent);
    45     void resizeEvent (QResizeEvent *aEvent);
     47    /** Handles paint @a pEvent. */
     48    void paintEvent(QPaintEvent *pEvent);
     49    /** Handles resize @a pEvent. */
     50    void resizeEvent(QResizeEvent *pEvent);
    4651};
    4752
    48 #endif /* __QITreeWidget_h__ */
     53#endif /* !___QITreeWidget_h___ */
    4954
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