Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Scrollbar alignment for QTableView
Forum Updated to NodeBB v4.3 + New Features

Scrollbar alignment for QTableView

Scheduled Pinned Locked Moved General and Desktop
9 Posts 4 Posters 5.6k 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.
  • T Offline
    T Offline
    TonyR
    wrote on last edited by
    #1

    How I can put vertical scrollbar on left side of QTableView

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      To my knowledge, there are not built-in means for this.

      Usually it's not a good idea to change the behavior of UI components that the user is used to, unless you have very, very good reasons to do so.

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • T Offline
        T Offline
        t3chNo
        wrote on last edited by
        #3

        Take a look at QItemDelegate.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          [quote author="t3chNo" date="1326289687"]Take a look at QItemDelegate.[/quote]

          Sorry, but this is complete nonsense. The item delegate class deal with single items, but not with the view as a whole.

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • T Offline
            T Offline
            t3chNo
            wrote on last edited by
            #5

            [quote author="Volker" date="1326290126"]
            [quote author="t3chNo" date="1326289687"]Take a look at QItemDelegate.[/quote]

            Sorry, but this is complete nonsense. The item delegate class deal with single items, but not with the view as a whole.[/quote]

            Sorry, my bad. I misunderstand the question.
            [quote author="TonyR" date="1326284470"]How I can put vertical scrollbar on left side of QTableView[/quote]

            Maybe putting QTableView in a QScrollArea solves your problem.

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on last edited by
              #6

              [quote author="t3chNo" date="1326290419"]
              Maybe putting QTableView in a QScrollArea solves your problem.[/quote]

              All item view classes are subclasses of QAbstractScrollArea. Putting a scroll area into a scroll area doesn't look like a decent solution for me.

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0
              • T Offline
                T Offline
                t3chNo
                wrote on last edited by
                #7

                [quote author="Volker" date="1326290594"]
                [quote author="t3chNo" date="1326290419"]
                Maybe putting QTableView in a QScrollArea solves your problem.[/quote]

                All item view classes are subclasses of QAbstractScrollArea. Putting a scroll area into a scroll area doesn't look like a decent solution for me.[/quote]

                You can change QScrollArea's layout direction to RightToLeft. This way, scroll bar is shown on left side of the widget. Then put QTableView in QScrollArea and change the QTableView's layout direction to LeftToRight.

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  goetz
                  wrote on last edited by
                  #8

                  This is not the same as having the scrollbar directly to the left: If you scroll the outer scroll area, you move the complete view thus moving the view's headers out of the viewport.

                  http://www.catb.org/~esr/faqs/smart-questions.html

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    KasNel
                    wrote on last edited by
                    #9

                    I think addScrollBarWidget(QWidget *, Qt::Alignment) should work for this requirement.

                    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