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. Copy/Paste with QTableView

Copy/Paste with QTableView

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 2.2k 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.
  • R Offline
    R Offline
    Resurrection
    wrote on last edited by
    #1

    Hi,

    I am using custom 2D model (inheriting from QAbstractTableModel) and QTableView sub-class to add some more features such as copy/paste support.

    Now consider this model in a view:

    @
    x | 1 | 2 | 3
    1 | a | d | h
    2 | b | e | h
    3 | c | f | i
    @

    Column 1 should be disabled for editing. It should allow copying the data but not pasting it, not even indirectly (i.e. you select 'h' and 'e' and paste it on 'd' => 'e' should not overwrite 'b').

    How to implement such a thing? Disabling editing on the model level seems wrong and it might even hinder things like populating model with data. However on the view level I have no knowledge of the proportions of the incoming MIME data.

    Maybe I am going about it all wrong though. Any suggestiong would be appreciated.

    Secrets are power.

    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