Hi,

I have a Qt/QML application and I have a problem when setting the main window to Full Screen.

It goes Full Screen, but first it seems to be moved to the top-left corner of my screen. Then it changes to Full Screen, BUT this top-left window is there until I repaint my application. For instance, moving it to background and to foreground again.

I hope I am explaining properly...

In my code, I have a QWidget class where I create a QQmlApplicationEngine:

.h file:
Qt Code:
  1. QQmlApplicationEngine* m_pAppMainWindow;
  2. QQuickWindow* m_pQuickWindow;
To copy to clipboard, switch view to plain text mode 

.cpp file:

Qt Code:
  1. m_pAppMainWindow = new QQmlApplicationEngine();
To copy to clipboard, switch view to plain text mode 

I use it to get app qml context
Qt Code:
  1. QQmlContext* pQmlContext = m_pAppMainWindow->rootContext();
To copy to clipboard, switch view to plain text mode 
to load the main QML file from resources:
Qt Code:
  1. m_pAppMainWindow->load(QUrl("qrc:/qml/ViewMain.qml"));
To copy to clipboard, switch view to plain text mode 
to set Image providers:
Qt Code:
  1. m_pAppMainWindow->addImageProvider(...);
To copy to clipboard, switch view to plain text mode 
and to get QQuickWindow object:
Qt Code:
  1. m_pQuickWindow = m_pQuickWindow = qobject_cast<QQuickWindow *>(m_pAppMainWindow->rootObjects()[0]);
To copy to clipboard, switch view to plain text mode 

I use the QQuickWindow object to set app window minimum size:
Qt Code:
  1. m_pQuickWindow->setMinimumWidth(...)
To copy to clipboard, switch view to plain text mode 
to get the QML objects to work with:
Qt Code:
  1. QObject* pObjViewMain = m_pQuickWindow->findChild<QObject*>("viewMain");
To copy to clipboard, switch view to plain text mode 
and to set app in full screen mode (on/off):
Qt Code:
  1. m_pQuickWindow->showFullScreen();
  2. or
  3. m_pQuickWindow->showNormal();
To copy to clipboard, switch view to plain text mode 

My problem is with this last point, when I enter Full Screen...

Hope anyone can help me

Thanks