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]Scroll issue in Qlistview
Forum Updated to NodeBB v4.3 + New Features

[SOLVED]Scroll issue in Qlistview

Scheduled Pinned Locked Moved QML and Qt Quick
13 Posts 2 Posters 4.0k Views 1 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #2

    Hi and welcome to devnet,

    You have to explain a little bit more of your problem. You are not stating clearly what you want to achieve (for example your title mentions QListView and your text only talks about QLabel and QTextEdit)

    Also this the wrong subforum. You seem to have a widget problem not a Qt Quick problem

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    1 Reply Last reply
    0
    • M Offline
      M Offline
      maxy
      wrote on last edited by
      #3

      Thanks ..

      My question is i have QtextEdit control and Qlabel.in Qlabel i added one image by using setPixmap function. when i scroll the mouse in Qlabel i want to scroll in Qtextedit control also.

      Thanks

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #4

        Then what do you mean by scroll on the QLabel ? Moving the mouse ? Moving the wheel ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • M Offline
          M Offline
          maxy
          wrote on last edited by
          #5

          Moving the wheel

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #6

            Then you'll have to:

            • subclass QLabel
            • add a signal to "propagate" the scrolling value
            • reimplement wheelEvent and emit the signal from there

            Then it's either:
            1.

            • subclass QTextEdit
            • add a slot to receive the scrolling value and update
            • have a slot in the "main" widget containing your QLabel and QTextEdit and update the QTextEdit scroll bar from there.

            May I know why you want to do it that way ? QTextEdit should already support wheel events

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • M Offline
              M Offline
              maxy
              wrote on last edited by
              #7

              Thanks for your information...

              Actually i had an transparent image under that i had text browser .i made all the alignments such that it fits on the transparent area.the text is long than the transparent area ,it is not scrolling to see the rest of the textbrowser,.This is what actual problem

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #8

                In that case, have a look at the doc for Qt::WA_TransparentForMouseEvents

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  maxy
                  wrote on last edited by
                  #9

                  Thanks,
                  I already tried this kind of solution but the textbrowser shape is like as rectangle but the image transparent area is like as curve.

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #10

                    Then make the QTextEdit a "filter":http://qt-project.org/doc/qt-4.8/qobject.html#installEventFilter for the QLabel event

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      maxy
                      wrote on last edited by
                      #11

                      Thanks for your information.

                      I fixed the issue!!!!!!!!!!! .

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #12

                        You're welcome,

                        Don't forget to update the thread's title to solved (also change the subject since it has nothing to do with QListView) so other forum user may know a solution has been found.

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0
                        • M Offline
                          M Offline
                          maxy
                          wrote on last edited by
                          #13

                          Yes..Sure.Thanks a lot

                          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