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. QTableWidget, emits tableCellChanged
Forum Updated to NodeBB v4.3 + New Features

QTableWidget, emits tableCellChanged

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

    I have an instance of QTableWidget, during the table set-up and population I call:

    const QSignalBlocker blocker(*pobjTable);
    

    Where pobjTable is a pointer to the instance of QTableWidget. This works fine, however when I click on a cell the signal cellChanged is emitted, no data has changed at this point so is this a bug?

    Its annoying that the signal does not include any previous or new data, just the column and row numbers.

    [Edit] Actually I think its my understanding thats wrong and I think the signal is badly named, its emitted when the selection of the cell changes, not the data.

    The description here (https://doc.qt.io/qt-6/qtablewidget.html#cellChanged) is misleading because its emitted when the data has not changed.

    Kind Regards,
    Sy

    JonBJ 1 Reply Last reply
    0
    • SPlattenS SPlatten

      I have an instance of QTableWidget, during the table set-up and population I call:

      const QSignalBlocker blocker(*pobjTable);
      

      Where pobjTable is a pointer to the instance of QTableWidget. This works fine, however when I click on a cell the signal cellChanged is emitted, no data has changed at this point so is this a bug?

      Its annoying that the signal does not include any previous or new data, just the column and row numbers.

      [Edit] Actually I think its my understanding thats wrong and I think the signal is badly named, its emitted when the selection of the cell changes, not the data.

      The description here (https://doc.qt.io/qt-6/qtablewidget.html#cellChanged) is misleading because its emitted when the data has not changed.

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by
      #2

      @SPlatten
      I don't know but I would only have expected, say, cellActivated. I would check your assertion that just clicking causes cellChanged, as opposed to either editing or setting it in code? You might verify your data before and after the signal. I'm not sure, but doesn't a QTableWidget start with no items in the cells, even putting an empty one in there might be a change?

      SPlattenS 1 Reply Last reply
      0
      • JonBJ JonB

        @SPlatten
        I don't know but I would only have expected, say, cellActivated. I would check your assertion that just clicking causes cellChanged, as opposed to either editing or setting it in code? You might verify your data before and after the signal. I'm not sure, but doesn't a QTableWidget start with no items in the cells, even putting an empty one in there might be a change?

        SPlattenS Offline
        SPlattenS Offline
        SPlatten
        wrote on last edited by SPlatten
        #3

        @JonB , it looks like both signals are emitted. I realise it starts with no data, thats why when I set-it up with data I have a call to QSignalBlocker to prevent it emitting signals.

        Kind Regards,
        Sy

        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