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. QSqlRelationalTableModel::removeRow causes relation delegate to dissapear before select()

QSqlRelationalTableModel::removeRow causes relation delegate to dissapear before select()

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtableviewqsqlrelationqsqltablemodel
1 Posts 1 Posters 703 Views
  • 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.
  • D Offline
    D Offline
    dijuna
    wrote on 25 Apr 2016, 20:42 last edited by
    #1

    If I use QSqlRelationalTableModel::removeRow to remove a row from my QTableView, it keeps the row visible and marks it with "!" sign and this is what I want it to do. One of the columns is a relation column:

    int role_idx = model->fieldIndex("role_id");
    model->setRelation(role_idx, QSqlRelation("Roles", "id", "role_name"));
    model->setJoinMode(QSqlRelationalTableModel::InnerJoin);
    

    After I use removeRow(), the delegate (which is QComboBox created automatically, I didn't set my own QItemDelegate for the column) dissapears. It has no inpact on anything but is weird nonetheless, and looks bad. I would prefer all the delegates to dissapear, or none of them. Why is it not so, and how to change it?

    1 Reply Last reply
    0

    1/1

    25 Apr 2016, 20:42

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved