implement basic Table component

This commit is contained in:
laserpants 2016-03-20 11:56:51 +03:00
parent e84c88b755
commit a24c010be1
2 changed files with 36 additions and 0 deletions

View File

@ -1 +1,19 @@
#include "table.h"
Table::Table(QWidget *parent)
: QTableWidget(parent)
{
setShowGrid(false);
setSelectionMode(QAbstractItemView::SingleSelection);
setSelectionBehavior(QAbstractItemView::SelectRows);
setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
}
Table::~Table()
{
}
bool Table::eventFilter(QObject *obj, QEvent *event)
{
return QTableWidget::eventFilter(obj, event);
}

View File

@ -0,0 +1,18 @@
#ifndef TABLE_H
#define TABLE_H
#include <QTableWidget>
class Table : public QTableWidget
{
Q_OBJECT
public:
explicit Table(QWidget *parent = 0);
~Table();
protected:
bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE;
};
#endif // TABLE_H