QML ProgressBar的垂直方向未达到顶部100%

时间:2016-02-10 13:02:57

标签: qml

在QML内MainWindow,我有SliderProgressBar

import QtQuick 2.5
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.1
import QtQuick.Window 2.2

ApplicationWindow
{
    visible: true

    width: Screen.width/2
    height: Screen.height/2

    opacity: 1.00

    color: "black"

    RowLayout
    {
        anchors.fill: parent

        Slider
        {
            id: ueSlider

            Layout.fillWidth: true
            Layout.fillHeight: true
            Layout.margins: 8
            Layout.alignment: Qt.AlignLeft|Qt.AlignVCenter

            activeFocusOnPress: false
            tickmarksEnabled: false

            minimumValue: 0
            maximumValue: 100
            stepSize: 1

            orientation: Qt.Vertical

            onValueChanged:
            {
                ueProgressBar.value=value;
            }   // onValueChanged
        }   // Slider

        ProgressBar
        {
            id: ueProgressBar

            Layout.fillWidth: true
            Layout.fillHeight: true
            Layout.margins: 8
            Layout.alignment: Qt.AlignRight|Qt.AlignVCenter

            orientation: Qt.Vertical

            indeterminate: false

            onValueChanged:
            {
                print("ProgressBar value: "+value);
            }   // onValueChanged

            Component.onCompleted:
            {
                minimumValue=ueSlider.minimumValue;
                maximumValue=ueSlider.maximumValue;
                value=ueSlider.value;
            }   // Component.onCompleted
        }   // ProgressBar
    }   // RowLayout
}   // ApplicationWindow

现在,ProgressBar是"已连接"到Slider - 当我更改Slider的值时,ProgressBar' value更改。如果我将ProgressBar orientation更改为Qt.Horizontal,一切正常,但如果我将其orienation更改为Qt.Vertical,请运行示例并推送Slider顶部(maximumValue),ProgressBar未转到100%ProgressBar problem 为什么地狱?!

0 个答案:

没有答案