Changeset 59699 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Feb 16, 2016 11:14:18 AM (9 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
r59647 r59699 21 21 22 22 # include <QClipboard> 23 # include <QDebug>24 23 25 24 /* GUI includes: */ … … 34 33 } 35 34 36 void UIInformationView::updateData(const QModelIndex & topLeft, const QModelIndex &bottomRight)35 void UIInformationView::updateData(const QModelIndex &topLeft, const QModelIndex &bottomRight) 37 36 { 38 37 update(topLeft); 39 38 } 40 39 40 void UIInformationView::keyPressEvent(QKeyEvent *pEvent) 41 { 42 if (pEvent == QKeySequence::Copy) 43 { 44 if (selectionModel()) 45 { 46 QString strText; 47 foreach (const QModelIndex &index, selectionModel()->selectedIndexes()) 48 { 49 UIInformationItem *pItem = dynamic_cast<UIInformationItem*>(itemDelegate(index)); 50 if (pItem) 51 { 52 strText.append(pItem->htmlData()); 53 } 54 } 55 QApplication::clipboard()->setText(strText); 56 pEvent->accept(); 57 } 58 } 59 } 60 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationView.h
r59647 r59699 34 34 35 35 public slots: 36 void updateData(const QModelIndex & topLeft, const QModelIndex & bottomRight); 36 /** Handles updating data for the index-range @a topLeft to @a bottomRight. */ 37 void updateData(const QModelIndex &topLeft, const QModelIndex &bottomRight); 37 38 39 protected slots: 40 /** Handles Qt key-press @a pEvent. */ 41 void keyPressEvent(QKeyEvent *pEvent); 38 42 }; 39 43
Note:
See TracChangeset
for help on using the changeset viewer.