Changeset 89046 in vbox for trunk/src/VBox
- Timestamp:
- May 14, 2021 1:37:15 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime/information
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp
r88900 r89046 62 62 , m_pMachineWindow(pMachineWindow) 63 63 , m_fCloseEmitted(false) 64 , m_iGeometrySaveTimerId(-1) 64 65 { 65 66 /* Prepare: */ … … 111 112 } 112 113 113 void UIVMInformationDialog::resizeEvent(QResizeEvent *pEvent) 114 { 115 saveDialogGeometry(); 116 QMainWindowWithRestorableGeometryAndRetranslateUi::resizeEvent(pEvent); 117 } 118 119 void UIVMInformationDialog::moveEvent(QMoveEvent *pEvent) 120 { 121 QMainWindowWithRestorableGeometryAndRetranslateUi::moveEvent(pEvent); 122 saveDialogGeometry(); 114 bool UIVMInformationDialog::event(QEvent *pEvent) 115 { 116 switch (pEvent->type()) 117 { 118 case QEvent::Resize: 119 case QEvent::Move: 120 { 121 if (m_iGeometrySaveTimerId != -1) 122 killTimer(m_iGeometrySaveTimerId); 123 m_iGeometrySaveTimerId = startTimer(300); 124 break; 125 } 126 case QEvent::Timer: 127 { 128 QTimerEvent *pTimerEvent = static_cast<QTimerEvent*>(pEvent); 129 if (pTimerEvent->timerId() == m_iGeometrySaveTimerId) 130 { 131 killTimer(m_iGeometrySaveTimerId); 132 m_iGeometrySaveTimerId = -1; 133 saveDialogGeometry(); 134 } 135 break; 136 } 137 default: 138 break; 139 } 140 return QMainWindowWithRestorableGeometryAndRetranslateUi::event(pEvent); 123 141 } 124 142 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.h
r88900 r89046 68 68 virtual void retranslateUi() /* override */; 69 69 virtual void closeEvent(QCloseEvent *pEvent) /* override */; 70 virtual void resizeEvent(QResizeEvent *pEvent) /* override */; 71 virtual void moveEvent(QMoveEvent *pEvent) /* override */; 70 virtual bool event(QEvent *pEvent) /* override */; 72 71 73 72 private slots: … … 105 104 /** @} */ 106 105 bool m_fCloseEmitted; 106 int m_iGeometrySaveTimerId; 107 107 }; 108 108
Note:
See TracChangeset
for help on using the changeset viewer.