MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / OnParentNaitveWindowEvent

Method OnParentNaitveWindowEvent

DSView/pv/mainframe.cpp:252–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252void MainFrame::OnParentNaitveWindowEvent(int msg)
253{
254
255#ifdef _WIN32
256 if (_parentNativeWidget != NULL
257 && msg == PARENT_EVENT_DISPLAY_CHANGED){
258
259 qApp->processEvents(); //wait the screen dpi ready.
260
261 QTimer::singleShot(100, this, [this](){
262 auto screen = _parentNativeWidget->GetPointScreen();
263 if (screen == NULL){
264 dsv_info("ERROR: MainFrame::OnParentNaitveWindowEvent, failed to get pointing screen.");
265 screen = QGuiApplication::primaryScreen();
266 }
267
268 PopupDlgList::TryCloseAllByScreenChanged(screen);
269 PopupDlgList::SetCurrentScreen(screen);
270
271 _parentNativeWidget->UpdateChildDpi();
272 _parentNativeWidget->ResizeChild();
273 _parentNativeWidget->ReShowWindow();
274 });
275 }
276#endif
277}
278
279void MainFrame::resizeEvent(QResizeEvent *event)
280{

Callers

nothing calls this directly

Calls 4

GetPointScreenMethod · 0.80
UpdateChildDpiMethod · 0.80
ResizeChildMethod · 0.80
ReShowWindowMethod · 0.80

Tested by

no test coverage detected