5#include "ui_canrawview.h"
6#include <QStandardItemModel>
18 widget->setMinimumSize(ui->tv->minimumSize());
23 QObject::connect(ui->pbClear, &QPushButton::pressed, cb);
28 QObject::connect(ui->pbDockUndock, &QPushButton::toggled, cb);
33 QObject::connect(ui->tv->horizontalHeader(), &QHeaderView::sectionClicked, cb);
38 QObject::connect(ui->pbToggleFilter, &QPushButton::toggled, cb);
46 virtual void setModel(QAbstractItemModel* model)
override
48 ui->tv->setModel(model);
53 ui->tv->setModel(&tvModel);
54 ui->tv->horizontalHeader()->setSectionsMovable(
true);
55 ui->tv->horizontalHeader()->setSortIndicator(0, Qt::AscendingOrder);
56 ui->tv->setColumnHidden(0,
true);
57 ui->tv->setColumnWidth(2, 85);
62 return ui->freezeBox->isChecked();
67 if (ui->freezeBox->isChecked() != state) {
68 ui->freezeBox->setChecked(state);
74 ui->tv->scrollToBottom();
79 return ui->tv->horizontalHeader()->sortIndicatorOrder();
84 return ui->tv->model()->headerData(ndx, Qt::Horizontal).toString();
87 virtual void setSorting(
int sortNdx, Qt::SortOrder order)
override
89 ui->tv->sortByColumn(sortNdx, order);
90 ui->tv->horizontalHeader()->setSortIndicator(sortNdx, order);
95 return widget->windowTitle();
100 return ui->tv->isColumnHidden(ndx);
105 auto horHeader = ui->tv->horizontalHeader();
106 vIdx = horHeader->visualIndex(ndx);
111 auto horHeader = ui->tv->horizontalHeader();
112 horHeader->moveSection(vIdxFrom, vIdxTo);
116 Ui::CanRawViewPrivate* ui;
Definition canrawview_p.h:20
Definition canrawsender_p.h:13
virtual bool isViewFrozen() override
Definition crvgui.h:60
virtual QWidget * mainWidget() override
Definition crvgui.h:41
virtual void setSorting(int sortNdx, Qt::SortOrder order) override
Definition crvgui.h:87
virtual void setModel(QAbstractItemModel *model) override
Definition crvgui.h:46
virtual void scrollToBottom() override
Definition crvgui.h:72
CRVGui()
Definition crvgui.h:13
virtual QString getWindowTitle() override
Definition crvgui.h:93
virtual void setColumnProper(int vIdxFrom, int vIdxTo) override
Definition crvgui.h:109
virtual bool isColumnHidden(int ndx) override
Definition crvgui.h:98
virtual void setSectionClikedCbk(const sectionClicked_t &cb) override
Definition crvgui.h:31
virtual Qt::SortOrder getSortOrder() override
Definition crvgui.h:77
virtual void initTableView(QAbstractItemModel &tvModel) override
Definition crvgui.h:51
virtual void setClearCbk(const clear_t &cb) override
Definition crvgui.h:21
virtual void setViewFrozen(bool state) override
Definition crvgui.h:65
virtual void getColumnProper(int ndx, int &vIdx) override
Definition crvgui.h:103
virtual void setDockUndockCbk(const dockUndock_t &cb) override
Definition crvgui.h:26
virtual QString getClickedColumn(int ndx) override
Definition crvgui.h:82
virtual void setFilterCbk(const filter_t &cb) override
Definition crvgui.h:36
Definition crvguiinterface.h:10
std::function< void()> clear_t
Definition crvguiinterface.h:11
std::function< void(int)> sectionClicked_t
Definition crvguiinterface.h:13
std::function< void(bool)> filter_t
Definition crvguiinterface.h:14
std::function< void()> dockUndock_t
Definition crvguiinterface.h:12