The problem is as follows. Here is the code:

//Page1.qml import QtQuick 2.4 import QtQuick.Controls 2.3 Page { id: page width: 400 height: 400 title: qsTr("Firs page") Button { id: button2 y: 167 text: qsTr("Button") anchors.right: parent.right anchors.rightMargin: 15 anchors.left: parent.left anchors.leftMargin: 15 } } 

It is necessary that this window is 400 to 400, while decreasing or increasing the size, resizes the button. Added line (anchors.fill: parent):

 //Page1.qml import QtQuick 2.4 import QtQuick.Controls 2.3 Page { id: page anchors.fill: parent width: 400 height: 400 title: qsTr("Firs page") Button { id: button2 y: 167 text: qsTr("Button") anchors.right: parent.right anchors.rightMargin: 15 anchors.left: parent.left anchors.leftMargin: 15 } } 

Earned, but gives the error `` StackView has detected conflicting anchors. Transitions may not execute properly. ". Anchor tries to take points from QQuickstackview. How to solve a problem?

    1 answer 1

    Right or not, but took

     height: stackView.height width: stackView.width 

    It seems to be working fine.