implement basic Table component
This commit is contained in:
parent
e84c88b755
commit
a24c010be1
|
@ -1 +1,19 @@
|
||||||
#include "table.h"
|
#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);
|
||||||
|
}
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue