Changeset 71408 in vbox for trunk/src/VBox
- Timestamp:
- Mar 20, 2018 3:25:41 PM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/extensions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIStatusBarIndicator.cpp
r69500 r71408 5 5 6 6 /* 7 * Copyright (C) 2006-201 7Oracle Corporation7 * Copyright (C) 2006-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 21 21 22 22 /* Qt includes: */ 23 # include <QApplication> 24 # include <QHBoxLayout> 25 # include <QLabel> 23 26 # include <QIcon> 24 27 # include <QPainter> 25 # include <QHBoxLayout>26 # include <QApplication>27 28 # include <QStyle> 28 # include <QLabel>29 29 # ifdef VBOX_WS_MAC 30 30 # include <QContextMenuEvent> … … 40 40 41 41 42 /********************************************************************************************************************************* 43 * Class QIStatusBarIndicator implementation. * 44 *********************************************************************************************************************************/ 42 45 43 46 QIStatusBarIndicator::QIStatusBarIndicator(QWidget *pParent /* = 0 */) … … 51 54 void QIStatusBarIndicator::mousePressEvent(QMouseEvent *pEvent) 52 55 { 53 /* Do this for the left mouse button event only, cause in the case of the 54 * right mouse button it could happen that the context menu event is 55 * triggered twice. Also this isn't necessary for the middle mouse button 56 * which would be some kind of overstated. */ 56 // WORKAROUND: 57 // Do this for the left mouse button event only, cause in the case of the 58 // right mouse button it could happen that the context menu event is 59 // triggered twice. Also this isn't necessary for the middle mouse button 60 // which would be some kind of overstated. 57 61 if (pEvent->button() == Qt::LeftButton) 58 62 { … … 80 84 81 85 86 /********************************************************************************************************************************* 87 * Class QIStateStatusBarIndicator implementation. * 88 *********************************************************************************************************************************/ 89 82 90 QIStateStatusBarIndicator::QIStateStatusBarIndicator(QWidget *pParent /* = 0 */) 83 91 : QIStatusBarIndicator(pParent) … … 102 110 } 103 111 104 void QIStateStatusBarIndicator::paintEvent(QPaintEvent *)112 void QIStateStatusBarIndicator::paintEvent(QPaintEvent *) 105 113 { 106 114 QPainter painter(this); … … 114 122 } 115 123 124 125 /********************************************************************************************************************************* 126 * Class QITextStatusBarIndicator implementation. * 127 *********************************************************************************************************************************/ 116 128 117 129 QITextStatusBarIndicator::QITextStatusBarIndicator(QWidget *pParent /* = 0 */) -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIStatusBarIndicator.h
r69500 r71408 5 5 6 6 /* 7 * Copyright (C) 2006-201 7Oracle Corporation7 * Copyright (C) 2006-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 20 20 21 21 /* Qt includes: */ 22 #include <QIcon> 23 #include <QMap> 22 24 #include <QWidget> 23 #include <QMap>24 #include <QIcon>25 25 26 26 /* Forward declarations: */ 27 class QIcon; 27 28 class QLabel; 29 class QSize; 30 class QString; 31 class QWidget; 32 28 33 29 34 /** QWidget extension used as status-bar indicator. */ … … 41 46 public: 42 47 43 /** Construct or, passes @a pParent to the QWidget constructor. */48 /** Constructs status-bar indicator passing @a pParent to the base-class. */ 44 49 QIStatusBarIndicator(QWidget *pParent = 0); 45 50 … … 50 55 51 56 #ifdef VBOX_WS_MAC 52 /** Mac OS X: Mouse-press-event handler. 53 * Make the left button also show the context-menu to make things 54 * simpler for users with single mouse button mice (laptops++). */ 55 virtual void mousePressEvent(QMouseEvent *pEvent); 57 /** Handles mouse-press @a pEvent. */ 58 virtual void mousePressEvent(QMouseEvent *pEvent) /* override */; 56 59 #endif /* VBOX_WS_MAC */ 57 /** Mouse-double-click-event handler. */ 58 virtual void mouseDoubleClickEvent(QMouseEvent *pEvent); 59 /** Context-menu-event handler. */ 60 virtual void contextMenuEvent(QContextMenuEvent *pEvent); 60 /** Handles mouse-double-click @a pEvent. */ 61 virtual void mouseDoubleClickEvent(QMouseEvent *pEvent) /* override */; 62 63 /** Handles context-menu @a pEvent. */ 64 virtual void contextMenuEvent(QContextMenuEvent *pEvent) /* override */; 61 65 62 66 /** Holds currently cached size. */ 63 67 QSize m_size; 64 68 }; 69 65 70 66 71 /** QIStatusBarIndicator extension used as status-bar state indicator. */ … … 71 76 public: 72 77 73 /** Construct or, passes @a pParent to the QIStatusBarIndicator constructor. */78 /** Constructs state status-bar indicator passing @a pParent to the base-class. */ 74 79 QIStateStatusBarIndicator(QWidget *pParent = 0); 75 80 … … 91 96 protected: 92 97 93 /** Paint-event handler. */94 virtual void paintEvent(QPaintEvent *pEvent) ;98 /** Handles paint @a pEvent. */ 99 virtual void paintEvent(QPaintEvent *pEvent) /* override */; 95 100 96 /** Draw -contents routine. */101 /** Draws contents using passed @a pPainter. */ 97 102 virtual void drawContents(QPainter *pPainter); 98 103 … … 105 110 }; 106 111 112 107 113 /** QIStatusBarIndicator extension used as status-bar state indicator. */ 108 114 class QITextStatusBarIndicator : public QIStatusBarIndicator … … 112 118 public: 113 119 114 /** Construct or, passes @a pParent to the QIStatusBarIndicator constructor. */120 /** Constructs text status-bar indicator passing @a pParent to the base-class. */ 115 121 QITextStatusBarIndicator(QWidget *pParent = 0); 116 122 … … 126 132 }; 127 133 134 128 135 #endif /* !___QIStatusBarIndicators_h___ */ 136
Note:
See TracChangeset
for help on using the changeset viewer.