I have a QSqlTableModel, a QTableView and a QStyledItemDelegate.
I can find out the column name in paint() this way:
Qt Code:
QString fieldname, tablename; if( abstractmodel->inherits( "QSqlQueryModel")) { fieldname = rec.fieldName(col); }To copy to clipboard, switch view to plain text mode
Same if I use QSqlTableModel instead of for QSqlQueryModel. This part works.
But now I need to find out the tablename because when I use QSqlQueryModel I can join multiple tables and I can't identify a certain column only by the column name, I also need the table name...
Bookmarks