Changeset 65282 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jan 13, 2017 1:32:28 PM (8 years ago)
- 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 20 20 #else /* !VBOX_WITH_PRECOMPILED_HEADERS */ 21 21 22 /* Qt includes: */ 23 # include <QClipboard> 22 24 # include <QTextEdit> 23 # include <QClipboard>24 25 25 26 /* GUI includes: */ … … 29 30 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 30 31 32 31 33 UIInformationView::UIInformationView(QWidget *pParent) 32 34 : QListView(pParent) 33 35 { 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: 36 39 m_pTextEdit = new QTextEdit(this); 37 /* Hide textedit: */38 40 m_pTextEdit->setVisible(false); 39 41 /* Set selection mode: */ … … 46 48 { 47 49 /* Iterate through all indexes: */ 48 for (int iRowIndex = topLeft.row(); iRowIndex <= bottomRight.row(); iRowIndex++)50 for (int iRowIndex = topLeft.row(); iRowIndex <= bottomRight.row(); ++iRowIndex) 49 51 { 50 52 /* Get the index for current row: */ 51 QModelIndex index = topLeft.sibling(iRowIndex, topLeft.column());53 const QModelIndex index = topLeft.sibling(iRowIndex, topLeft.column()); 52 54 /* If index is valid: */ 53 55 if (index.isValid()) 54 56 { 55 57 /* 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(); 57 59 /* If there is no data hide the item: */ 58 60 if (iCount == 0) … … 68 70 { 69 71 QString strText; 70 /* Get Selection model: */72 /* Get selection model: */ 71 73 QItemSelectionModel *pSelectionModel = selectionModel(); 72 74 if (pSelectionModel) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationView.h
r60021 r65282 27 27 class UIInformationItem; 28 28 29 29 30 /** QListView extension 30 31 * providing GUI with information-view in session-information window. */ … … 34 35 35 36 public: 36 /** Constructs information-view passing @a pParent to base-class. */ 37 38 /** Constructs information-view passing @a pParent to the base-class. */ 37 39 UIInformationView(QWidget *pParent = 0); 38 40 39 41 public slots: 42 40 43 /** Handles updating data for the index-range @a topLeft to @a bottomRight. */ 41 44 void updateData(const QModelIndex &topLeft, const QModelIndex &bottomRight); 42 45 43 46 protected slots: 47 44 48 /** Handles Qt key-press @a pEvent. */ 45 49 void keyPressEvent(QKeyEvent *pEvent); 46 50 47 51 private: 48 /** Holds the instance of textedit we create. */ 52 53 /** Holds the text-edit instance. */ 49 54 QTextEdit *m_pTextEdit; 50 55 };
Note:
See TracChangeset
for help on using the changeset viewer.