Results 1 to 4 of 4

Thread: [QTableView] Some cells and column headers not accessible (editable)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default [QTableView] Some cells and column headers not accessible (editable)

    Hello,
    I have a problem with QTableView and QSqlRelationalTableModel. The problem is that few cells and column headers are not editable. It's even not clickable.
    The following are the conditions:

    Qt Code:
    1. - QSqlRelationalTableMode
    To copy to clipboard, switch view to plain text mode 

    Thanks in advice! I hope I didn't forget anything, but if anything is missing, just ask!

    Edit: Maybe I should post some more information:
    Qt Code:
    1. model = new QSqlRelationalTableModel( tableView );
    2. model->setTable("Protokoll");
    3. proxy = new proxymodel(tableView);
    4.  
    5. // ------
    6.  
    7. model->setRelation(12,QSqlRelation("Status", "ID", "Status"));
    8.  
    9. model->setEditStrategy(QSqlTableModel::OnFieldChange);
    10. tableView->setSelectionMode(QTableView::SingleSelection);
    11. tableView->setSelectionBehavior(QTableView::SelectRows);
    12.  
    13.  
    14. tableView->setEditTriggers(QAbstractItemView::DoubleClicked);
    15. proxy->setSourceModel(model);
    16.  
    17. tableView->setModel(proxy);
    18. tableView->hideColumn(0);
    19. tableView->setItemDelegate(new QSqlRelationalDelegate(this));
    20.  
    21. tableView->setSortingEnabled(true);
    22. model->select();
    To copy to clipboard, switch view to plain text mode 
    Last edited by psychonaut; 5th May 2011 at 11:24.

Similar Threads

  1. QTableView column-headers too short ...
    By kerim in forum Newbie
    Replies: 2
    Last Post: 20th April 2011, 09:09
  2. Column Not Editable
    By waynew in forum Qt Programming
    Replies: 1
    Last Post: 1st August 2010, 01:43
  3. Editable QTreeView with expandable cells
    By corrado in forum Qt Programming
    Replies: 0
    Last Post: 19th April 2010, 17:42
  4. QTableView + column span of headers
    By NoRulez in forum Qt Programming
    Replies: 2
    Last Post: 11th November 2009, 14:29
  5. Editable cells in QTableView
    By TheRonin in forum Qt Programming
    Replies: 1
    Last Post: 29th November 2006, 17:39

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.