sqlitetablemodel: fix crash on windows with sort order

if no sort column is set, new qt delivers random values
so this might be out of m_headers.size() and crashes
This commit is contained in:
Peinthor Rene
2015-12-26 08:57:07 +01:00
parent 4003dc6fec
commit 1c233de3b5

View File

@@ -362,7 +362,8 @@ void SqliteTableModel::sort(int column, Qt::SortOrder order)
return;
// Save sort order
m_iSortColumn = column;
if (column >= 0 && column < m_headers.size())
m_iSortColumn = column;
m_sSortOrder = (order == Qt::AscendingOrder ? "ASC" : "DESC");
// Set the new query (but only if a table has already been set