Simple QML slider app

  • Hi All,

    I am totally new in Qt development. Even not enough familiar with c++ language too :(

    I am trying to develop an Qt GUI Application which have two images ("Im1" & "Im2"). The main purpose of this application is to slide Im1 on Im2 based of different values of a variable (Lets say, name of variable is "Vl")

    0========================================== position at Vl=0;

    =============0================================= position at Vl=2;

    =======================0======================= position at Vl=3;

    ========================================0====== position at Vl=9;

    So basically Im1(0) has to be move on Im2(========) depending upon different values of 'Vl'. Its also like a loading bar.

    I went through some QML element such as Transition, translate etc but do not have enough knowledge to use the. Could annyone please help me out. Thanks in advance.

  • any update?

  • Wrong subforum. Ask a moderator to move your thread to the QtQuick forum.

    The short answer to your question is: positioning.
    Image {
    id: sliderImage
    // position, relative to parent item:
    x: 0
    y: 0
    // geometry, example only
    width: 400
    height: 50

    Image {
    id: sliderKnob
    // position, relative to parent...
    y: 0
    x: someVariable * 36 // if someVariable ranges in value from 0 through to 10.
    width: 40
    height: 40


  • Thanks Chris, Appreciated your help..

    Actually i have to deploy this application on an embedded board by cross compling it (Will use qmake of corresponding toolchain).

    Could you please explain how can I combine "Vl" and Im1(0)..? Meaning i have some changing values (ranging from 0 to 10) which i am reading from a file and i want to assign these value "Vl" variable. Based on that the Im1 will slide as illustrated in previous post... Also the program has to be run for infinte time (Continuously reading values from a file -- > reads one value at a time ---> assigning same to Vl --> moving Im1 based on current Vl value..... All these operations should be in sync)..

    Please help ... Thanks

  • Anyone can further provide update on this ?

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.