From 90f651d5482627715dba13b8210e7ac725fea020 Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Mon, 6 Jul 2015 20:48:33 +0200 Subject: [PATCH] displayformats: Semi-fix filters Fix the filters. For columns with a display format set they always perform string comparisons but this is probably just something you have to live with... --- src/sqlitetablemodel.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/sqlitetablemodel.cpp b/src/sqlitetablemodel.cpp index 9b8d8b5c..7aa2227d 100644 --- a/src/sqlitetablemodel.cpp +++ b/src/sqlitetablemodel.cpp @@ -478,7 +478,14 @@ void SqliteTableModel::buildQuery() where = "WHERE 1=1"; for(QMap::const_iterator i=m_mWhere.constBegin();i!=m_mWhere.constEnd();++i) - where.append(QString(" AND `%1` %2").arg(m_headers.at(i.key())).arg(i.value())); + { + QString column; + if(m_vDisplayFormat.size()) + column = QString("col%1").arg(i.key()); + else + column = m_headers.at(i.key()); + where.append(QString(" AND `%1` %2").arg(column).arg(i.value())); + } } QString selector; @@ -487,7 +494,7 @@ void SqliteTableModel::buildQuery() selector = "*"; } else { for(int i=0;i