
Originally Posted by
estanisgeyer
if (role == Qt::DisplayRole && idx.column() > 0 &&
index(idx.row(), idx.column(), idx.parent()).data().toString() == "0")
This causes an infinite recursion.
Use:
if( role
== Qt
::DisplayRole && idx.
column() >
0 && QSqlQueryModel::data( idx
).
toString() == "0" ) { ...
if( role == Qt::DisplayRole && idx.column() > 0 && QSqlQueryModel::data( idx ).toString() == "0" ) {
...
To copy to clipboard, switch view to plain text mode
or, since you call data() in the first line:
if( role == Qt::DisplayRole && idx.column() > 0 && v.toString() == "0" ) {
...
if( role == Qt::DisplayRole && idx.column() > 0 && v.toString() == "0" ) {
...
To copy to clipboard, switch view to plain text mode
Bookmarks