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. Does tab order in a QTableWidget ignore setCurrentCell()? ...why? ...work around?
Forum Updated to NodeBB v4.3 + New Features

Does tab order in a QTableWidget ignore setCurrentCell()? ...why? ...work around?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 563 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.
  • D Offline
    D Offline
    David Jacobson
    wrote on last edited by
    #1

    I have a QTableWidget where, in my itemChanged slot function, I relocate the user back to a certain cell if they entered something bad / invalid / custom validation. I do this using table.setCurrentCell(row, errCol). This only seems to work if the user enters the data by pressing the return key. Yet, if they tab out of the cell, regardless of the fact that the itemChanged function was correctly called with the correct row and col params, my setCurrentCell() is completely ignore and the tab send the user to the next tab order cell no matter what. Is there a way for me to catch this, set them back to their invalid entered cell?

    Thank you!

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

      Hi,

      Interesting use case. Can you provide a minimal sample that shows that behavior ?

      By the way, what version of Qt ? On what OS ?

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

      D 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Interesting use case. Can you provide a minimal sample that shows that behavior ?

        By the way, what version of Qt ? On what OS ?

        D Offline
        D Offline
        David Jacobson
        wrote on last edited by David Jacobson
        #3

        @SGaist I will put together an example. In the mean time, my versions:

        Qt version: 5.9.4
        SIP version: 4.19.8
        PyQt version: 5.9.2

        OS: Windows 10

        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