Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QTableWidget moveCursor
Qt 6.12 LTS is out! See what's new in the release blog

QTableWidget moveCursor

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 584 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I'm wondering if I found a Qt bug.

    I overrode this function:
    QModelIndex moveCursor (QAbstractItemView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers)

    I find when I'm using the arrow keys to move the cursor downward, sometimes the cursor just disappears. This happens after the cursor has forced the table widget to scroll itself at least once.

    The rows that I'm moving the cursor on really do exist in the model.

    At the start of my moveCursor I print the current row and column. After the cursor disappears, these are -1.

    Is there any need to call the superclass's moveCursor?

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

      Hi,

      Please share your implementation or even better a minimal compilable example that reproduces the behavior you see.

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

      1 Reply Last reply
      0
      • ? A Former User

        I'm wondering if I found a Qt bug.

        I overrode this function:
        QModelIndex moveCursor (QAbstractItemView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers)

        I find when I'm using the arrow keys to move the cursor downward, sometimes the cursor just disappears. This happens after the cursor has forced the table widget to scroll itself at least once.

        The rows that I'm moving the cursor on really do exist in the model.

        At the start of my moveCursor I print the current row and column. After the cursor disappears, these are -1.

        Is there any need to call the superclass's moveCursor?

        Axel SpoerlA Offline
        Axel SpoerlA Offline
        Axel Spoerl
        Moderators
        wrote on last edited by
        #3

        @clarify said in QTableWidget moveCursor:

        Is there any need to call the superclass's moveCursor?

        As @SGaist said, it's difficult to guess without seeing any code.
        But returning a randomly disappearing cursor is quite likely related to not returning to the superclass's moveCursor().

        Software Engineer
        The Qt Company, Oslo

        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
        • Unsolved