Open child window on same screen as parent
-
How do I center a child window on the same screen as the parent window? I've looked at the
Screen
object, but that doesn't seem to be a good idea.Edit: I originally had posted "How do I open a child window...", but realized that it should be changed to "center". Unfortunately, this forum doesn't allow me to edit the thread title. :(
-
Update: I've done some work and gotten a setup where my QML window is given access to an object from C++ which is the current QScreen. This allows me to set
screen:
to the same screen as the main window (which is, I should mention, a Qt Widgets-derived window containing a QQuickWidget view), but does not meet my main goal of centering the QML window on the screen. -
In QML I use this method
onClicked:{ var component = Qt.createComponent("DataPathForm.qml") var window = component.createObject() window.show() }
:-)
@sluci That's not actually trying to center the window on a parent window. I need to figure out how to center a child window on a parent window. The child window is QML and the parent window is in C++ with a QQuickWidget containing a lot of QML. I'd like this solution to work on multiple monitors.