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. How to abort editing a QTableWidgetItem
Qt 6.11 is out! See what's new in the release blog

How to abort editing a QTableWidgetItem

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 834 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.
  • l3u_L Offline
    l3u_L Offline
    l3u_
    wrote on last edited by
    #1

    Hi :-)

    I use a QTableWidget with a QStyledItemDelegate that handles editing data. How can I programatically abort editing a QTableWidgetItem, just like if ESC is pressed during editing, so that nothing happens and the editor is simply closed?

    Seemed to be a trivial task, but I just can't get it to work :-(

    Thanks for all help!

    raven-worxR 1 Reply Last reply
    0
    • l3u_L l3u_

      Hi :-)

      I use a QTableWidget with a QStyledItemDelegate that handles editing data. How can I programatically abort editing a QTableWidgetItem, just like if ESC is pressed during editing, so that nothing happens and the editor is simply closed?

      Seemed to be a trivial task, but I just can't get it to work :-(

      Thanks for all help!

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @l3u_
      emit the closeEditor() signal

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      l3u_L 1 Reply Last reply
      1
      • raven-worxR raven-worx

        @l3u_
        emit the closeEditor() signal

        l3u_L Offline
        l3u_L Offline
        l3u_
        wrote on last edited by
        #3

        @raven-worx I already tried this, but setModelData is still called …

        1 Reply Last reply
        0
        • l3u_L Offline
          l3u_L Offline
          l3u_
          wrote on last edited by
          #4

          Okay, this was a timing problem of some signal stuff I do in addition … the setModelData happened later, not when I thought closeEditor had no effect.

          Thanks anyway :-)

          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