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 make rows sticky during edit?
Forum Updated to NodeBB v4.3 + New Features

How to make rows sticky during edit?

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

    Here's my problem. I have a custom model that I represent via a QTreeView. I run this model through several sort/filter proxy models before connecting the final proxy model to the QTreeView. Then the user has the ability to choose various filters and the TreeView updates automatically.

    I want to give the user the ability to edit certain parts of each row using an editor. This is the easy part. The hard part is this. Those rows are active rows, they represent downloading packages. So if the user has selected the "Downloading" filter, starts editing and the item represented by the row finishes downloading during the edit, the row disappears the the editing is aborted.

    I need a way to make a row sticky when being edited. Is there a way?

    (I was thinking of detecting the View's state but my delegate, which controls the 'downloading' status doesn't have access to the view AFAIK. )

    1 Reply Last reply
    0
    • JeroentjehomeJ Offline
      JeroentjehomeJ Offline
      Jeroentjehome
      wrote on last edited by
      #2

      Hi,
      Isn't this more a thing for the model? The model supplies the delegate and controls the shown data. Maybe in the model check if the delegate is active and check on what row. If the 'completed' download should be updated (signal in model), abort this when the delegate is set to that item. When the user is done editing and the setData is called there will be an update to that row anyway.

      Greetz, Jeroen

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sledgehammer_999
        wrote on last edited by
        #3

        How do I do that? AFAIK the Model doesn't have any knowledge of the delegate. The delegate is set on the View with QAbstractItemView::setItemDeletgate().

        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