Results 1 to 1 of 1

Thread: QAbstractTableModel and 2 different QTableView (remap one row to one column)

  1. #1
    Join Date
    Sep 2011
    Posts
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Maemo/MeeGo

    Default QAbstractTableModel and 2 different QTableView (remap one row to one column)

    Hi,

    I have a QAbstractTableModel with one QSortFilterProxyModel connected to a QTableView.
    Now I want that if a user clicks on one row (any horizontal item) of the QTableView another QTableView is showing additional data of the QAbstractTableModel. Both QTableViews are editable and should correctly set the model data.

    So far I connected
    Qt Code:
    1. connect(fileTableView, SIGNAL(clicked(QModelIndex)), this, SLOT(onFileClicked(QModelIndex)));
    To copy to clipboard, switch view to plain text mode 

    In onFileClicked I save the clicked row to be used later.
    Qt Code:
    1. void MyClass::onFileClicked(const QModelIndex& index)
    2. {
    3. myModel->setClickedRow(index);
    4. }
    To copy to clipboard, switch view to plain text mode 

    I then used another QSortFilterProxyModel for the 2nd table and tried to reimplement mapFromSource(), but with no success.
    Has anybody an idea how to design the desired behaviour?

    Thanks Darth
    Last edited by darth vader; 8th May 2012 at 22:27.

Similar Threads

  1. Replies: 3
    Last Post: 18th April 2014, 03:37
  2. Replies: 0
    Last Post: 5th April 2011, 16:51
  3. Fixed column width in QAbstractTableModel
    By hailflex in forum Newbie
    Replies: 1
    Last Post: 11th December 2009, 06:58
  4. Performance with QTableView and QAbstractTableModel
    By MBex in forum Qt Programming
    Replies: 3
    Last Post: 25th February 2009, 08:04
  5. Replies: 3
    Last Post: 29th January 2009, 08:38

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.