1#ifndef CANSINGALVIEWERGUIIMPL_H
2#define CANSINGALVIEWERGUIIMPL_H
6#include "ui_cansignalviewer.h"
7#include <QStandardItemModel>
16 , _widget(new QWidget)
18 _ui->setupUi(_widget);
19 _widget->setMinimumSize(_ui->tv->minimumSize());
24 QObject::connect(_ui->pbClear, &QPushButton::pressed, cb);
29 QObject::connect(_ui->pbDockUndock, &QPushButton::toggled, cb);
34 QObject::connect(_ui->tv->horizontalHeader(), &QHeaderView::sectionClicked, cb);
39 QObject::connect(_ui->pbToggleFilter, &QPushButton::toggled, cb);
47 virtual void setModel(QAbstractItemModel* model)
override
49 _ui->tv->setModel(model);
54 _ui->tv->setModel(&tvModel);
55 _ui->tv->horizontalHeader()->setSectionsMovable(
true);
56 _ui->tv->horizontalHeader()->setSortIndicator(0, Qt::AscendingOrder);
57 _ui->tv->setColumnHidden(0,
true);
58 _ui->tv->setColumnWidth(3, 85);
59 _ui->tv->horizontalHeader()->setSectionResizeMode(4, QHeaderView::Stretch);
60 _ui->tv->setColumnWidth(5, 200);
65 return _ui->freezeBox->isChecked();
70 if (_ui->freezeBox->isChecked() != state) {
71 _ui->freezeBox->setChecked(state);
77 _ui->tv->scrollToBottom();
82 return _ui->tv->horizontalHeader()->sortIndicatorOrder();
87 return _ui->tv->model()->headerData(ndx, Qt::Horizontal).toString();
90 virtual void setSorting(
int sortNdx, Qt::SortOrder order)
override
92 _ui->tv->sortByColumn(sortNdx, order);
93 _ui->tv->horizontalHeader()->setSortIndicator(sortNdx, order);
98 return _widget->windowTitle();
103 return _ui->tv->isColumnHidden(ndx);
108 auto horHeader = _ui->tv->horizontalHeader();
109 vIdx = horHeader->visualIndex(ndx);
114 auto horHeader = _ui->tv->horizontalHeader();
115 horHeader->moveSection(vIdxFrom, vIdxTo);
119 Ui::CanSignalViewerPrivate* _ui;
Definition cansignalviewer_p.h:12
Definition canrawsender_p.h:13
Definition cansignalviewerguiimpl.h:12
virtual QString getClickedColumn(int ndx) override
Definition cansignalviewerguiimpl.h:85
virtual void initTableView(QAbstractItemModel &tvModel) override
Definition cansignalviewerguiimpl.h:52
virtual bool isViewFrozen() override
Definition cansignalviewerguiimpl.h:63
virtual QWidget * mainWidget() override
Definition cansignalviewerguiimpl.h:42
virtual void setClearCbk(const clear_t &cb) override
Definition cansignalviewerguiimpl.h:22
virtual void setSorting(int sortNdx, Qt::SortOrder order) override
Definition cansignalviewerguiimpl.h:90
virtual bool isColumnHidden(int ndx) override
Definition cansignalviewerguiimpl.h:101
virtual Qt::SortOrder getSortOrder() override
Definition cansignalviewerguiimpl.h:80
CanSignalViewerGuiImpl()
Definition cansignalviewerguiimpl.h:14
virtual void setFilterCbk(const filter_t &cb) override
Definition cansignalviewerguiimpl.h:37
virtual void scrollToBottom() override
Definition cansignalviewerguiimpl.h:75
virtual QString getWindowTitle() override
Definition cansignalviewerguiimpl.h:96
virtual void setDockUndockCbk(const dockUndock_t &cb) override
Definition cansignalviewerguiimpl.h:27
virtual void setViewFrozen(bool state) override
Definition cansignalviewerguiimpl.h:68
virtual void setSectionClikedCbk(const sectionClicked_t &cb) override
Definition cansignalviewerguiimpl.h:32
virtual void getColumnProper(int ndx, int &vIdx) override
Definition cansignalviewerguiimpl.h:106
virtual void setColumnProper(int vIdxFrom, int vIdxTo) override
Definition cansignalviewerguiimpl.h:112
virtual void setModel(QAbstractItemModel *model) override
Definition cansignalviewerguiimpl.h:47
Definition cansignalviewerguiint.h:10
std::function< void(bool)> filter_t
Definition cansignalviewerguiint.h:14
std::function< void()> dockUndock_t
Definition cansignalviewerguiint.h:12
std::function< void(int)> sectionClicked_t
Definition cansignalviewerguiint.h:13
std::function< void()> clear_t
Definition cansignalviewerguiint.h:11