VirtualBox

Changeset 65328 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jan 16, 2017 1:27:07 PM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6899: Accessibility support (step 175): A bit of care for UIInformationItem: Reordering.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationItem.cpp

    r65327 r65328  
    101101}
    102102
     103void UIInformationItem::updateData(const QModelIndex &index) const
     104{
     105    /* Set name: */
     106    setName(index.data().toString());
     107    /* Set icon: */
     108    setIcon(index.data(Qt::DecorationRole).toString());
     109    /* Set text: */
     110    setText(index.data(Qt::UserRole + 1).value<UITextTable>());
     111    /* Get type of the item: */
     112    m_type = index.data(Qt::UserRole + 2).value<InformationElementType>();
     113}
     114
     115QString UIInformationItem::htmlData()
     116{
     117    /* Return html-data: */
     118    return m_pTextDocument->toHtml();
     119}
     120
    103121void UIInformationItem::paint(QPainter *pPainter, const QStyleOptionViewItem &option, const QModelIndex &index) const
    104122{
     
    134152    /* Return size: */
    135153    return m_pTextDocument->size().toSize();
    136 }
    137 
    138 void UIInformationItem::updateData(const QModelIndex &index) const
    139 {
    140     /* Set name: */
    141     setName(index.data().toString());
    142     /* Set icon: */
    143     setIcon(index.data(Qt::DecorationRole).toString());
    144     /* Set text: */
    145     setText(index.data(Qt::UserRole + 1).value<UITextTable>());
    146     /* Get type of the item: */
    147     m_type = index.data(Qt::UserRole + 2).value<InformationElementType>();
    148 }
    149 
    150 QString UIInformationItem::htmlData()
    151 {
    152     /* Return html-data: */
    153     return m_pTextDocument->toHtml();
    154154}
    155155
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationItem.h

    r65327 r65328  
    6363    void setText(const UITextTable &text) const;
    6464
     65    /** Updates data for information-item with @a index. */
     66    void updateData(const QModelIndex &index) const;
     67
     68    /** Returns html data. */
     69    QString htmlData();
     70
     71protected:
     72
    6573    /** Performs painting for @a index using @a pPainter and @a option set. */
    6674    void paint(QPainter *pPainter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
     
    6876    /** Calculates size-hint for @a index using @a option set. */
    6977    QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
    70 
    71     /** Updates data for information-item with @a index. */
    72     void updateData(const QModelIndex &index) const;
    73 
    74     /** Returns html data. */
    75     QString htmlData();
    7678
    7779private:
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