Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [SOLVED] Regarding Slider and Canvas
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Regarding Slider and Canvas

Scheduled Pinned Locked Moved Solved QML and Qt Quick
17 Posts 2 Posters 4.3k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • p3c0P p3c0

    @Pradeep-Kumar.M

    onValueChanged:
    {
        progress.value = value;
        canvas.y--
    }
    

    You are always reducing the y value regardless of Slider's value. So it will always move in one direction i.e upwards.

    Pradeep KumarP Offline
    Pradeep KumarP Offline
    Pradeep Kumar
    wrote on last edited by
    #8

    @p3c0

    what do i do if i want to move upwards as well as downwards,
    with respect to slider value

    Pradeep Kumar
    Qt,QML Developer

    p3c0P 1 Reply Last reply
    0
    • Pradeep KumarP Pradeep Kumar

      @p3c0

      what do i do if i want to move upwards as well as downwards,
      with respect to slider value

      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #9

      @Pradeep-Kumar.M
      Same as how you update the progress bar. Bind the value. But you will need to deduce a formula which will move it precisely. For eg:

      onValueChanged:
      {
          progress.value = value;
          canvas.y = -value*160 //replace with your own formula
      }
      

      just to demonstrate how it works.

      157

      1 Reply Last reply
      1
      • Pradeep KumarP Pradeep Kumar

        @p3c0
        hello.
        inside onpaint, i made use of it {onpaint}.

        Pradeep KumarP Offline
        Pradeep KumarP Offline
        Pradeep Kumar
        wrote on last edited by
        #10

        @pc30
        hello one more question
        can we add our own user defined attached properties to the existing QML Items.

        Pradeep Kumar
        Qt,QML Developer

        1 Reply Last reply
        0
        • Pradeep KumarP Offline
          Pradeep KumarP Offline
          Pradeep Kumar
          wrote on last edited by
          #11

          @pc30

          thank you so much, its working fine,
          and by the way your good name please,
          and i hope i'l practise much more interesting stuff,
          problem is solved.

          will you answer my second question please which i have posted.

          Pradeep Kumar
          Qt,QML Developer

          p3c0P 1 Reply Last reply
          0
          • Pradeep KumarP Pradeep Kumar

            @pc30

            thank you so much, its working fine,
            and by the way your good name please,
            and i hope i'l practise much more interesting stuff,
            problem is solved.

            will you answer my second question please which i have posted.

            p3c0P Offline
            p3c0P Offline
            p3c0
            Moderators
            wrote on last edited by
            #12

            @Pradeep-Kumar.M By "existing QML Items" you mean the inbuilt QML items or your own custom defined items ?

            157

            Pradeep KumarP 1 Reply Last reply
            1
            • p3c0P p3c0

              @Pradeep-Kumar.M By "existing QML Items" you mean the inbuilt QML items or your own custom defined items ?

              Pradeep KumarP Offline
              Pradeep KumarP Offline
              Pradeep Kumar
              wrote on last edited by
              #13

              @p3c0
              our own user defined items.

              Pradeep Kumar
              Qt,QML Developer

              p3c0P 1 Reply Last reply
              0
              • Pradeep KumarP Pradeep Kumar

                @p3c0
                our own user defined items.

                p3c0P Offline
                p3c0P Offline
                p3c0
                Moderators
                wrote on last edited by p3c0
                #14

                @Pradeep-Kumar.M I think yes. But I haven't used as such. Check out the following attached-properties for some information regarding it. Example here.

                157

                Pradeep KumarP 2 Replies Last reply
                1
                • p3c0P p3c0

                  @Pradeep-Kumar.M I think yes. But I haven't used as such. Check out the following attached-properties for some information regarding it. Example here.

                  Pradeep KumarP Offline
                  Pradeep KumarP Offline
                  Pradeep Kumar
                  wrote on last edited by
                  #15

                  @p3c0
                  thank you

                  Pradeep Kumar
                  Qt,QML Developer

                  1 Reply Last reply
                  0
                  • p3c0P p3c0

                    @Pradeep-Kumar.M I think yes. But I haven't used as such. Check out the following attached-properties for some information regarding it. Example here.

                    Pradeep KumarP Offline
                    Pradeep KumarP Offline
                    Pradeep Kumar
                    wrote on last edited by
                    #16

                    @p3c0

                    hello.
                    i got with respect to mouse implementaion,
                    can i have implementation of canvas with slider value with key up pressed, and key down pressed?. can you suggest.

                    Pradeep Kumar
                    Qt,QML Developer

                    p3c0P 1 Reply Last reply
                    0
                    • Pradeep KumarP Pradeep Kumar

                      @p3c0

                      hello.
                      i got with respect to mouse implementaion,
                      can i have implementation of canvas with slider value with key up pressed, and key down pressed?. can you suggest.

                      p3c0P Offline
                      p3c0P Offline
                      p3c0
                      Moderators
                      wrote on last edited by
                      #17

                      @Pradeep-Kumar.M As it doesn't return anything, you will need to keep a counting variable which will be increased and decreased on key up and down pressed (you will need to decide how much to increase or decrease at a time). Then assign this count (with some multiplier) value to y in similar way we did with slider.

                      157

                      1 Reply Last reply
                      1

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved