Blank window using two screens
Solved
General and Desktop
-
Hello!!
This is a little strange issue. I am using two screens, and I have an application that opens different windows.
One of these windows, has a little problem. These are the steps for reproduce the issue:
- Open the window.
- Move the window to the second screen.
- Close the window.
- Open the window again. The window appears blank and when I click the area in which there is a widget, the window shows normal again.
Could you help me with this??
Thank you very much!
-
Which Qt version do you use? Can you please provide a minimal, compilable example to reproduce the problem / we can see what you're actually doing?
-
I found a solution:
Use this code in the part where you want to show the window:
if (QApplication::desktop()->screenCount() > 1) { myWindow->setGeometry( QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, myWindow->size(), QApplication::desktop()->availableGeometry(0))); } myWindow->show();
This solves my problem