Changeset 86081 in vbox
- Timestamp:
- Sep 10, 2020 11:41:22 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMainDialog.cpp
r82968 r86081 218 218 void QIMainDialog::showEvent(QShowEvent *pEvent) 219 219 { 220 /* Call to polish-event: */ 221 polishEvent(pEvent); 220 /* Polish dialog if necessary: */ 221 if (!m_fPolished) 222 { 223 polishEvent(pEvent); 224 m_fPolished = true; 225 } 222 226 223 227 /* Call to base-class: */ … … 227 231 void QIMainDialog::polishEvent(QShowEvent *) 228 232 { 229 /* Make sure we should polish dialog: */230 if (m_fPolished)231 return;232 233 233 /* Explicit centering according to our parent: */ 234 234 if (m_fIsAutoCentering) 235 235 UICommon::centerWidget(this, parentWidget(), false); 236 237 /* Mark dialog as polished: */238 m_fPolished = true;239 236 } 240 237 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp
r85881 r86081 53 53 , m_pSelector(0) 54 54 , m_pStack(0) 55 , m_fPolished(false)56 55 , m_enmConfigurationAccessLevel(ConfigurationAccessLevel_Null) 57 56 , m_pSerializeProcess(0) … … 268 267 } 269 268 270 void UISettingsDialog::showEvent(QShowEvent *pEvent) 271 { 272 /* Base-class processing: */ 273 QIMainDialog::showEvent(pEvent); 274 275 /* One may think that QWidget::polish() is the right place to do things 276 * below, but apparently, by the time when QWidget::polish() is called, 277 * the widget style & layout are not fully done, at least the minimum 278 * size hint is not properly calculated. Since this is sometimes necessary, 279 * we provide our own "polish" implementation. */ 280 if (m_fPolished) 281 return; 282 283 m_fPolished = true; 284 285 int iMinWidth = m_pSelector->minWidth(); 269 void UISettingsDialog::polishEvent(QShowEvent *pEvent) 270 { 271 /* Check what's the minimum selector size: */ 272 const int iMinWidth = m_pSelector->minWidth(); 286 273 287 274 #ifdef VBOX_WS_MAC … … 337 324 338 325 #endif /* VBOX_WS_MAC */ 326 327 /* Call to base-class: */ 328 QIWithRetranslateUI<QIMainDialog>::polishEvent(pEvent); 339 329 } 340 330 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.h
r85881 r86081 91 91 /** Handles translation event. */ 92 92 virtual void retranslateUi() /* override */; 93 /** Handles show @a pEvent. */94 virtual void showEvent(QShowEvent *pEvent) /* override */;93 /** Handles first show @a pEvent. */ 94 virtual void polishEvent(QShowEvent *pEvent) /* override */; 95 95 96 96 /** Returns the serialize process instance. */ … … 170 170 void assignValidator(UISettingsPage *pPage); 171 171 172 /** Holds whether the dialog is polished. */173 bool m_fPolished;174 175 172 /** Holds configuration access level. */ 176 173 ConfigurationAccessLevel m_enmConfigurationAccessLevel;
Note:
See TracChangeset
for help on using the changeset viewer.