私は単純なRowLayout
の長方形を試しています。 (以下のコードを参照してください。)私はQtの創造主でこれを実行/コンパイルしようとすると、私が手に:私が使用しようとするのいずれかLayout.minimumWidth:200
またはLayout { minimumWidth:200 }
QML RowLayoutの添付プロパティを調整する
とき
qrc:/main.qml:31 Do not create objects of type Layout
Qtのdocumentation for RowLayout
は、最初の形式を示していワーキング。私は何が欠けていますか?
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
ApplicationWindow {
id: window
title: "RB3Jay"
width:1280; height:960
minimumWidth:600; minimumHeight:300
visible: true
Rectangle {
id: pseudocontent
height: parent.height - (header.height + footer.height)
color:'orange'
anchors {
top:header.bottom
bottom:footer.top
left:parent.left
right:parent.right
}
}
header: RowLayout {
id: header
spacing: 0
height: 100
width: parent.width
Rectangle {
color:'red'
Layout {
minimumWidth:200; maximumWidth:200; preferredWidth:200
fillHeight:true
}
}
Rectangle {
color:'green'
Layout {
minimumWidth: 200
preferredWidth: parent.width*0.7
fillWidth:true; fillHeight:true
}
}
Rectangle {
color:'blue'
Layout {
minimumWidth: 200
preferredWidth: parent.width*0.3
fillWidth:true; fillHeight:true
}
}
}
footer: Inspector {
id: footer
height:100
}
}
ワウ。私は 'Layout.minimumWidth'が同じエラーを投げていることを確信していましたが、私は間違っていたはずです。私の質問は無効です。ご協力ありがとうございました。 – Phrogz