VirtualBox

Changeset 94762 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 29, 2022 4:10:38 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10215. Manager UI accepts dropped files from system file manager. It handles them the same way it handles files passed from command line.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r94660 r94762  
    462462{
    463463    s_pInstance = this;
     464    setAcceptDrops(true);
    464465}
    465466
     
    590591    /* Quit application: */
    591592    QApplication::quit();
     593}
     594
     595void UIVirtualBoxManager::dragEnterEvent(QDragEnterEvent *pEvent)
     596{
     597    if (pEvent->mimeData()->hasUrls())
     598        pEvent->acceptProposedAction();
     599}
     600
     601void UIVirtualBoxManager::dropEvent(QDropEvent *pEvent)
     602{
     603    if (!pEvent->mimeData()->hasUrls())
     604        return;
     605    sltHandleOpenUrlCall(pEvent->mimeData()->urls());
     606    pEvent->acceptProposedAction();
    592607}
    593608
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h

    r94593 r94762  
    103103        /** Handles close @a pEvent. */
    104104        virtual void closeEvent(QCloseEvent *pEvent) RT_OVERRIDE;
     105        /** Handles drag enter @a pEvent. */
     106        virtual void dragEnterEvent(QDragEnterEvent *event) RT_OVERRIDE;
     107        /** Handles drop @a pEvent. */
     108        virtual void dropEvent(QDropEvent *event) RT_OVERRIDE;
    105109    /** @} */
    106110
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