VirtualBox

Changeset 59644 in vbox


Ignore:
Timestamp:
Feb 12, 2016 10:48:52 AM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: ​​​bugref:8088: Rework session-information window: UIInformationModel classes cleanup.

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

    r59484 r59644  
    4444    /* Prepare information-model: */
    4545    prepare();
    46 
    47     /* Prepare data for information-model: */
    48     prepareData();
    4946}
    5047
     
    7269    roleNames[Qt::DisplayRole] = "";
    7370    roleNames[Qt::DecorationRole] = "";
    74     roleNames[Qt::SizeHintRole] = "";
    75     roleNames[Qt::UserRole+1] = "";
     71    roleNames[Qt::UserRole + 1] = "";
     72    roleNames[Qt::UserRole + 2] = "";
    7673    setRoleNames(roleNames);
    7774
    7875    /* Register meta-type: */
    7976    qRegisterMetaType<InformationElementType>();
    80 }
    81 
    82 void UIInformationModel::prepareData()
    83 {
    84     /* Prepare data for information-model: */
    85     UIInformationDataItem *pGeneral = new UIInformationDataGeneral(m_machine, m_console);
    86     AssertPtrReturnVoid(pGeneral);
    87     {
    88         m_list.append(pGeneral);
    89     }
    90     UIInformationDataSystem *pSystem = new UIInformationDataSystem(m_machine, m_console);
    91     AssertPtrReturnVoid(pSystem);
    92     {
    93         m_list.append(pSystem);
    94     }
    95     UIInformationDataDisplay *pDisplay = new UIInformationDataDisplay(m_machine, m_console);
    96     AssertPtrReturnVoid(pDisplay);
    97     {
    98         m_list.append(pDisplay);
    99     }
    10077}
    10178
     
    10582    roleNames[Qt::DisplayRole] = "";
    10683    roleNames[Qt::DecorationRole] = "";
    107     roleNames[Qt::SizeHintRole] = "";
    108     roleNames[Qt::UserRole+1] = "";
     84    roleNames[Qt::UserRole + 1] = "";
     85    roleNames[Qt::UserRole + 2] = "";
    10986    return roleNames;
    11087}
    11188
     89void UIInformationModel::addItem(UIInformationDataItem *pItem)
     90{
     91    AssertPtrReturnVoid(pItem);
     92    m_list.append(pItem);
     93}
     94
     95void UIInformationModel::updateData(const QModelIndex &idx)
     96{
     97    emit dataChanged(idx, idx);
     98}
     99
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationModel.h

    r59484 r59644  
    6767    QVariant data(const QModelIndex &idx, int role = Qt::DisplayRole) const;
    6868
     69    /** Adds the item. */
     70    void addItem(UIInformationDataItem *pItem);
     71
     72    /** Updates Data. */
     73    void updateData(const QModelIndex &idx);
     74
    6975private:
    7076
    7177    /** Prepares information-model. */
    7278    void prepare();
    73 
    74     /** Prepares data for information-model. */
    75     void prepareData();
    7679
    7780    /** 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