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. With Respect To ScrollBar To Rectangle
Forum Updated to NodeBB v4.3 + New Features

With Respect To ScrollBar To Rectangle

Scheduled Pinned Locked Moved QML and Qt Quick
27 Posts 2 Posters 9.5k 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.
  • Pradeep KumarP Pradeep Kumar

    @p3c0

    code is working fine, but the thing is scrollbar has to move w.r.t to mouse, when i want to scroll, for example in this forum if u want to scroll up, u will move your mouse up, w.r.t to scrollbar, but in the example case moving mouse upwards, scrolling takes place downwards, i mean to say opposite direction.

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

    @Pradeep-Kumar.M Nope. If you scroll down the scrollbar moves down and ofcourse the image will go up and v.v. That's the intended behaviour.

    157

    Pradeep KumarP 2 Replies Last reply
    0
    • p3c0P p3c0

      @Pradeep-Kumar.M Nope. If you scroll down the scrollbar moves down and ofcourse the image will go up and v.v. That's the intended behaviour.

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

      @p3c0

      hm k kk

      Pradeep Kumar
      Qt,QML Developer

      1 Reply Last reply
      0
      • p3c0P p3c0

        @Pradeep-Kumar.M Nope. If you scroll down the scrollbar moves down and ofcourse the image will go up and v.v. That's the intended behaviour.

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

        @p3c0

        and one more if we have implementation that works with keys press,
        will it work for mouse area on clicked?.

        Pradeep Kumar
        Qt,QML Developer

        p3c0P 1 Reply Last reply
        0
        • Pradeep KumarP Pradeep Kumar

          @p3c0

          and one more if we have implementation that works with keys press,
          will it work for mouse area on clicked?.

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

          @Pradeep-Kumar.M Yes should work. Create a function and call that function when required.

          157

          Pradeep KumarP 1 Reply Last reply
          0
          • p3c0P p3c0

            @Pradeep-Kumar.M Yes should work. Create a function and call that function when required.

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

            @p3c0

            you mean to say create function form ex: function sample()
            {
            // implementation
            }

            mouse area{
            anchors.fill: id
            onclicked
            {
            sample()
            }
            }

            Pradeep Kumar
            Qt,QML Developer

            p3c0P 1 Reply Last reply
            0
            • Pradeep KumarP Pradeep Kumar

              @p3c0

              you mean to say create function form ex: function sample()
              {
              // implementation
              }

              mouse area{
              anchors.fill: id
              onclicked
              {
              sample()
              }
              }

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

              @Pradeep-Kumar.M Yes, so that same function can be called from Keys and MouseArea. No need to duplicate the code.

              157

              Pradeep KumarP 1 Reply Last reply
              0
              • p3c0P p3c0

                @Pradeep-Kumar.M Yes, so that same function can be called from Keys and MouseArea. No need to duplicate the code.

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

                @p3c0

                what i taught was if there is implementation for keys event
                , their will be different implementation for mousearea alse

                Pradeep Kumar
                Qt,QML Developer

                p3c0P 1 Reply Last reply
                0
                • Pradeep KumarP Pradeep Kumar

                  @p3c0

                  what i taught was if there is implementation for keys event
                  , their will be different implementation for mousearea alse

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

                  @Pradeep-Kumar.M Ofcourse you will need to define a MouseArea as well as Keys.onUpPressed. But if the code that moves the scrollbar is similar then no need to duplicate it. Just put it in the function and call that function.

                  157

                  Pradeep KumarP 1 Reply Last reply
                  0
                  • p3c0P p3c0

                    @Pradeep-Kumar.M Ofcourse you will need to define a MouseArea as well as Keys.onUpPressed. But if the code that moves the scrollbar is similar then no need to duplicate it. Just put it in the function and call that function.

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

                    @p3c0

                    ya got it,
                    keys.onuppressed,keys.ondownpressed, coming from .js file, will the same logic work for mousearea
                    {
                    } also .

                    Pradeep Kumar
                    Qt,QML Developer

                    p3c0P 1 Reply Last reply
                    0
                    • Pradeep KumarP Pradeep Kumar

                      @p3c0

                      ya got it,
                      keys.onuppressed,keys.ondownpressed, coming from .js file, will the same logic work for mousearea
                      {
                      } also .

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

                      @Pradeep-Kumar.M

                      will the same logic work for mousearea

                      Depends upon the logic :)

                      157

                      Pradeep KumarP 1 Reply Last reply
                      0
                      • p3c0P p3c0

                        @Pradeep-Kumar.M

                        will the same logic work for mousearea

                        Depends upon the logic :)

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

                        @p3c0
                        k k i''l try.

                        Pradeep Kumar
                        Qt,QML Developer

                        1 Reply Last reply
                        0

                        • Login

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