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 prevent moving cell (QtableView) if the data is invalid?
Qt 6.11 is out! See what's new in the release blog

How to prevent moving cell (QtableView) if the data is invalid?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.3k 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.
  • R Offline
    R Offline
    ras123
    wrote on last edited by
    #1

    Hi,
    I used a QValidator to check the data in a table cell, and if invalid data entered a message popup but after that table column moved to right (default tableView behavior). How to prevent leaving the cell if the data is invalid?
    I tried to get currentIndex().column(); to get the column number, but it always returns -1

    1 Reply Last reply
    0
    • N Offline
      N Offline
      notgary
      wrote on last edited by
      #2

      Have you tried just using currentIndex() without asking for the column, and just getting the complete reference to the cell in question?

      1 Reply Last reply
      0
      • R Offline
        R Offline
        ras123
        wrote on last edited by
        #3

        [solved]

        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