Make the QTableWidget a QTableView

Rewrite some code to use a QTableView widget instead of a QTableWidget
in the browse tab of the main window, or more presicely in the new
extended table widget class. This way the widget and the data model are
separated which on the one hand means a bit more work on our side but on
the other hand also gives us a bit more flexibility. And more
importantly at the moment: This means both, the browse tab and the sql
tab, use a table view now - that's going to be helpful for the next
commit...
This commit is contained in:
Martin Kleusberg
2013-03-16 19:10:03 +01:00
parent d9cd62ba49
commit 5e8c14e942
5 changed files with 59 additions and 60 deletions

View File

@@ -4,14 +4,8 @@
#include <QKeyEvent>
#include "ExtendedTableWidget.h"
ExtendedTableWidget::ExtendedTableWidget(int rows, int columns, QWidget* parent) :
QTableWidget(rows, columns, parent)
{
}
ExtendedTableWidget::ExtendedTableWidget(QWidget* parent) :
QTableWidget(parent)
QTableView(parent)
{
}
@@ -57,5 +51,5 @@ void ExtendedTableWidget::keyPressEvent(QKeyEvent* event)
if(event->matches(QKeySequence::Copy))
copy();
else
QTableWidget::keyPressEvent(event);
QTableView::keyPressEvent(event);
}