VirtualBox

Ignore:
Timestamp:
Oct 23, 2023 4:25:05 PM (16 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
159639
Message:

FE/Qt: bugref:10450: Get rid of Qt5 stuff; This one is about position/globalPosition stuff.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/activity/overview/UIVMActivityOverviewWidget.cpp

    r100344 r101561  
    760760void UIVMActivityOverviewTableView::mousePressEvent(QMouseEvent *pEvent)
    761761{
    762 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */
    763     if (!indexAt(pEvent->pos()).isValid())
    764 #else
    765762    if (!indexAt(pEvent->position().toPoint()).isValid())
    766 #endif
    767763        clearSelection();
    768764    QTableView::mousePressEvent(pEvent);
  • trunk/src/VBox/Frontends/VirtualBox/src/activity/vmactivity/UIVMActivityMonitor.cpp

    r100351 r101561  
    361361void UIChart::mouseMoveEvent(QMouseEvent *pEvent)
    362362{
    363 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos, x, y were replaced with QSinglePointEvent::position in Qt6 */
    364     int iX = width() - pEvent->x() - m_iMarginRight;
    365 #else
    366     int iX = width() - pEvent->position().x() - m_iMarginRight;
    367 #endif
     363    const int iX = width() - pEvent->position().x() - m_iMarginRight;
    368364    m_iDataIndexUnderCursor = -1;
    369365    if (iX > m_iMarginLeft && iX <= width() - m_iMarginRight)
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QILabel.cpp

    r100344 r101561  
    169169{
    170170    /* Start dragging: */
    171 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */
    172     if (pEvent->button() == Qt::LeftButton && geometry().contains(pEvent->pos()) && m_fFullSizeSelection)
    173 #else
    174171    if (pEvent->button() == Qt::LeftButton && geometry().contains(pEvent->position().toPoint()) && m_fFullSizeSelection)
    175 #endif
    176172        m_fStartDragging = true;
    177173    /* Call to base-class: */
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QISplitter.cpp

    r100086 r101561  
    316316                const int margin = 3;
    317317                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
    321318                const QPoint gPos = pMouseEvent->globalPosition().toPoint();
    322 #endif
    323319                for (int i=1; i < count(); ++i)
    324320                {
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIStatusBarIndicator.cpp

    r101560 r101561  
    6666    if (pEvent->button() == Qt::LeftButton)
    6767    {
    68 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::globalPos was replaced with QSinglePointEvent::globalPosition in Qt6 */
    69         QContextMenuEvent cme(QContextMenuEvent::Mouse, pEvent->pos(), pEvent->globalPos());
    70 #else
    7168        QContextMenuEvent cme(QContextMenuEvent::Mouse, pEvent->position().toPoint(), pEvent->globalPosition().toPoint());
    72 #endif
    7369        emit sigContextMenuRequest(this, &cme);
    7470        if (cme.isAccepted())
  • trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.cpp

    r100344 r101561  
    459459void UIBookmarksListWidget::mousePressEvent(QMouseEvent *pEvent)
    460460{
    461 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */
    462     if (!indexAt(pEvent->pos()).isValid())
    463 #else
    464461    if (!indexAt(pEvent->position().toPoint()).isValid())
    465 #endif
    466462    {
    467463        clearSelection();
  • trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.cpp

    r100344 r101561  
    298298        {
    299299            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
    303300            const QPoint gPos = pMouseEvent->globalPosition().toPoint();
    304 #endif
    305301            if (pMouseEvent->buttons() == Qt::LeftButton)
    306302            {
     
    681677    if (fOverlayMode)
    682678        return;
    683 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */
    684     QString strAnchor = anchorAt(pEvent->pos());
    685 #else
    686679    QString strAnchor = anchorAt(pEvent->position().toPoint());
    687 #endif
    688680
    689681    if (!strAnchor.isEmpty())
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerTextEdit.cpp

    r100344 r101561  
    180180{
    181181    if (m_pTextEdit)
    182 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */
    183         m_pTextEdit->setMouseCursorLine(m_pTextEdit->lineNumberForPos(pEvent->pos()));
    184 #else
    185182        m_pTextEdit->setMouseCursorLine(m_pTextEdit->lineNumberForPos(pEvent->position().toPoint()));
    186 #endif
    187183    update();
    188184}
     
    191187{
    192188    if (m_pTextEdit)
    193 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */
    194         m_pTextEdit->toggleBookmark(m_pTextEdit->bookmarkForPos(pEvent->pos()));
    195 #else
    196189        m_pTextEdit->toggleBookmark(m_pTextEdit->bookmarkForPos(pEvent->position().toPoint()));
    197 #endif
    198190}
    199191
     
    396388void UIVMLogViewerTextEdit::mouseMoveEvent(QMouseEvent *pEvent)
    397389{
    398 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */
    399     setMouseCursorLine(lineNumberForPos(pEvent->pos()));
    400 #else
    401390    setMouseCursorLine(lineNumberForPos(pEvent->position().toPoint()));
    402 #endif
    403391    if (m_pLineNumberArea)
    404392        m_pLineNumberArea->update();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r100344 r101561  
    20112011    {
    20122012        /* Get mouse-pointer location. */
    2013 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */
    2014         const QPoint &cpnt = viewportToContents(pEvent->pos());
    2015 #else
    20162013        const QPoint &cpnt = viewportToContents(pEvent->position().toPoint());
    2017 #endif
    20182014
    20192015        /* Ask the target for starting a DnD event. */
     
    20412037    {
    20422038        /* Get mouse-pointer location. */
    2043 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */
    2044         const QPoint &cpnt = viewportToContents(pEvent->pos());
    2045 #else
    20462039        const QPoint &cpnt = viewportToContents(pEvent->position().toPoint());
    2047 #endif
    20482040
    20492041        /* Ask the guest for moving the drop cursor. */
     
    20862078    {
    20872079        /* Get mouse-pointer location. */
    2088 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */
    2089         const QPoint &cpnt = viewportToContents(pEvent->pos());
    2090 #else
    20912080        const QPoint &cpnt = viewportToContents(pEvent->position().toPoint());
    2092 #endif
    20932081
    20942082        /* Ask the guest for dropping data. */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp

    r100351 r101561  
    650650                    /* Get mouse-event: */
    651651                    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
    655652                    const QPoint gPos = pOldMouseEvent->globalPosition().toPoint();
    656 #endif
    657653
    658654                    /* Check which viewport(s) we *probably* hover: */
     
    736732                        m_iLastMouseWheelDelta = 0;
    737733
    738 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::globalPos was replaced with QSinglePointEvent::globalPosition in Qt6 */
    739                     if (mouseEvent(pMouseEvent->type(), uScreenId,
    740                                    pMouseEvent->pos(), pMouseEvent->globalPos(),
    741                                    pMouseEvent->buttons(), 0, Qt::Horizontal))
    742 #else
    743734                    if (mouseEvent(pMouseEvent->type(), uScreenId,
    744735                                   pMouseEvent->position().toPoint(), pMouseEvent->globalPosition().toPoint(),
    745736                                   pMouseEvent->buttons(), 0, Qt::Horizontal))
    746 #endif
    747737                        return true;
    748738                    break;
     
    12581248        {
    12591249            /* Get absolute touch-point origin: */
    1260 #ifndef VBOX_IS_QT6_OR_LATER /* QEventPoint::pos was replaced with QEventPoint::position in Qt6 */
    1261             QPoint currentTouchPoint = touchPoint.pos().toPoint();
    1262 #else
    12631250            QPoint currentTouchPoint = touchPoint.position().toPoint();
    1264 #endif
    12651251
    12661252            /* Pass absolute touch-point data: */
     
    12741260        } else {
    12751261            /* Get relative touch-point normalized position: */
    1276 #ifndef VBOX_IS_QT6_OR_LATER /* QEventPoint::pos was replaced with QEventPoint::position in Qt6 */
    1277             QPointF rawTouchPoint = touchPoint.normalizedPos();
    1278 #else
    12791262            QPointF rawTouchPoint = touchPoint.normalizedPosition();
    1280 #endif
    12811263
    12821264            /* Pass relative touch-point data as Normalized Integer: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIStatusBarEditor.cpp

    r101560 r101561  
    303303
    304304    /* Remember mouse-press position: */
    305 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::globalPos was replaced with QSinglePointEvent::globalPosition in Qt6 */
    306     const QPoint gPos = pEvent->globalPos();
    307 #else
    308305    const QPoint gPos = pEvent->globalPosition().toPoint();
    309 #endif
    310306    m_mousePressPosition = gPos;
    311307}
     
    359355
    360356    /* Make sure item is really dragged: */
    361 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::globalPos was replaced with QSinglePointEvent::globalPosition in Qt6 */
    362     const QPoint gPos = pEvent->globalPos();
    363 #else
    364357    const QPoint gPos = pEvent->globalPosition().toPoint();
    365 #endif
    366358    if (QLineF(gPos, m_mousePressPosition).length() <
    367359        QApplication::startDragDistance())
     
    642634
    643635    /* Get event position: */
    644 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */
    645     const QPoint lPos = pEvent->pos();
    646 #else
    647636    const QPoint lPos = pEvent->position().toPoint();
    648 #endif
    649637    /* Search for most suitable button: */
    650638    foreach (const IndicatorType &enmType, m_order)
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIStorageSettingsEditor.cpp

    r101498 r101561  
    40624062    /* Make sure event is valid: */
    40634063    AssertPtrReturnVoid(pEvent);
    4064 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::globalPos was replaced with QSinglePointEvent::globalPosition in Qt6 */
    4065     const QPoint gPos = pEvent->globalPos();
    4066     const QPoint lPos = pEvent->pos();
    4067 #else
    40684064    const QPoint gPos = pEvent->globalPosition().toPoint();
    40694065    const QPoint lPos = pEvent->position().toPoint();
    4070 #endif
    40714066
    40724067    const QModelIndex index = m_pTreeViewStorage->indexAt(lPos);
     
    41944189    /* Make sure event is valid: */
    41954190    AssertPtrReturnVoid(pEvent);
    4196 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::globalPos was replaced with QSinglePointEvent::globalPosition in Qt6 */
    4197     const QPoint gPos = pEvent->globalPos();
    4198     const QPoint lPos = pEvent->pos();
    4199 #else
    42004191    const QPoint gPos = pEvent->globalPosition().toPoint();
    42014192    const QPoint lPos = pEvent->position().toPoint();
    4202 #endif
    42034193
    42044194    /* Acquire indexes: */
     
    43004290
    43014291    /* Check what item we are hovering currently: */
    4302 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */
    4303     QModelIndex index = m_pTreeViewStorage->indexAt(pEvent->pos());
    4304 #else
    43054292    QModelIndex index = m_pTreeViewStorage->indexAt(pEvent->position().toPoint());
    4306 #endif
    43074293    AbstractItem *pItem = static_cast<AbstractItem*>(index.internalPointer());
    43084294    /* And make sure this is controller item, we are supporting dropping for this kind only: */
     
    43324318
    43334319    /* Check what item we are hovering currently: */
    4334 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */
    4335     QModelIndex index = m_pTreeViewStorage->indexAt(pEvent->pos());
    4336 #else
    43374320    QModelIndex index = m_pTreeViewStorage->indexAt(pEvent->position().toPoint());
    4338 #endif
    43394321    AbstractItem *pItem = static_cast<AbstractItem*>(index.internalPointer());
    43404322    /* And make sure this is controller item, we are supporting dropping for this kind only: */
  • trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp

    r100896 r101561  
    28382838UISoftKeyboardKey *UISoftKeyboardWidget::keyUnderMouse(QMouseEvent *pEvent)
    28392839{
    2840 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */
    2841     const QPoint lPos = pEvent->pos();
    2842 #else
    28432840    const QPoint lPos = pEvent->position().toPoint();
    2844 #endif
    28452841    QPoint eventPosition(lPos.x() / m_fScaleFactorX, lPos.y() / m_fScaleFactorY);
    28462842    if (m_fHideMultimediaKeys)
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UISpecialControls.cpp

    r100344 r101561  
    174174void UIHelpButton::mousePressEvent(QMouseEvent *pEvent)
    175175{
    176 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */
    177     if (hitButton(pEvent->pos()))
    178 #else
    179176    if (hitButton(pEvent->position().toPoint()))
    180 #endif
    181177        m_pButtonPressed = true;
    182178    QPushButton::mousePressEvent(pEvent);
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UITabBar.cpp

    r101560 r101561  
    544544
    545545    /* Remember mouse-press position: */
    546 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::globalPos was replaced with QSinglePointEvent::globalPosition in Qt6 */
    547     m_mousePressPosition = pEvent->globalPos();
    548 #else
    549546    m_mousePressPosition = pEvent->globalPosition().toPoint();
    550 #endif
    551547}
    552548
     
    571567
    572568    /* Make sure item is now being dragged: */
    573 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::globalPos was replaced with QSinglePointEvent::globalPosition in Qt6 */
    574     const QPoint gPos = pEvent->globalPos();
    575 #else
    576569    const QPoint gPos = pEvent->globalPosition().toPoint();
    577 #endif
    578570    if (QLineF(gPos, m_mousePressPosition).length() < QApplication::startDragDistance())
    579571        return QWidget::mouseMoveEvent(pEvent);
     
    907899    /* Make sure event is valid: */
    908900    AssertPtrReturnVoid(pEvent);
    909 #ifndef VBOX_IS_QT6_OR_LATER /* QMouseEvent::pos was replaced with QSinglePointEvent::position in Qt6 */
    910     const QPoint lPos = pEvent->pos();
    911 #else
    912901    const QPoint lPos = pEvent->position().toPoint();
    913 #endif
    914902
    915903    /* And mime-data is set: */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette