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. Draw separator between overlapping QTableviews

Draw separator between overlapping QTableviews

Scheduled Pinned Locked Moved Solved General and Desktop
qtableview
12 Posts 3 Posters 2.2k 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.
  • JoeCFDJ JoeCFD

    a lazy way would be to make a overlay qframe line with 5 pixel thickness on top of tableview in void showEvent(QShowEvent *);
    Its location can be found easily.
    A better way would be to draw bottom or top border lines of all items in that row by overriding the paint event.

    F Offline
    F Offline
    firen
    wrote on last edited by
    #3

    @JoeCFD I tried already your second suggestion.

    My problem, was that I am not able to paint on the middle of the grid, because the frozen view lays on top of the "normal" view and if I repaint the normal view border, one half of the border is hidden by the frozen view. and if i try that with the frozen view I can only paint one half of the Line because i cant paint over the borders of the Widget.

    JoeCFDJ 1 Reply Last reply
    0
    • F firen

      @JoeCFD I tried already your second suggestion.

      My problem, was that I am not able to paint on the middle of the grid, because the frozen view lays on top of the "normal" view and if I repaint the normal view border, one half of the border is hidden by the frozen view. and if i try that with the frozen view I can only paint one half of the Line because i cant paint over the borders of the Widget.

      JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by
      #4

      @firen can you paint both of them at the same time?

      1 Reply Last reply
      0
      • JoeCFDJ JoeCFD

        a lazy way would be to make a overlay qframe line with 5 pixel thickness on top of tableview in void showEvent(QShowEvent *);
        Its location can be found easily.
        A better way would be to draw bottom or top border lines of all items in that row by overriding the paint event.

        F Offline
        F Offline
        firen
        wrote on last edited by
        #5

        @JoeCFD I like the idea with the QFrame but I am not realy sure how to do that..

        https://doc.qt.io/qt-5/qframe.html I guess I would need the VLine version right? because I only need the separator on one side. But how would I determine which side?

        JoeCFDJ 1 Reply Last reply
        0
        • F firen

          @JoeCFD I like the idea with the QFrame but I am not realy sure how to do that..

          https://doc.qt.io/qt-5/qframe.html I guess I would need the VLine version right? because I only need the separator on one side. But how would I determine which side?

          JoeCFDJ Offline
          JoeCFDJ Offline
          JoeCFD
          wrote on last edited by JoeCFD
          #6

          @firen it will be on the top of qtreeview and is in the middle. Google about how to make an overlay widget.

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

            Hi,

            Just a wild guess but what about keeping the border in the stylesheet but fix them all to 0 except the one you want with 5px ?

            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
            • F Offline
              F Offline
              firen
              wrote on last edited by
              #8
              This post is deleted!
              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #9

                What result did you get from my suggestion ?

                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
                1
                • F Offline
                  F Offline
                  firen
                  wrote on last edited by
                  #10

                  Once again rescued by @SGaist :-)

                  1 Reply Last reply
                  0
                  • F Offline
                    F Offline
                    firen
                    wrote on last edited by
                    #11

                    The documentation about stylesheets is for me not the best one from qt .. nevermind

                    1 Reply Last reply
                    0
                    • F Offline
                      F Offline
                      firen
                      wrote on last edited by
                      #12
                      This post is deleted!
                      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