[SailfishDevel] Bug: Slider's initial value is ignored if it is over 1

Artem Marchenko artem.marchenko at gmail.com
Wed Nov 13 23:45:32 UTC 2013


Hi all

Current SailfishOS web site tells to use mailing list as a bug tracker, so
let's try :)

Silica Slider ignores initial value property if it's over one even if
minimalValue/maximalValue should allow it. Setting value later works just
fine. I guess during initialization Slider checks value validity before
minimal/maximalValue are taken into account so default limits of 0..1 are
applied.

Here's code for a page for reproducing:

======


import QtQuick 2.0

import Sailfish.Silica 1.0



Page {

    id: page


    // To enable PullDownMenu, place our content in a SilicaFlickable

    SilicaFlickable {

        anchors.fill: parent



        Slider {

            id: slider

            anchors.top: parent.top

            anchors.topMargin: 50

            width: parent.width

            height: 200

            minimumValue: 0

            maximumValue: 100

            value: 50

            valueText: value


            onValueChanged: {

                console.log("value changed to " + value)

            }


            Label {

                id: commentLabel

                anchors.top: slider.bottom

                anchors.left: parent.left

                anchors.right: parent.right

                text: "value should be 50 from beginning"

                wrapMode: Text.WrapAtWordBoundaryOrAnywhere

            }

            Button {

                anchors.top: commentLabel.bottom

                anchors.left: parent.left

                anchors.right: parent.right

                text: "Set value to 50 now!"

                onClicked: {

                    slider.value = 50

                }


            }


        }

    }

}




======

Best regards,
Artem.

-- 
Artem Marchenko
http://agilesoftwaredevelopment.com
http://twitter.com/AgileArtem
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20131114/0cf04fec/attachment.html>


More information about the Devel mailing list