Add option for showing the rowid column

See issue #408.

This isn't working reliably yet on my system: If you enable the fix
restoring the previous settings when going back to a table doesn't work
and if you disable it that very way is the only way to change the
option. Don't know what's going on there :(
This commit is contained in:
Martin Kleusberg
2015-09-11 13:30:24 +02:00
parent b22a9cfcf6
commit 1ebecbbc9d
5 changed files with 90 additions and 30 deletions

View File

@@ -63,7 +63,7 @@ FilterTableHeader::FilterTableHeader(QTableView* parent) :
setContextMenuPolicy(Qt::CustomContextMenu);
}
void FilterTableHeader::generateFilters(int number)
void FilterTableHeader::generateFilters(int number, bool showFirst)
{
// Delete all the current filter widgets
for(int i=0;i < filterWidgets.size(); ++i)
@@ -74,7 +74,10 @@ void FilterTableHeader::generateFilters(int number)
for(int i=0;i < number; ++i)
{
FilterLineEdit* l = new FilterLineEdit(this, &filterWidgets, i);
l->setVisible(i>0); // This hides the first input widget which belongs to the hidden rowid column
if(!showFirst && i == 0) // This hides the first input widget which belongs to the hidden rowid column
l->setVisible(false);
else
l->setVisible(true);
connect(l, SIGNAL(textChanged(QString)), this, SLOT(inputChanged(QString)));
filterWidgets.push_back(l);
}