VirtualBox

Changeset 103651 in vbox for trunk


Ignore:
Timestamp:
Mar 3, 2024 9:55:18 AM (7 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9080. Alt+dbl/ click adds selected items to Viso.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerTable.cpp

    r102537 r103651  
    7474
    7575    void sigSelectionChanged(const QItemSelection & selected, const QItemSelection & deselected);
     76    /* Emitted upon mouse double click while Alt key is pressed.  */
     77    void sigAltDoubleClick();
    7678
    7779public:
     
    8486
    8587    virtual void selectionChanged(const QItemSelection & selected, const QItemSelection & deselected) /*override */;
     88    virtual void mouseDoubleClickEvent(QMouseEvent *event) override;
     89    virtual void mousePressEvent(QMouseEvent *event) override;
    8690
    8791private:
     
    229233}
    230234
     235void UIGuestControlFileView::mousePressEvent(QMouseEvent *event)
     236{
     237    if (qApp->queryKeyboardModifiers() & Qt::AltModifier)
     238        return;
     239    QTableView::mousePressEvent(event);
     240}
     241
     242void UIGuestControlFileView::mouseDoubleClickEvent(QMouseEvent *event)
     243{
     244    if (qApp->queryKeyboardModifiers() & Qt::AltModifier)
     245    {
     246        printf("dou\n");
     247        emit sigAltDoubleClick();
     248        return;
     249    }
     250    QTableView::mouseDoubleClickEvent(event);
     251}
    231252
    232253/*********************************************************************************************************************************
     
    492513        connect(m_pView, &UIGuestControlFileView::doubleClicked,
    493514                this, &UIFileManagerTable::sltItemDoubleClicked);
     515        connect(m_pView, &UIGuestControlFileView::sigAltDoubleClick,
     516                this, &UIFileManagerTable::sltAltDoubleClick);
    494517        connect(m_pView, &UIGuestControlFileView::clicked,
    495518                this, &UIFileManagerTable::sltItemClicked);
     
    613636    QModelIndex nIndex = m_pProxyModel ? m_pProxyModel->mapToSource(index) : index;
    614637    goIntoDirectory(nIndex);
     638}
     639
     640void UIFileManagerTable::sltAltDoubleClick()
     641{
     642    emit sigAltDoubleClick();
    615643}
    616644
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerTable.h

    r102507 r103651  
    148148    void sigDeleteConfirmationOptionChanged();
    149149    void sigSelectionChanged(bool fHasSelection);
     150    void sigAltDoubleClick();
    150151
    151152public:
     
    175176    void sltItemDoubleClicked(const QModelIndex &index);
    176177    void sltItemClicked(const QModelIndex &index);
     178    void sltAltDoubleClick();
    177179    void sltGoUp();
    178180    void sltGoHome();
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp

    r103578 r103651  
    578578    if (m_pHostFileBrowser)
    579579    {
    580     //     connect(m_pHostBrowser, &UIVisoHostBrowser::sigAddObjectsToViso,
    581     //             this, &UIVisoCreatorWidget::sltAddObjectsToViso);
     580        connect(m_pHostFileBrowser, &UIVisoHostBrowser::sigAltDoubleClick,
     581                this, &UIVisoCreatorWidget::sltAddObjectsToViso);
    582582        connect(m_pHostFileBrowser, &UIVisoHostBrowser::sigSelectionChanged,
    583583                this, &UIVisoCreatorWidget::sltHostBrowserTableSelectionChanged);
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