Changeset 100086 in vbox
- Timestamp:
- Jun 6, 2023 3:15:12 PM (18 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QISplitter.cpp
r98103 r100086 316 316 const int margin = 3; 317 317 QMouseEvent *pMouseEvent = static_cast<QMouseEvent*>(pEvent); 318 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::globalPos was replaced with QSinglePointEvent::globalPosition in Qt6 */ 319 const QPoint gPos = pMouseEvent->globalPos(); 320 #else 321 const QPoint gPos = pMouseEvent->globalPosition().toPoint(); 322 #endif 318 323 for (int i=1; i < count(); ++i) 319 324 { … … 323 328 { 324 329 /* Check if we hit the handle */ 325 bool fMarginHit = QRect(pHandle->mapToGlobal(QPoint(0, 0)), pHandle->size()).adjusted(-margin, 0, margin, 0).contains( pMouseEvent->globalPos());330 bool fMarginHit = QRect(pHandle->mapToGlobal(QPoint(0, 0)), pHandle->size()).adjusted(-margin, 0, margin, 0).contains(gPos); 326 331 if (pEvent->type() == QEvent::MouseButtonPress) 327 332 { … … 333 338 UICursor::setCursor(this, Qt::SplitHCursor); 334 339 qApp->postEvent(pHandle, new QMouseEvent(pMouseEvent->type(), 335 pHandle->mapFromGlobal( pMouseEvent->globalPos()),340 pHandle->mapFromGlobal(gPos), 336 341 pMouseEvent->button(), 337 342 pMouseEvent->buttons(), … … 349 354 UICursor::setCursor(this, Qt::SplitHCursor); 350 355 qApp->postEvent(pHandle, new QMouseEvent(pMouseEvent->type(), 351 pHandle->mapFromGlobal( pMouseEvent->globalPos()),356 pHandle->mapFromGlobal(gPos), 352 357 pMouseEvent->button(), 353 358 pMouseEvent->buttons(), -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIStatusBarIndicator.cpp
r100075 r100086 68 68 if (pEvent->button() == Qt::LeftButton) 69 69 { 70 QContextMenuEvent cme(QContextMenuEvent::Mouse, pEvent->pos(), pEvent->globalPos()); 70 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::globalPos was replaced with QSinglePointEvent::globalPosition in Qt6 */ 71 const QPoint gPos = pEvent->globalPos(); 72 #else 73 const QPoint gPos = pEvent->globalPosition().toPoint(); 74 #endif 75 QContextMenuEvent cme(QContextMenuEvent::Mouse, pEvent->pos(), gPos); 71 76 emit sigContextMenuRequest(this, &cme); 72 77 if (cme.isAccepted()) -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.cpp
r99910 r100086 298 298 { 299 299 QMouseEvent *pMouseEvent = static_cast<QMouseEvent*>(pEvent); 300 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::globalPos was replaced with QSinglePointEvent::globalPosition in Qt6 */ 301 const QPoint gPos = pMouseEvent->globalPos(); 302 #else 303 const QPoint gPos = pMouseEvent->globalPosition().toPoint(); 304 #endif 300 305 if (pMouseEvent->buttons() == Qt::LeftButton) 301 306 { 302 307 if (m_previousMousePosition != QPoint(-1, -1)) 303 emit sigDragging( pMouseEvent->globalPos()- m_previousMousePosition);304 m_previousMousePosition = pMouseEvent->globalPos();308 emit sigDragging(gPos - m_previousMousePosition); 309 m_previousMousePosition = gPos; 305 310 UICursor::setCursor(m_pDragMoveLabel, Qt::ClosedHandCursor); 306 311 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp
r100064 r100086 1 /* $Id$ */1 /* $Id$ */ 2 2 /** @file 3 3 * VBox Qt GUI - UIMouseHandler class implementation. … … 650 650 /* Get mouse-event: */ 651 651 QMouseEvent *pOldMouseEvent = static_cast<QMouseEvent*>(pEvent); 652 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::globalPos was replaced with QSinglePointEvent::globalPosition in Qt6 */ 653 const QPoint gPos = pOldMouseEvent->globalPos(); 654 #else 655 const QPoint gPos = pOldMouseEvent->globalPosition().toPoint(); 656 #endif 652 657 653 658 /* Check which viewport(s) we *probably* hover: */ … … 655 660 foreach (QWidget *pViewport, m_viewports) 656 661 { 657 QPoint posInViewport = pViewport->mapFromGlobal( pOldMouseEvent->globalPos());662 QPoint posInViewport = pViewport->mapFromGlobal(gPos); 658 663 if (pViewport->geometry().adjusted(0, 0, 1, 1).contains(posInViewport)) 659 664 probablyHoveredViewports << pViewport; … … 669 674 /* Prepare redirected mouse-move event: */ 670 675 QMouseEvent *pNewMouseEvent = new QMouseEvent(pOldMouseEvent->type(), 671 pHoveredWidget->mapFromGlobal( pOldMouseEvent->globalPos()),672 pOldMouseEvent->globalPos(),676 pHoveredWidget->mapFromGlobal(gPos), 677 gPos, 673 678 pOldMouseEvent->button(), 674 679 pOldMouseEvent->buttons(), … … 715 720 { 716 721 QMouseEvent *pMouseEvent = static_cast<QMouseEvent*>(pEvent); 722 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::globalPos was replaced with QSinglePointEvent::globalPosition in Qt6 */ 723 const QPoint gPos = pMouseEvent->globalPos(); 724 #else 725 const QPoint gPos = pMouseEvent->globalPosition().toPoint(); 726 #endif 717 727 #ifdef VBOX_WS_NIX 718 728 /* When the keyboard is captured, we also capture mouse button … … 732 742 733 743 if (mouseEvent(pMouseEvent->type(), uScreenId, 734 pMouseEvent->pos(), pMouseEvent->globalPos(),744 pMouseEvent->pos(), gPos, 735 745 pMouseEvent->buttons(), 0, Qt::Horizontal)) 736 746 return true; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIStorageSettingsEditor.cpp
r98103 r100086 4040 4040 4041 4041 /* Check whether we should initiate dragging: */ 4042 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::globalPos was replaced with QSinglePointEvent::globalPosition in Qt6 */ 4043 const QPoint gPos = pEvent->globalPos(); 4044 #else 4045 const QPoint gPos = pEvent->globalPosition().toPoint(); 4046 #endif 4042 4047 if ( !m_mousePressPosition.isNull() 4043 && QLineF( pEvent->screenPos(), m_mousePressPosition).length() >= QApplication::startDragDistance())4048 && QLineF(gPos, m_mousePressPosition).length() >= QApplication::startDragDistance()) 4044 4049 { 4045 4050 /* Forget last mouse press position: */ … … 4080 4085 AssertPtrReturnVoid(pEvent); 4081 4086 4087 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::globalPos was replaced with QSinglePointEvent::globalPosition in Qt6 */ 4088 const QPoint gPos = pEvent->globalPos(); 4089 #else 4090 const QPoint gPos = pEvent->globalPosition().toPoint(); 4091 #endif 4092 4082 4093 /* Acquire indexes: */ 4083 4094 const QModelIndex currentIndex = m_pTreeViewStorage->currentIndex(); … … 4087 4098 /* Remember last mouse press position only if we pressed current index: */ 4088 4099 if (index == currentIndex) 4089 m_mousePressPosition = pEvent->globalPos();4100 m_mousePressPosition = gPos; 4090 4101 4091 4102 /* Expander icon: */ -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIStatusBarEditorWindow.cpp
r100075 r100086 305 305 306 306 /* Remember mouse-press position: */ 307 m_mousePressPosition = pEvent->globalPos(); 307 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::globalPos was replaced with QSinglePointEvent::globalPosition in Qt6 */ 308 const QPoint gPos = pEvent->globalPos(); 309 #else 310 const QPoint gPos = pEvent->globalPosition().toPoint(); 311 #endif 312 m_mousePressPosition = gPos; 308 313 } 309 314 … … 356 361 357 362 /* Make sure item is really dragged: */ 358 if (QLineF(pEvent->globalPos(), m_mousePressPosition).length() < 363 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::globalPos was replaced with QSinglePointEvent::globalPosition in Qt6 */ 364 const QPoint gPos = pEvent->globalPos(); 365 #else 366 const QPoint gPos = pEvent->globalPosition().toPoint(); 367 #endif 368 if (QLineF(gPos, m_mousePressPosition).length() < 359 369 QApplication::startDragDistance()) 360 370 return QWidget::mouseMoveEvent(pEvent); -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UITabBar.cpp
r100075 r100086 546 546 547 547 /* Remember mouse-press position: */ 548 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::globalPos was replaced with QSinglePointEvent::globalPosition in Qt6 */ 548 549 m_mousePressPosition = pEvent->globalPos(); 550 #else 551 m_mousePressPosition = pEvent->globalPosition().toPoint(); 552 #endif 549 553 } 550 554 … … 569 573 570 574 /* Make sure item is now being dragged: */ 571 if (QLineF(pEvent->globalPos(), m_mousePressPosition).length() < QApplication::startDragDistance()) 575 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::globalPos was replaced with QSinglePointEvent::globalPosition in Qt6 */ 576 const QPoint gPos = pEvent->globalPos(); 577 #else 578 const QPoint gPos = pEvent->globalPosition().toPoint(); 579 #endif 580 if (QLineF(gPos, m_mousePressPosition).length() < QApplication::startDragDistance()) 572 581 return QWidget::mouseMoveEvent(pEvent); 573 582
Note:
See TracChangeset
for help on using the changeset viewer.