Changeset 90705 in vbox
- Timestamp:
- Aug 17, 2021 4:48:16 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 146325
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r88678 r90705 148 148 pMachineView->prepareCommon(); 149 149 150 #ifdef VBOX_WITH_DRAG_AND_DROP 151 /* Prepare DnD: */ 152 pMachineView->prepareDnd(); 153 #endif 154 150 155 /* Prepare event-filters: */ 151 156 pMachineView->prepareFilters(); … … 180 185 return; 181 186 187 #ifdef VBOX_WITH_DRAG_AND_DROP 188 /* Cleanup DnD: */ 189 pMachineView->cleanupDnd(); 190 #endif 191 182 192 /* Cleanup frame-buffer: */ 183 193 pMachineView->cleanupFrameBuffer(); 184 185 #ifdef VBOX_WITH_DRAG_AND_DROP186 if (pMachineView->m_pDnDHandler)187 {188 delete pMachineView->m_pDnDHandler;189 pMachineView->m_pDnDHandler = NULL;190 }191 #endif192 194 193 195 /* Cleanup native filters: */ … … 790 792 } 791 793 794 void UIMachineView::sltDetachCOM() 795 { 796 #ifdef VBOX_WITH_DRAG_AND_DROP 797 /* Cleanup DnD: */ 798 cleanupDnd(); 799 #endif 800 } 801 792 802 UIMachineView::UIMachineView(UIMachineWindow *pMachineWindow, ulong uScreenId) 793 803 : QAbstractScrollArea(pMachineWindow->centralWidget()) … … 949 959 /* Setup focus policy: */ 950 960 setFocusPolicy(Qt::WheelFocus); 961 } 951 962 952 963 #ifdef VBOX_WITH_DRAG_AND_DROP 964 void UIMachineView::prepareDnd() 965 { 953 966 /* Enable drag & drop: */ 954 967 setAcceptDrops(true); … … 956 969 /* Create the drag and drop handler instance: */ 957 970 m_pDnDHandler = new UIDnDHandler(uisession(), this /* pParent */); 971 } 958 972 #endif /* VBOX_WITH_DRAG_AND_DROP */ 959 }960 973 961 974 void UIMachineView::prepareFilters() … … 977 990 void UIMachineView::prepareConnections() 978 991 { 992 /* UICommon connections: */ 993 connect(&uiCommon(), &UICommon::sigAskToDetachCOM, this, &UIMachineView::sltDetachCOM); 979 994 /* Desktop resolution change (e.g. monitor hotplug): */ 980 995 connect(gpDesktop, &UIDesktopWidgetWatchdog::sigHostScreenResized, … … 1004 1019 connect(uisession(), &UISession::sigMousePointerShapeChange, this, &UIMachineView::sltMousePointerShapeChange); 1005 1020 } 1021 1022 #ifdef VBOX_WITH_DRAG_AND_DROP 1023 void UIMachineView::cleanupDnd() 1024 { 1025 delete m_pDnDHandler; 1026 m_pDnDHandler = 0; 1027 } 1028 #endif /* VBOX_WITH_DRAG_AND_DROP */ 1006 1029 1007 1030 void UIMachineView::cleanupFrameBuffer() -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
r88678 r90705 153 153 void sltMousePointerShapeChange(); 154 154 155 /** Detaches COM. */ 156 void sltDetachCOM(); 157 155 158 protected: 156 159 … … 166 169 virtual void prepareFrameBuffer(); 167 170 virtual void prepareCommon(); 171 #ifdef VBOX_WITH_DRAG_AND_DROP 172 virtual void prepareDnd(); 173 #endif 168 174 virtual void prepareFilters(); 169 175 virtual void prepareConnections(); … … 174 180 //virtual void cleanupConnections() {} 175 181 //virtual void cleanupFilters() {} 182 #ifdef VBOX_WITH_DRAG_AND_DROP 183 virtual void cleanupDnd(); 184 #endif 176 185 //virtual void cleanupCommon() {} 177 186 virtual void cleanupFrameBuffer();
Note:
See TracChangeset
for help on using the changeset viewer.