Changeset 64402 in vbox
- Timestamp:
- Oct 24, 2016 4:44:28 PM (8 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/extensions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QITreeView.cpp
-
Property svn:keywords
changed from
Id Revision
toDate Revision Author Id
r64401 r64402 30 30 31 31 32 QITreeView::QITreeView (QWidget *aParent)33 : QTreeView (aParent)32 QITreeView::QITreeView(QWidget *pParent) 33 : QTreeView(pParent) 34 34 { 35 35 /* Mark header hidden: */ 36 setHeaderHidden 36 setHeaderHidden(true); 37 37 /* Mark root hidden: */ 38 setRootIsDecorated 38 setRootIsDecorated(false); 39 39 } 40 40 41 void QITreeView::currentChanged (const QModelIndex &aCurrent, const QModelIndex &aPrevious)41 void QITreeView::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) 42 42 { 43 43 /* Notify listeners about it: */ 44 emit currentItemChanged (aCurrent, aPrevious);44 emit currentItemChanged(current, previous); 45 45 /* Call to base-class: */ 46 QTreeView::currentChanged (aCurrent, aPrevious);46 QTreeView::currentChanged(current, previous); 47 47 } 48 48 49 void QITreeView::drawBranches (QPainter *aPainter, const QRect &aRect, const QModelIndex &aIndex) const49 void QITreeView::drawBranches(QPainter *pPainter, const QRect &rect, const QModelIndex &index) const 50 50 { 51 51 /* Notify listeners about it: */ 52 emit drawItemBranches (aPainter, aRect, aIndex);52 emit drawItemBranches(pPainter, rect, index); 53 53 /* Call to base-class: */ 54 QTreeView::drawBranches (aPainter, aRect, aIndex);54 QTreeView::drawBranches(pPainter, rect, index); 55 55 } 56 56 57 void QITreeView::mouseMoveEvent (QMouseEvent *aEvent)57 void QITreeView::mouseMoveEvent(QMouseEvent *pEvent) 58 58 { 59 59 /* Reject event initially: */ 60 aEvent->setAccepted(false);60 pEvent->setAccepted(false); 61 61 /* Notify listeners about event allowing them to handle it: */ 62 emit mouseMoved (aEvent);62 emit mouseMoved(pEvent); 63 63 /* Call to base-class only if event was not yet accepted: */ 64 if (! aEvent->isAccepted())65 QTreeView::mouseMoveEvent (aEvent);64 if (!pEvent->isAccepted()) 65 QTreeView::mouseMoveEvent(pEvent); 66 66 } 67 67 68 void QITreeView::mousePressEvent (QMouseEvent *aEvent)68 void QITreeView::mousePressEvent(QMouseEvent *pEvent) 69 69 { 70 70 /* Reject event initially: */ 71 aEvent->setAccepted(false);71 pEvent->setAccepted(false); 72 72 /* Notify listeners about event allowing them to handle it: */ 73 emit mousePressed (aEvent);73 emit mousePressed(pEvent); 74 74 /* Call to base-class only if event was not yet accepted: */ 75 if (! aEvent->isAccepted())76 QTreeView::mousePressEvent (aEvent);75 if (!pEvent->isAccepted()) 76 QTreeView::mousePressEvent(pEvent); 77 77 } 78 78 79 void QITreeView::mouseDoubleClickEvent (QMouseEvent *aEvent)79 void QITreeView::mouseDoubleClickEvent(QMouseEvent *pEvent) 80 80 { 81 81 /* Reject event initially: */ 82 aEvent->setAccepted(false);82 pEvent->setAccepted(false); 83 83 /* Notify listeners about event allowing them to handle it: */ 84 emit mouseDoubleClicked (aEvent);84 emit mouseDoubleClicked(pEvent); 85 85 /* Call to base-class only if event was not yet accepted: */ 86 if (! aEvent->isAccepted())87 QTreeView::mouseDoubleClickEvent (aEvent);86 if (!pEvent->isAccepted()) 87 QTreeView::mouseDoubleClickEvent(pEvent); 88 88 } 89 89 -
Property svn:keywords
changed from
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QITreeView.h
-
Property svn:keywords
set to
Date Revision Author Id
r64401 r64402 1 /* $Id :$ */1 /* $Id$ */ 2 2 /** @file 3 3 * VBox Qt GUI - Qt extensions: QITreeView class declaration. … … 16 16 */ 17 17 18 #ifndef __ QITreeView_h__19 #define __ QITreeView_h__18 #ifndef ___QITreeView_h___ 19 #define ___QITreeView_h___ 20 20 21 21 /* Qt includes: */ … … 28 28 Q_OBJECT; 29 29 30 signals: 31 32 /** Notifies listeners about index changed from @a previous to @a current.*/ 33 void currentItemChanged(const QModelIndex ¤t, const QModelIndex &previous); 34 35 /** Notifies listeners about painting of item branches. 36 * @param pPainter Brings the painter to draw branches. 37 * @param rect Brings the rectangle embedding branches. 38 * @param index Brings the index of the item for which branches will be painted. */ 39 void drawItemBranches(QPainter *pPainter, const QRect &rect, const QModelIndex &index) const; 40 41 /** Notifies listeners about mouse moved @a pEvent. */ 42 void mouseMoved(QMouseEvent *pEvent); 43 /** Notifies listeners about mouse pressed @a pEvent. */ 44 void mousePressed(QMouseEvent *pEvent); 45 /** Notifies listeners about mouse double-clicked @a pEvent. */ 46 void mouseDoubleClicked(QMouseEvent *pEvent); 47 30 48 public: 31 49 32 /** Constructs table-view passing @a aParent to the base-class. */ 33 QITreeView (QWidget *aParent = 0); 34 35 signals: 36 37 /** Notifies listeners about index changed from @a aPrevious to @a aCurrent.*/ 38 void currentItemChanged (const QModelIndex &aCurrent, const QModelIndex &aPrevious); 39 40 /** Notifies listeners about painting of item branches. 41 * @param aPainter Brings the painter to draw branches. 42 * @param aRect Brings the rectangle embedding branches. 43 * @param aIndex Brings the index of the item for which branches will be painted. */ 44 void drawItemBranches (QPainter *aPainter, const QRect &aRect, const QModelIndex &aIndex) const; 45 46 /** Notifies listeners about mouse moved @a aEvent. */ 47 void mouseMoved (QMouseEvent *aEvent); 48 /** Notifies listeners about mouse pressed @a aEvent. */ 49 void mousePressed (QMouseEvent *aEvent); 50 /** Notifies listeners about mouse double-clicked @a aEvent. */ 51 void mouseDoubleClicked (QMouseEvent *aEvent); 50 /** Constructs table-view passing @a pParent to the base-class. */ 51 QITreeView(QWidget *pParent = 0); 52 52 53 53 protected slots: 54 54 55 /** Handles index changed from @a aPrevious to @a aCurrent.*/56 void currentChanged (const QModelIndex &aCurrent, const QModelIndex &aPrevious);55 /** Handles index changed from @a previous to @a current.*/ 56 void currentChanged(const QModelIndex ¤t, const QModelIndex &previous); 57 57 58 58 protected: 59 59 60 60 /** Handles painting of item branches. 61 * @param aPainter Brings the painter to draw branches.62 * @param aRectBrings the rectangle embedding branches.63 * @param aIndexBrings the index of the item for which branches will be painted. */64 void drawBranches (QPainter *aPainter, const QRect &aRect, const QModelIndex &aIndex) const;61 * @param pPainter Brings the painter to draw branches. 62 * @param rect Brings the rectangle embedding branches. 63 * @param index Brings the index of the item for which branches will be painted. */ 64 void drawBranches(QPainter *pPainter, const QRect &rect, const QModelIndex &index) const; 65 65 66 /** Handles mouse move @a aEvent. */67 void mouseMoveEvent (QMouseEvent *aEvent);68 /** Handles mouse press @a aEvent. */69 void mousePressEvent (QMouseEvent *aEvent);70 /** Handles mouse double-click @a aEvent. */71 void mouseDoubleClickEvent (QMouseEvent *aEvent);66 /** Handles mouse move @a pEvent. */ 67 void mouseMoveEvent(QMouseEvent *pEvent); 68 /** Handles mouse press @a pEvent. */ 69 void mousePressEvent(QMouseEvent *pEvent); 70 /** Handles mouse double-click @a pEvent. */ 71 void mouseDoubleClickEvent(QMouseEvent *pEvent); 72 72 }; 73 73 74 #endif /* !__ QITreeView_h__ */74 #endif /* !___QITreeView_h___ */ 75 75 -
Property svn:keywords
set to
Note:
See TracChangeset
for help on using the changeset viewer.