Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

how to place the window ?



  • Hi,

    After this basic code to create a window:

    import QtQuick 2.9
    import QtQuick.Window 2.2
    import QtQuick.VirtualKeyboard 2.2

    Window {
    id: window
    visible: true
    width: 100
    height: 100
    title: qsTr("World Tekken")
    color: "blue"
    }

    what is the function or code to insert in addition to place it according to the coordinates (x, y) when the program above is compiled and executed?

    thanks


  • Qt Champions 2017

    What do you want place ? what do u want to insert ? where do you want to place ? Some clarity will help.



  • i want to place in the screen of pc the blue window !
    It's clear !


  • Moderators

    @signalK

    you place the window by manipulating x and y of your window

    to place it in the center of a single moitor setup:

    Window {
       id: window
       visible: true
       x: (Screen.desktopAvailableWidth - width)/2
       y: (Screen.desktopAvailableHeight - height)/2
       width: 100
       height: 100
       title: qsTr("World Tekken")
       color: "blue"
    }
    

Log in to reply