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. Table Navigation with NoItemFlags
Forum Updated to NodeBB v4.3 + New Features

Table Navigation with NoItemFlags

Scheduled Pinned Locked Moved Solved General and Desktop
21 Posts 4 Posters 3.9k 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.
  • SGaistS SGaist

    Can you provide a minimal compilable example that shows that behaviour ?

    MegamouseM Offline
    MegamouseM Offline
    Megamouse
    wrote on last edited by
    #7

    @SGaist I'll try. but I can't promise anything

    1 Reply Last reply
    0
    • MegamouseM Offline
      MegamouseM Offline
      Megamouse
      wrote on last edited by Megamouse
      #8

      @SGaist if you have the frozencolumn example in Qt Creator you can just add the following to main.cpp in order to make the last item non selectable:

      QStandardItem *newItem = new QStandardItem();
      newItem->setFlags(Qt::NoItemFlags);
      model->setItem(model->rowCount() - 1, model->columnCount() - 1, newItem);
      

      keep in mind that you have to have the item in the view to test this properly (maybe reduce the number of rows and cols to 3)

      mrjjM 1 Reply Last reply
      0
      • MegamouseM Megamouse

        @SGaist if you have the frozencolumn example in Qt Creator you can just add the following to main.cpp in order to make the last item non selectable:

        QStandardItem *newItem = new QStandardItem();
        newItem->setFlags(Qt::NoItemFlags);
        model->setItem(model->rowCount() - 1, model->columnCount() - 1, newItem);
        

        keep in mind that you have to have the item in the view to test this properly (maybe reduce the number of rows and cols to 3)

        mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #9

        @Megamouse
        Hi
        Try with
        newItem->setFlags( Qt::ItemIsSelectable|Qt::ItemIsEnabled );

        MegamouseM 1 Reply Last reply
        0
        • mrjjM mrjj

          @Megamouse
          Hi
          Try with
          newItem->setFlags( Qt::ItemIsSelectable|Qt::ItemIsEnabled );

          MegamouseM Offline
          MegamouseM Offline
          Megamouse
          wrote on last edited by
          #10

          @mrjj said in Table Navigation with NoItemFlags:

          Qt::ItemIsSelectable|Qt::ItemIsEnabled

          The problem here is that I don't want the selection.
          I just want the item to be ignored and the Home/End keys to work in that col/row

          mrjjM 1 Reply Last reply
          0
          • MegamouseM Megamouse

            @mrjj said in Table Navigation with NoItemFlags:

            Qt::ItemIsSelectable|Qt::ItemIsEnabled

            The problem here is that I don't want the selection.
            I just want the item to be ignored and the Home/End keys to work in that col/row

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by mrjj
            #11

            @Megamouse
            Ok. well if last item on row is not at least Enabled it wont jump to last on end key.
            Home still works. ( to go back to first )
            It wont scan to find last that can be End key too, im afraid.
            So unless you can live with a tiny selection, im not sure you can make ignore them.
            alt text

            MegamouseM 1 Reply Last reply
            0
            • mrjjM mrjj

              @Megamouse
              Ok. well if last item on row is not at least Enabled it wont jump to last on end key.
              Home still works. ( to go back to first )
              It wont scan to find last that can be End key too, im afraid.
              So unless you can live with a tiny selection, im not sure you can make ignore them.
              alt text

              MegamouseM Offline
              MegamouseM Offline
              Megamouse
              wrote on last edited by
              #12

              @mrjj hmm that's not really an option. If I was content with that I wouldn't have asked :)
              I guess the complaining users just have to live with it, unless I work around that issue by overriding the whole navigation (which seems overkill for that)

              mrjjM 1 Reply Last reply
              0
              • MegamouseM Megamouse

                @mrjj hmm that's not really an option. If I was content with that I wouldn't have asked :)
                I guess the complaining users just have to live with it, unless I work around that issue by overriding the whole navigation (which seems overkill for that)

                mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by mrjj
                #13

                @Megamouse
                Well the tiny selection rect is far less intrusive than full one. hence i asked.

                You could try to fix the End key issue with scanning for
                a new cell that can have focus. and handle that case your self and
                else just call native keyhandling.

                https://forum.qt.io/topic/97293/qtableview-navigation-with-tab/3

                1 Reply Last reply
                0
                • Christian EhrlicherC Offline
                  Christian EhrlicherC Offline
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on last edited by
                  #14

                  @mrjj said in Table Navigation with NoItemFlags:

                  Home still works. ( to go back to first )

                  From what I can see in the code I would say Home is going to the first enabled + visible row but End or Ctrl+End goes simply to the last visible row / column without checking for enabled. Is this what you see?

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

                  mrjjM 1 Reply Last reply
                  0
                  • Christian EhrlicherC Christian Ehrlicher

                    @mrjj said in Table Navigation with NoItemFlags:

                    Home still works. ( to go back to first )

                    From what I can see in the code I would say Home is going to the first enabled + visible row but End or Ctrl+End goes simply to the last visible row / column without checking for enabled. Is this what you see?

                    mrjjM Offline
                    mrjjM Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on last edited by
                    #15

                    @Christian-Ehrlicher
                    Hi
                    Actually if last cell is not selectable and or enabled, then the end key do nothing.
                    Meaning it wont go to last cell (in row) that can have focus/ be selected.

                    1 Reply Last reply
                    0
                    • Christian EhrlicherC Offline
                      Christian EhrlicherC Offline
                      Christian Ehrlicher
                      Lifetime Qt Champion
                      wrote on last edited by
                      #16

                      Ah, I see.
                      @Megamouse : Can you please create a bug report for it so I've a reference for the bugfix.

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

                      MegamouseM 1 Reply Last reply
                      1
                      • Christian EhrlicherC Christian Ehrlicher

                        Ah, I see.
                        @Megamouse : Can you please create a bug report for it so I've a reference for the bugfix.

                        MegamouseM Offline
                        MegamouseM Offline
                        Megamouse
                        wrote on last edited by
                        #17

                        @Christian-Ehrlicher

                        https://bugreports.qt.io/browse/QTBUG-72400

                        MegamouseM 1 Reply Last reply
                        2
                        • MegamouseM Megamouse

                          @Christian-Ehrlicher

                          https://bugreports.qt.io/browse/QTBUG-72400

                          MegamouseM Offline
                          MegamouseM Offline
                          Megamouse
                          wrote on last edited by
                          #18

                          @Christian-Ehrlicher
                          sorry but i've never built Qt myself so i don't really know how to test your commit

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

                            What OS are you on ?

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

                            MegamouseM 1 Reply Last reply
                            0
                            • SGaistS SGaist

                              What OS are you on ?

                              MegamouseM Offline
                              MegamouseM Offline
                              Megamouse
                              wrote on last edited by
                              #20

                              @SGaist Windows 10

                              1 Reply Last reply
                              0
                              • Christian EhrlicherC Offline
                                Christian EhrlicherC Offline
                                Christian Ehrlicher
                                Lifetime Qt Champion
                                wrote on last edited by
                                #21

                                No problem. think the unit tests are enough :)

                                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

                                • Login

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