VirtualBox

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


Ignore:
Timestamp:
Jan 16, 2017 2:00:41 PM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6899: Accessibility support (step 178): A bit of care for UIInformationModel: 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/UIInformationModel.cpp

    r65333 r65334  
    4949UIInformationModel::~UIInformationModel()
    5050{
    51     /* Destroy all data-items: */
    52     qDeleteAll(m_list);
    53     m_list.clear();
     51    /* Cleanup: */
     52    cleanup();
    5453}
    5554
     
    6867    /* Return the data for the corresponding role: */
    6968    return pItem->data(index, role);
    70 }
    71 
    72 void UIInformationModel::prepare()
    73 {
    74     /* Prepare role-names for model: */
    75     QHash<int, QByteArray> roleNames;
    76     roleNames[Qt::DisplayRole] = "";
    77     roleNames[Qt::DecorationRole] = "";
    78     roleNames[Qt::UserRole + 1] = "";
    79     roleNames[Qt::UserRole + 2] = "";
    80     # if QT_VERSION < 0x050000
    81     setRoleNames(roleNames);
    82     # endif /* QT_VERSION < 0x050000 */
    83 
    84     /* Register meta-type: */
    85     qRegisterMetaType<InformationElementType>();
    86 }
    87 
    88 QHash<int, QByteArray> UIInformationModel::roleNames() const
    89 {
    90     /* Add supported roles and return: */
    91     QHash<int, QByteArray> roleNames;
    92     roleNames[Qt::DisplayRole] = "";
    93     roleNames[Qt::DecorationRole] = "";
    94     roleNames[Qt::UserRole + 1] = "";
    95     roleNames[Qt::UserRole + 2] = "";
    96     return roleNames;
    9769}
    9870
     
    12092}
    12193
     94void UIInformationModel::prepare()
     95{
     96    /* Prepare role-names for model: */
     97    QHash<int, QByteArray> roleNames;
     98    roleNames[Qt::DisplayRole] = "";
     99    roleNames[Qt::DecorationRole] = "";
     100    roleNames[Qt::UserRole + 1] = "";
     101    roleNames[Qt::UserRole + 2] = "";
     102    # if QT_VERSION < 0x050000
     103    setRoleNames(roleNames);
     104    # endif /* QT_VERSION < 0x050000 */
     105
     106    /* Register meta-type: */
     107    qRegisterMetaType<InformationElementType>();
     108}
     109
     110void UIInformationModel::cleanup()
     111{
     112    /* Destroy all data-items: */
     113    qDeleteAll(m_list);
     114    m_list.clear();
     115}
     116
     117QHash<int, QByteArray> UIInformationModel::roleNames() const
     118{
     119    /* Add supported roles and return: */
     120    QHash<int, QByteArray> roleNames;
     121    roleNames[Qt::DisplayRole] = "";
     122    roleNames[Qt::DecorationRole] = "";
     123    roleNames[Qt::UserRole + 1] = "";
     124    roleNames[Qt::UserRole + 2] = "";
     125    return roleNames;
     126}
     127
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationModel.h

    r65333 r65334  
    8282    /** Prepares all. */
    8383    void prepare();
     84    /** Cleanups all. */
     85    void cleanup();
    8486
    8587    /** Returns the list of role-names supported by model. */
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