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. Cellchanged in a TableWidget
QtWS25 Last Chance

Cellchanged in a TableWidget

Scheduled Pinned Locked Moved General and Desktop
cellchangededitingqtablewidgetqt4.8c++
2 Posts 2 Posters 1.8k 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.
  • A Offline
    A Offline
    Adrianos
    wrote on last edited by
    #1

    I try to edit numerical value in cells in TableWidget with keyboard and mouse scroll. I want to keep focus on selected cell unless confirmation of value with or mouse selection of another cell.

    ParamTableWidget::ParamTableWidget(QWidget *parent) :
    TableWidget(parent)
    {
    connect(this, SIGNAL(cellChanged(int,int)),this, SLOT(slotCellChanged(int, int)));
    }

    void ParamTableWidget::slotCellChanged(int row, int column)
    {
    selectionModel()->select(model()->index(row,1), QItemSelectionModel::Select);
    edit(model()->index(row,1));
    }

    I can't discard a modified cell value and i can't escape from cell edit without .

    Any idea where the bug is?

    youzkingY 1 Reply Last reply
    0
    • A Adrianos

      I try to edit numerical value in cells in TableWidget with keyboard and mouse scroll. I want to keep focus on selected cell unless confirmation of value with or mouse selection of another cell.

      ParamTableWidget::ParamTableWidget(QWidget *parent) :
      TableWidget(parent)
      {
      connect(this, SIGNAL(cellChanged(int,int)),this, SLOT(slotCellChanged(int, int)));
      }

      void ParamTableWidget::slotCellChanged(int row, int column)
      {
      selectionModel()->select(model()->index(row,1), QItemSelectionModel::Select);
      edit(model()->index(row,1));
      }

      I can't discard a modified cell value and i can't escape from cell edit without .

      Any idea where the bug is?

      youzkingY Offline
      youzkingY Offline
      youzking
      wrote on last edited by
      #2

      @Adrianos

      the Cellchanged signal is emitted after the content change so you can't prevent modefication of a cell by this signal

      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