Changeset 8705
- Timestamp:
- 05/08/08 15:16:30 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/VBox/Frontends/VirtualBox/src/QIStateIndicator.cpp
r8170 r8705 158 158 void QIStateIndicator::mousePressEvent (QMouseEvent *aEv) 159 159 { 160 QContextMenuEvent qme (QContextMenuEvent::Mouse, aEv->pos(), aEv->globalPos(), 0); 161 emit contextMenuRequested (this, &qme); 162 if (qme.isAccepted()) 163 aEv->accept(); 164 else 160 /* Do this for the left mouse button event only, cause in the case of the 161 * right mouse button it could happen that the context menu event is 162 * triggered twice. Also this isn't necessary for the middle mouse button 163 * which would be some kind of overstated. */ 164 if (aEv->button() == Qt::LeftButton) 165 { 166 QContextMenuEvent qme (QContextMenuEvent::Mouse, aEv->pos(), aEv->globalPos(), 0); 167 emit contextMenuRequested (this, &qme); 168 if (qme.isAccepted()) 169 aEv->accept(); 170 else 171 QFrame::mousePressEvent (aEv); 172 }else 165 173 QFrame::mousePressEvent (aEv); 166 174 } trunk/src/VBox/Frontends/VirtualBox4/src/QIStateIndicator.cpp
r8170 r8705 171 171 void QIStateIndicator::mousePressEvent (QMouseEvent *aEv) 172 172 { 173 QContextMenuEvent qme (QContextMenuEvent::Mouse, aEv->pos(), aEv->globalPos(), 0); 174 emit contextMenuRequested (this, &qme); 175 if (qme.isAccepted()) 176 aEv->accept(); 177 else 173 /* Do this for the left mouse button event only, cause in the case of the 174 * right mouse button it could happen that the context menu event is 175 * triggered twice. Also this isn't necessary for the middle mouse button 176 * which would be some kind of overstated. */ 177 if (aEv->button() == Qt::LeftButton) 178 { 179 QContextMenuEvent qme (QContextMenuEvent::Mouse, aEv->pos(), aEv->globalPos(), 0); 180 emit contextMenuRequested (this, &qme); 181 if (qme.isAccepted()) 182 aEv->accept(); 183 else 184 QFrame::mousePressEvent (aEv); 185 }else 178 186 QFrame::mousePressEvent (aEv); 179 187 }

