I have a "subclassed" Gauge:
import QtQuick 2.3
import QtAudioEngine 1.0
import QtQuick.Window 2.2
import QtQuick.XmlListModel 2.0
import QtDataVisualization 1.2
import QtSensors 5.4
import QtQuick.Layouts 1.0
import QtWebKit 3.0
import QtQuick.LocalStorage 2.0
import QtQuick.Controls 1.2
import QtPositioning 5.4
import QtTest 1.1
import QtQuick.Enterprise.Controls 1.3
import QtCharts 2.0
Item
{
id: fsaGauge
property color fsaBackgroundColor
property int fsaLegendAlignment
property int fsaWidth
property int fsaHeight
width: fsaWidth
height: fsaHeight
Column
{
id: fsaColumnGauge
spacing: 16
Gauge
{
id: fsaGaugeWaterLevel
minimumValue: 0
maximumValue: 100
value: 37
tickmarkStepSize: 1
tickmarkAlignment: fsaLegendAlignment
antialiasing: true
}
}
}
import QtQuick 2.3
import QtAudioEngine 1.0
import QtQuick.Window 2.2
import QtQuick.XmlListModel 2.0
import QtDataVisualization 1.2
import QtSensors 5.4
import QtQuick.Layouts 1.0
import QtWebKit 3.0
import QtQuick.LocalStorage 2.0
import QtQuick.Controls 1.2
import QtPositioning 5.4
import QtTest 1.1
import QtQuick.Enterprise.Controls 1.3
import QtCharts 2.0
Item
{
id: fsaGauge
property color fsaBackgroundColor
property int fsaLegendAlignment
property int fsaWidth
property int fsaHeight
width: fsaWidth
height: fsaHeight
Column
{
id: fsaColumnGauge
spacing: 16
Gauge
{
id: fsaGaugeWaterLevel
minimumValue: 0
maximumValue: 100
value: 37
tickmarkStepSize: 1
tickmarkAlignment: fsaLegendAlignment
antialiasing: true
}
}
}
To copy to clipboard, switch view to plain text mode
that is used as:
import QtQuick 2.3
import QtAudioEngine 1.0
import QtQuick.Window 2.2
import QtQuick.XmlListModel 2.0
import QtDataVisualization 1.2
import QtSensors 5.4
import QtQuick.Layouts 1.0
import QtWebKit 3.0
import QtQuick.LocalStorage 2.0
import QtQuick.Controls 1.2
import QtPositioning 5.4
import QtTest 1.1
import QtQuick.Enterprise.Controls 1.3
import QtCharts 2.0
Rectangle
{
id: fsaRoot
width: 800
height: 600
color: "black"
Row
{
id: fsaRowMain
anchors.fill: parent
FsaGauge
{
id: emeWaterTankLevelIndicatorLeft
y: 0
width: parent.width/4
height: parent.height
clip: false
antialiasing: true
fsaBackgroundColor: "black"
fsaLegendAlignment: Qt.AlignLeft
}
}
}
import QtQuick 2.3
import QtAudioEngine 1.0
import QtQuick.Window 2.2
import QtQuick.XmlListModel 2.0
import QtDataVisualization 1.2
import QtSensors 5.4
import QtQuick.Layouts 1.0
import QtWebKit 3.0
import QtQuick.LocalStorage 2.0
import QtQuick.Controls 1.2
import QtPositioning 5.4
import QtTest 1.1
import QtQuick.Enterprise.Controls 1.3
import QtCharts 2.0
Rectangle
{
id: fsaRoot
width: 800
height: 600
color: "black"
Row
{
id: fsaRowMain
anchors.fill: parent
FsaGauge
{
id: emeWaterTankLevelIndicatorLeft
y: 0
width: parent.width/4
height: parent.height
clip: false
antialiasing: true
fsaBackgroundColor: "black"
fsaLegendAlignment: Qt.AlignLeft
}
}
}
To copy to clipboard, switch view to plain text mode
Why does gauge does not "inherit" parent's window height?gaugeWrongSize.jpg
Bookmarks