VirtualBox

Ignore:
Timestamp:
Jun 23, 2008 1:26:35 PM (16 years ago)
Author:
vboxsync
Message:

Fe/Qt4: Extend QITreeWidget api to let it's complex items have separate painting routines.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/QITreeWidget.h

    r9867 r9872  
    2424#define __QITreeWidget_h__
    2525
    26 /* Qt includes */
    2726#include <QTreeWidget>
    2827
     28/*
     29 * QTreeWidget class which extends standard QTreeWidget's functionality.
     30 */
    2931class QITreeWidget: public QTreeWidget
    3032{
     
    3234
    3335public:
     36
     37    /*
     38     * There are two allowed QTreeWidgetItem types which may be used with
     39     * QITreeWidget: basic and complex.
     40     * Complex type used in every place where the particular item have to
     41     * be separately repainted with it's own content.
     42     * Basic are used in all other places.
     43     */
     44    enum
     45    {
     46        BasicItemType   = QTreeWidgetItem::UserType + 1,
     47        ComplexItemType = QTreeWidgetItem::UserType + 2
     48    };
    3449
    3550    QITreeWidget (QWidget *aParent = 0);
     
    4156    virtual Qt::DropActions supportedDropActions () const;
    4257
     58    void paintEvent (QPaintEvent *);
     59
    4360    /* Protected member vars */
    4461    Qt::DropActions mSupportedDropActions;
    4562};
    4663
     64/*
     65 * Interface for more complex items which requires special repainting
     66 * routine inside QITreeWidget's viewport.
     67 */
     68class ComplexTreeWidgetItem : public QTreeWidgetItem
     69{
     70public:
     71
     72    ComplexTreeWidgetItem (QTreeWidget *aParent)
     73        : QTreeWidgetItem  (aParent, QITreeWidget::ComplexItemType) {}
     74
     75    virtual void paintItem (QPainter *aPainter) = 0;
     76};
     77
    4778#endif /* __QITreeWidget_h__ */
    4879
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