fix a crash with browsing VIRTUAL tables, that we can't query

This commit is contained in:
Peinthor Rene
2014-05-09 17:41:00 +02:00
parent 9bd3cf1655
commit c495524fbc

View File

@@ -193,7 +193,13 @@ QVariant SqliteTableModel::headerData(int section, Qt::Orientation orientation,
return QVariant();
if (orientation == Qt::Horizontal)
return m_headers.at(section);
{
// if we have a VIRTUAL table the model will not be valid, with no header data
if(section < m_headers.size())
return m_headers.at(section);
return QString("%1").arg(section + 1);
}
else
return QString("%1").arg(section + 1);
}