Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Cellchanged in a TableWidget

    General and Desktop
    cellchanged editing qtablewidget qt4.8 c++
    2
    2
    1535
    Loading More Posts
    • 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
      Adrianos last edited by

      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?

      youzking 1 Reply Last reply Reply Quote 0
      • youzking
        youzking @Adrianos last edited by

        @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 Reply Quote 0
        • First post
          Last post