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. QTableView disable updating when user is editing the datas
Forum Updated to NodeBB v4.3 + New Features

QTableView disable updating when user is editing the datas

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtablemodelqtableviewsignals & slotsqt 5.7
4 Posts 2 Posters 3.1k 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.
  • N Offline
    N Offline
    Nosba
    wrote on 8 Aug 2016, 01:50 last edited by
    #1

    Hi all,

    I have a QAbstractTableModel subclass containing a timer, so it send the update signal every second.

    The problem is that, if I use more than 1 second to write, tableView updates itself while I'm editing, deleting what I wrote.
    So how can I stop the update signal when I'm editing the view?

    K 1 Reply Last reply 8 Aug 2016, 05:22
    0
    • N Nosba
      8 Aug 2016, 01:50

      Hi all,

      I have a QAbstractTableModel subclass containing a timer, so it send the update signal every second.

      The problem is that, if I use more than 1 second to write, tableView updates itself while I'm editing, deleting what I wrote.
      So how can I stop the update signal when I'm editing the view?

      K Offline
      K Offline
      kshegunov
      Moderators
      wrote on 8 Aug 2016, 05:22 last edited by kshegunov 8 Aug 2016, 05:24
      #2

      @Nosba
      Hello,
      You can use QObject::blockSignals or the utility wrapper class QSignalBlocker.

      Kind regards.

      Read and abide by the Qt Code of Conduct

      N 1 Reply Last reply 8 Aug 2016, 18:21
      0
      • K kshegunov
        8 Aug 2016, 05:22

        @Nosba
        Hello,
        You can use QObject::blockSignals or the utility wrapper class QSignalBlocker.

        Kind regards.

        N Offline
        N Offline
        Nosba
        wrote on 8 Aug 2016, 18:21 last edited by
        #3

        @kshegunov

        Thanks a lot for your answer.

        I've already seen it, but how can I know when the user is editing a cell? is there some signal emited like startEditing(), end endEditing() ?

        I cannot find it in documentation

        K 1 Reply Last reply 9 Aug 2016, 08:40
        0
        • N Nosba
          8 Aug 2016, 18:21

          @kshegunov

          Thanks a lot for your answer.

          I've already seen it, but how can I know when the user is editing a cell? is there some signal emited like startEditing(), end endEditing() ?

          I cannot find it in documentation

          K Offline
          K Offline
          kshegunov
          Moderators
          wrote on 9 Aug 2016, 08:40 last edited by
          #4

          @Nosba said:

          but how can I know when the user is editing a cell?

          I don't know, and that wasn't your original question. One thing you could try is to subclass the view and reimplement the edit() method from where you can emit a signal that notifies you when editing has started. I hope that helps.

          Kind regards.

          Read and abide by the Qt Code of Conduct

          1 Reply Last reply
          0

          1/4

          8 Aug 2016, 01:50

          • Login

          • Login or register to search.
          1 out of 4
          • First post
            1/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved