VirtualBox

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


Ignore:
Timestamp:
Jan 13, 2017 1:32:28 PM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6899: Accessibility support (step 171): A bit of care for UIInformationView: Here and there, mostly coding-style.

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

Legend:

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

    r62558 r65282  
    2020#else  /* !VBOX_WITH_PRECOMPILED_HEADERS */
    2121
     22/* Qt includes: */
     23# include <QClipboard>
    2224# include <QTextEdit>
    23 # include <QClipboard>
    2425
    2526/* GUI includes: */
     
    2930#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
    3031
     32
    3133UIInformationView::UIInformationView(QWidget *pParent)
    3234    : QListView(pParent)
    3335{
    34     /* Create a dummy textEdit for copying rich-text as,
    35      * manual copying to clipboard is not working: */
     36    // WORKAROUND:
     37    // Create a dummy text-edit for copying rich-text
     38    // as manual copying to clipboard is not working:
    3639    m_pTextEdit = new QTextEdit(this);
    37     /* Hide textedit: */
    3840    m_pTextEdit->setVisible(false);
    3941    /* Set selection mode: */
     
    4648{
    4749    /* Iterate through all indexes: */
    48     for (int iRowIndex = topLeft.row(); iRowIndex <= bottomRight.row(); iRowIndex++)
     50    for (int iRowIndex = topLeft.row(); iRowIndex <= bottomRight.row(); ++iRowIndex)
    4951    {
    5052        /* Get the index for current row: */
    51         QModelIndex index = topLeft.sibling(iRowIndex, topLeft.column());
     53        const QModelIndex index = topLeft.sibling(iRowIndex, topLeft.column());
    5254        /* If index is valid: */
    5355        if (index.isValid())
    5456        {
    5557            /* Get the row-count of data-table: */
    56             int iCount = index.data(Qt::UserRole + 1).value<UITextTable>().count();
     58            const int iCount = index.data(Qt::UserRole + 1).value<UITextTable>().count();
    5759            /* If there is no data hide the item: */
    5860            if (iCount == 0)
     
    6870    {
    6971        QString strText;
    70         /* Get Selection model: */
     72        /* Get selection model: */
    7173        QItemSelectionModel *pSelectionModel = selectionModel();
    7274        if (pSelectionModel)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationView.h

    r60021 r65282  
    2727class UIInformationItem;
    2828
     29
    2930/** QListView extension
    3031  * providing GUI with information-view in session-information window. */
     
    3435
    3536public:
    36     /** Constructs information-view passing @a pParent to base-class. */
     37
     38    /** Constructs information-view passing @a pParent to the base-class. */
    3739    UIInformationView(QWidget *pParent = 0);
    3840
    3941public slots:
     42
    4043    /** Handles updating data for the index-range @a topLeft to @a bottomRight. */
    4144    void updateData(const QModelIndex &topLeft, const QModelIndex &bottomRight);
    4245
    4346protected slots:
     47
    4448    /** Handles Qt key-press @a pEvent. */
    4549    void keyPressEvent(QKeyEvent *pEvent);
    4650
    4751private:
    48     /** Holds the instance of textedit we create. */
     52
     53    /** Holds the text-edit instance. */
    4954    QTextEdit *m_pTextEdit;
    5055};
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