Changeset 100344 in vbox
- Timestamp:
- Jul 3, 2023 10:09:28 AM (17 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/activity/overview/UIVMActivityOverviewWidget.cpp
r98103 r100344 760 760 void UIVMActivityOverviewTableView::mousePressEvent(QMouseEvent *pEvent) 761 761 { 762 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */ 762 763 if (!indexAt(pEvent->pos()).isValid()) 764 #else 765 if (!indexAt(pEvent->position().toPoint()).isValid()) 766 #endif 763 767 clearSelection(); 764 768 QTableView::mousePressEvent(pEvent); -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QILabel.cpp
r98103 r100344 169 169 { 170 170 /* Start dragging: */ 171 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */ 171 172 if (pEvent->button() == Qt::LeftButton && geometry().contains(pEvent->pos()) && m_fFullSizeSelection) 173 #else 174 if (pEvent->button() == Qt::LeftButton && geometry().contains(pEvent->position().toPoint()) && m_fFullSizeSelection) 175 #endif 172 176 m_fStartDragging = true; 173 177 /* Call to base-class: */ -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIStatusBarIndicator.cpp
r100086 r100344 69 69 { 70 70 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::globalPos was replaced with QSinglePointEvent::globalPosition in Qt6 */ 71 const QPoint gPos = pEvent->globalPos();71 QContextMenuEvent cme(QContextMenuEvent::Mouse, pEvent->pos(), pEvent->globalPos()); 72 72 #else 73 const QPoint gPos = pEvent->globalPosition().toPoint();73 QContextMenuEvent cme(QContextMenuEvent::Mouse, pEvent->position().toPoint(), pEvent->globalPosition().toPoint()); 74 74 #endif 75 QContextMenuEvent cme(QContextMenuEvent::Mouse, pEvent->pos(), gPos);76 75 emit sigContextMenuRequest(this, &cme); 77 76 if (cme.isAccepted()) -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.cpp
r100064 r100344 459 459 void UIBookmarksListWidget::mousePressEvent(QMouseEvent *pEvent) 460 460 { 461 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */ 461 462 if (!indexAt(pEvent->pos()).isValid()) 463 #else 464 if (!indexAt(pEvent->position().toPoint()).isValid()) 465 #endif 462 466 { 463 467 clearSelection(); -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.cpp
r100108 r100344 681 681 if (fOverlayMode) 682 682 return; 683 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */ 683 684 QString strAnchor = anchorAt(pEvent->pos()); 685 #else 686 QString strAnchor = anchorAt(pEvent->position().toPoint()); 687 #endif 684 688 685 689 if (!strAnchor.isEmpty()) -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerTextEdit.cpp
r98103 r100344 180 180 { 181 181 if (m_pTextEdit) 182 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */ 182 183 m_pTextEdit->setMouseCursorLine(m_pTextEdit->lineNumberForPos(pEvent->pos())); 184 #else 185 m_pTextEdit->setMouseCursorLine(m_pTextEdit->lineNumberForPos(pEvent->position().toPoint())); 186 #endif 183 187 update(); 184 188 } … … 187 191 { 188 192 if (m_pTextEdit) 193 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */ 189 194 m_pTextEdit->toggleBookmark(m_pTextEdit->bookmarkForPos(pEvent->pos())); 195 #else 196 m_pTextEdit->toggleBookmark(m_pTextEdit->bookmarkForPos(pEvent->position().toPoint())); 197 #endif 190 198 } 191 199 … … 388 396 void UIVMLogViewerTextEdit::mouseMoveEvent(QMouseEvent *pEvent) 389 397 { 398 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */ 390 399 setMouseCursorLine(lineNumberForPos(pEvent->pos())); 400 #else 401 setMouseCursorLine(lineNumberForPos(pEvent->position().toPoint())); 402 #endif 391 403 if (m_pLineNumberArea) 392 404 m_pLineNumberArea->update(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r100064 r100344 2011 2011 { 2012 2012 /* Get mouse-pointer location. */ 2013 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */ 2013 2014 const QPoint &cpnt = viewportToContents(pEvent->pos()); 2015 #else 2016 const QPoint &cpnt = viewportToContents(pEvent->position().toPoint()); 2017 #endif 2014 2018 2015 2019 /* Ask the target for starting a DnD event. */ … … 2037 2041 { 2038 2042 /* Get mouse-pointer location. */ 2043 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */ 2039 2044 const QPoint &cpnt = viewportToContents(pEvent->pos()); 2045 #else 2046 const QPoint &cpnt = viewportToContents(pEvent->position().toPoint()); 2047 #endif 2040 2048 2041 2049 /* Ask the guest for moving the drop cursor. */ … … 2078 2086 { 2079 2087 /* Get mouse-pointer location. */ 2088 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */ 2080 2089 const QPoint &cpnt = viewportToContents(pEvent->pos()); 2090 #else 2091 const QPoint &cpnt = viewportToContents(pEvent->position().toPoint()); 2092 #endif 2081 2093 2082 2094 /* Ask the guest for dropping data. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp
r100086 r100344 720 720 { 721 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 #else725 const QPoint gPos = pMouseEvent->globalPosition().toPoint();726 #endif727 722 #ifdef VBOX_WS_NIX 728 723 /* When the keyboard is captured, we also capture mouse button … … 741 736 m_iLastMouseWheelDelta = 0; 742 737 738 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::globalPos was replaced with QSinglePointEvent::globalPosition in Qt6 */ 743 739 if (mouseEvent(pMouseEvent->type(), uScreenId, 744 pMouseEvent->pos(), gPos,740 pMouseEvent->pos(), pMouseEvent->globalPos(), 745 741 pMouseEvent->buttons(), 0, Qt::Horizontal)) 742 #else 743 if (mouseEvent(pMouseEvent->type(), uScreenId, 744 pMouseEvent->position().toPoint(), pMouseEvent->globalPosition().toPoint(), 745 pMouseEvent->buttons(), 0, Qt::Horizontal)) 746 #endif 746 747 return true; 747 748 break; … … 1253 1254 { 1254 1255 /* Get absolute touch-point origin: */ 1256 #ifndef VBOX_IS_QT6_OR_LATER /* QEventPoint::pos was replaced with QEventPoint::position in Qt6 */ 1255 1257 QPoint currentTouchPoint = touchPoint.pos().toPoint(); 1258 #else 1259 QPoint currentTouchPoint = touchPoint.position().toPoint(); 1260 #endif 1256 1261 1257 1262 /* Pass absolute touch-point data: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIStorageSettingsEditor.cpp
r100154 r100344 3954 3954 /* Make sure event is valid: */ 3955 3955 AssertPtrReturnVoid(pEvent); 3956 3957 const QModelIndex index = m_pTreeViewStorage->indexAt(pEvent->pos()); 3956 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::globalPos was replaced with QSinglePointEvent::globalPosition in Qt6 */ 3957 const QPoint gPos = pEvent->globalPos(); 3958 const QPoint lPos = pEvent->pos(); 3959 #else 3960 const QPoint gPos = pEvent->globalPosition().toPoint(); 3961 const QPoint lPos = pEvent->position().toPoint(); 3962 #endif 3963 3964 const QModelIndex index = m_pTreeViewStorage->indexAt(lPos); 3958 3965 const QRect indexRect = m_pTreeViewStorage->visualRect(index); 3959 3966 … … 3963 3970 QRect expanderRect = m_pModelStorage->data(index, StorageModel::R_ItemPixmapRect).toRect(); 3964 3971 expanderRect.translate(indexRect.x(), indexRect.y()); 3965 if (expanderRect.contains( pEvent->pos()))3972 if (expanderRect.contains(lPos)) 3966 3973 { 3967 3974 pEvent->setAccepted(true); … … 4004 4011 deviceRect.translate(indexRect.x() + indexRect.width(), indexRect.y()); 4005 4012 4006 if (deviceRect.contains( pEvent->pos()))4013 if (deviceRect.contains(lPos)) 4007 4014 { 4008 4015 pEvent->setAccepted(true); … … 4040 4047 4041 4048 /* 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 #else4045 const QPoint gPos = pEvent->globalPosition().toPoint();4046 #endif4047 4049 if ( !m_mousePressPosition.isNull() 4048 4050 && QLineF(gPos, m_mousePressPosition).length() >= QApplication::startDragDistance()) … … 4052 4054 4053 4055 /* Check what item we are hovering currently: */ 4054 QModelIndex index = m_pTreeViewStorage->indexAt( pEvent->pos());4056 QModelIndex index = m_pTreeViewStorage->indexAt(lPos); 4055 4057 AbstractItem *pItem = static_cast<AbstractItem*>(index.internalPointer()); 4056 4058 /* And make sure this is attachment item, we are supporting dragging for this kind only: */ … … 4084 4086 /* Make sure event is valid: */ 4085 4087 AssertPtrReturnVoid(pEvent); 4086 4087 4088 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::globalPos was replaced with QSinglePointEvent::globalPosition in Qt6 */ 4088 4089 const QPoint gPos = pEvent->globalPos(); 4090 const QPoint lPos = pEvent->pos(); 4089 4091 #else 4090 4092 const QPoint gPos = pEvent->globalPosition().toPoint(); 4093 const QPoint lPos = pEvent->position().toPoint(); 4091 4094 #endif 4092 4095 4093 4096 /* Acquire indexes: */ 4094 4097 const QModelIndex currentIndex = m_pTreeViewStorage->currentIndex(); 4095 const QModelIndex index = m_pTreeViewStorage->indexAt( pEvent->pos());4098 const QModelIndex index = m_pTreeViewStorage->indexAt(lPos); 4096 4099 const QRect indexRect = m_pTreeViewStorage->visualRect(index); 4097 4100 … … 4105 4108 QRect expanderRect = m_pModelStorage->data(index, StorageModel::R_ItemPixmapRect).toRect(); 4106 4109 expanderRect.translate(indexRect.x(), indexRect.y()); 4107 if (expanderRect.contains( pEvent->pos()))4110 if (expanderRect.contains(lPos)) 4108 4111 { 4109 4112 pEvent->setAccepted(true); … … 4145 4148 deviceRect.translate(indexRect.x() + indexRect.width(), indexRect.y()); 4146 4149 4147 if (deviceRect.contains( pEvent->pos()))4150 if (deviceRect.contains(lPos)) 4148 4151 { 4149 4152 pEvent->setAccepted(true); … … 4189 4192 4190 4193 /* Check what item we are hovering currently: */ 4194 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */ 4191 4195 QModelIndex index = m_pTreeViewStorage->indexAt(pEvent->pos()); 4196 #else 4197 QModelIndex index = m_pTreeViewStorage->indexAt(pEvent->position().toPoint()); 4198 #endif 4192 4199 AbstractItem *pItem = static_cast<AbstractItem*>(index.internalPointer()); 4193 4200 /* And make sure this is controller item, we are supporting dropping for this kind only: */ … … 4217 4224 4218 4225 /* Check what item we are hovering currently: */ 4226 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */ 4219 4227 QModelIndex index = m_pTreeViewStorage->indexAt(pEvent->pos()); 4228 #else 4229 QModelIndex index = m_pTreeViewStorage->indexAt(pEvent->position().toPoint()); 4230 #endif 4220 4231 AbstractItem *pItem = static_cast<AbstractItem*>(index.internalPointer()); 4221 4232 /* And make sure this is controller item, we are supporting dropping for this kind only: */ -
trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp
r99948 r100344 2838 2838 UISoftKeyboardKey *UISoftKeyboardWidget::keyUnderMouse(QMouseEvent *pEvent) 2839 2839 { 2840 QPoint eventPosition(pEvent->pos().x() / m_fScaleFactorX, pEvent->pos().y() / m_fScaleFactorY); 2840 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */ 2841 const QPoint lPos = pEvent->pos(); 2842 #else 2843 const QPoint lPos = pEvent->position().toPoint(); 2844 #endif 2845 QPoint eventPosition(lPos.x() / m_fScaleFactorX, lPos.y() / m_fScaleFactorY); 2841 2846 if (m_fHideMultimediaKeys) 2842 2847 eventPosition.setY(eventPosition.y() + m_multiMediaKeysLayout.totalHeight()); -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UISpecialControls.cpp
r98103 r100344 174 174 void UIHelpButton::mousePressEvent(QMouseEvent *pEvent) 175 175 { 176 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */ 176 177 if (hitButton(pEvent->pos())) 178 #else 179 if (hitButton(pEvent->position().toPoint())) 180 #endif 177 181 m_pButtonPressed = true; 178 182 QPushButton::mousePressEvent(pEvent); -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIStatusBarEditorWindow.cpp
r100086 r100344 653 653 654 654 /* Get event position: */ 655 const QPoint pos = pEvent->pos(); 655 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */ 656 const QPoint lPos = pEvent->pos(); 657 #else 658 const QPoint lPos = pEvent->position().toPoint(); 659 #endif 656 660 /* Search for most suitable button: */ 657 661 foreach (const IndicatorType &enmType, m_order) … … 659 663 m_pButtonDropToken = m_buttons.value(enmType); 660 664 const QRect geo = m_pButtonDropToken->geometry(); 661 if ( pos.x() < geo.center().x())665 if (lPos.x() < geo.center().x()) 662 666 { 663 667 m_fDropAfterTokenButton = false; -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UITabBar.cpp
r100086 r100344 917 917 /* Make sure event is valid: */ 918 918 AssertPtrReturnVoid(pEvent); 919 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */ 920 const QPoint lPos = pEvent->pos(); 921 #else 922 const QPoint lPos = pEvent->position().toPoint(); 923 #endif 924 919 925 /* And mime-data is set: */ 920 926 const QMimeData *pMimeData = pEvent->mimeData(); … … 929 935 m_fDropAfterTokenItem = true; 930 936 931 /* Get event position: */932 const QPoint pos = pEvent->pos();933 937 /* Search for most suitable item: */ 934 938 foreach (UITabBarItem *pItem, m_aItems) … … 937 941 m_pItemToken = pItem; 938 942 const QRect geo = m_pItemToken->geometry(); 939 if ( pos.x() < geo.center().x())943 if (lPos.x() < geo.center().x()) 940 944 { 941 945 m_fDropAfterTokenItem = false;
Note:
See TracChangeset
for help on using the changeset viewer.