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. Fusion style QTableView leaving shadow highlight only on single cell

Fusion style QTableView leaving shadow highlight only on single cell

Scheduled Pinned Locked Moved Solved General and Desktop
14 Posts 3 Posters 1.1k 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.
  • C Offline
    C Offline
    cancech
    wrote on last edited by
    #5

    Ultimate the same thing can be seen with the windowsvista style, just not as pronounced. With the windowsvista the cell retains a dashed line.

    1846109f-96b4-4bcd-9b49-4420684af02e-image.png

    With the windowsvista style I feel that it's more clearly noted that this is "where you last clicked" whereas the fusion style makes it seem like it's actually highlighted.

    Is this behavior something that can be turned off?

    Christian EhrlicherC 1 Reply Last reply
    0
    • C cancech

      Ultimate the same thing can be seen with the windowsvista style, just not as pronounced. With the windowsvista the cell retains a dashed line.

      1846109f-96b4-4bcd-9b49-4420684af02e-image.png

      With the windowsvista style I feel that it's more clearly noted that this is "where you last clicked" whereas the fusion style makes it seem like it's actually highlighted.

      Is this behavior something that can be turned off?

      Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #6

      @cancech Please simplify your example - no need for a model or extra mainwindow. The less classes the less to debug here.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      C 1 Reply Last reply
      0
      • Christian EhrlicherC Christian Ehrlicher

        @cancech Please simplify your example - no need for a model or extra mainwindow. The less classes the less to debug here.

        C Offline
        C Offline
        cancech
        wrote on last edited by
        #7

        @Christian-Ehrlicher I'm not sure how to simplify my example. I don't see how to add data to the QTableView without creating my own model and I believe that mainwindow.h, mainwindow.cpp, and mainwindow.ui are all three needed. Short or removing the mainwindow.ui and reproducing the layout in code that is.

        Christian EhrlicherC 1 Reply Last reply
        0
        • C cancech

          @Christian-Ehrlicher I'm not sure how to simplify my example. I don't see how to add data to the QTableView without creating my own model and I believe that mainwindow.h, mainwindow.cpp, and mainwindow.ui are all three needed. Short or removing the mainwindow.ui and reproducing the layout in code that is.

          Christian EhrlicherC Online
          Christian EhrlicherC Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #8

          @cancech simply create a tableview, add a stringlist model and show it. No mainwindow or other stuff needed.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          C 1 Reply Last reply
          0
          • Christian EhrlicherC Christian Ehrlicher

            @cancech simply create a tableview, add a stringlist model and show it. No mainwindow or other stuff needed.

            C Offline
            C Offline
            cancech
            wrote on last edited by
            #9

            @Christian-Ehrlicher Got it! I've updated the example to remove the unnecessary pieces.

            Christian EhrlicherC 1 Reply Last reply
            0
            • C cancech

              @Christian-Ehrlicher Got it! I've updated the example to remove the unnecessary pieces.

              Christian EhrlicherC Online
              Christian EhrlicherC Online
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #10

              Ok, now I know what you mean. This is the marking for the currently index. There is a difference between selected indexes and current index. That's the same as when you select a file in windows explorer and then click on a blank area - the previously selected row is still painted somewhat different.

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              C 1 Reply Last reply
              1
              • Christian EhrlicherC Christian Ehrlicher

                Ok, now I know what you mean. This is the marking for the currently index. There is a difference between selected indexes and current index. That's the same as when you select a file in windows explorer and then click on a blank area - the previously selected row is still painted somewhat different.

                C Offline
                C Offline
                cancech
                wrote on last edited by
                #11

                @Christian-Ehrlicher Ahh, I see. So it's there to indicate "if you press the arrow keys, there is where you'll be starting from". Considering that I'm using whole row selection, shouldn't the whole row be the index then? I would presume that pressing the left/right arrows wouldn't really do anything

                Christian EhrlicherC 1 Reply Last reply
                0
                • C cancech

                  @Christian-Ehrlicher Ahh, I see. So it's there to indicate "if you press the arrow keys, there is where you'll be starting from". Considering that I'm using whole row selection, shouldn't the whole row be the index then? I would presume that pressing the left/right arrows wouldn't really do anything

                  Christian EhrlicherC Online
                  Christian EhrlicherC Online
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on last edited by
                  #12

                  @cancech In Qt there is only one 'current index' possible. And you can't change this anywhere - you can only change the selection behavior.

                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                  Visit the Qt Academy at https://academy.qt.io/catalog

                  C 1 Reply Last reply
                  0
                  • Christian EhrlicherC Christian Ehrlicher

                    @cancech In Qt there is only one 'current index' possible. And you can't change this anywhere - you can only change the selection behavior.

                    C Offline
                    C Offline
                    cancech
                    wrote on last edited by
                    #13

                    @Christian-Ehrlicher Gotcha, thanks so much for all the help and figuring out what's going on!

                    Christian EhrlicherC 1 Reply Last reply
                    0
                    • C cancech

                      @Christian-Ehrlicher Gotcha, thanks so much for all the help and figuring out what's going on!

                      Christian EhrlicherC Online
                      Christian EhrlicherC Online
                      Christian Ehrlicher
                      Lifetime Qt Champion
                      wrote on last edited by
                      #14

                      @cancech You might reset the current index flag during painting by overriding https://doc.qt.io/qt-6/qabstractitemview.html#initViewItemOption

                      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                      Visit the Qt Academy at https://academy.qt.io/catalog

                      1 Reply Last reply
                      1
                      • C cancech has marked this topic as solved on

                      • Login

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