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. How to maintain the current index of QTableView
Forum Updated to NodeBB v4.3 + New Features

How to maintain the current index of QTableView

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 247 Views
  • 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.
  • tovaxT Offline
    tovaxT Offline
    tovax
    wrote on last edited by
    #1

    When QTableView loses focus, its current index will become -1. How can I maintain the current index after losing focus?
    Defining new variables can be used to save data for the current index, but I don't think it's a good idea. Does QTableView have any related properties?

    Best Regards!

    Christian EhrlicherC 1 Reply Last reply
    0
    • tovaxT tovax

      When QTableView loses focus, its current index will become -1. How can I maintain the current index after losing focus?
      Defining new variables can be used to save data for the current index, but I don't think it's a good idea. Does QTableView have any related properties?

      Best Regards!

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @tovax said in How to maintain the current index of QTableView:

      When QTableView loses focus, its current index will become -1.

      I doubt that.

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

      tovaxT 1 Reply Last reply
      3
      • Christian EhrlicherC Christian Ehrlicher

        @tovax said in How to maintain the current index of QTableView:

        When QTableView loses focus, its current index will become -1.

        I doubt that.

        tovaxT Offline
        tovaxT Offline
        tovax
        wrote on last edited by
        #3

        @Christian-Ehrlicher
        Thank you for your reply. With your reminder, I found the cause of the error after checking: duplicate construction of a singleton class.
        Best Regards!

        1 Reply Last reply
        0
        • tovaxT tovax 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