Results 1 to 3 of 3

Thread: Copying contents of QTableView cell to clipboard

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: Copying contents of QTableView cell to clipboard

    Override/catch keyPressEvent for the table view, check for appropriate key combination (Qt::ControlModifier, Qt::Key_C) , and use something like:
    Qt Code:
    1. QApplication::clipboard()->setText(tableView->currentIndex().data().toString())
    To copy to clipboard, switch view to plain text mode 

    The problem with item delegate's editor is that the user would naturally be able to copy only in editing mode..
    J-P Nurmi

  2. The following user says thank you to jpn for this useful post:

    Conel (18th April 2006)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.