-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #363 from PetrZidek/use-qset-in-channel-filter
Use qset in channel filter
- Loading branch information
Showing
22 changed files
with
644 additions
and
443 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#pragma once | ||
|
||
#include <QWidget> | ||
#include <shv/visu/timeline/graph.h> | ||
|
||
namespace shv { | ||
namespace visu { | ||
namespace logview { | ||
|
||
namespace Ui { | ||
class DataViewWidget; | ||
} | ||
|
||
class DataViewWidget : public QWidget | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit DataViewWidget(QWidget *parent = nullptr); | ||
~DataViewWidget(); | ||
|
||
void init(const QString &site_path, timeline::Graph *graph); | ||
|
||
private: | ||
void onShowChannelFilterClicked(); | ||
|
||
timeline::Graph *m_graph = nullptr; | ||
QString m_sitePath; | ||
|
||
Ui::DataViewWidget *ui; | ||
}; | ||
|
||
}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#include "ui_dataviewwidget.h" | ||
|
||
#include <shv/visu/logview//dataviewwidget.h> | ||
#include <shv/visu/timeline/graph.h> | ||
#include <shv/visu/timeline/channelfilterdialog.h> | ||
|
||
#include "shv/core/log.h" | ||
|
||
namespace tl = shv::visu::timeline; | ||
|
||
namespace shv::visu::logview { | ||
|
||
DataViewWidget::DataViewWidget(QWidget *parent) : | ||
QWidget(parent), | ||
ui(new Ui::DataViewWidget) | ||
{ | ||
ui->setupUi(this); | ||
|
||
connect(ui->pbShowChannelFilterDialog, &QToolButton::clicked, this, &DataViewWidget::onShowChannelFilterClicked); | ||
} | ||
|
||
DataViewWidget::~DataViewWidget() | ||
{ | ||
delete ui; | ||
} | ||
|
||
void DataViewWidget::init(const QString &site_path, timeline::Graph *graph) | ||
{ | ||
if (m_graph != nullptr) { | ||
shvWarning() << "Dialog is allready initialized."; | ||
return; | ||
} | ||
|
||
m_graph = graph; | ||
m_sitePath = site_path; | ||
|
||
connect(graph, &timeline::Graph::channelFilterChanged, this, [this](){ | ||
ui->pbShowChannelFilterDialog->setIcon(m_graph->isChannelFilterValid()? QIcon(QStringLiteral(":/shv/visu/images/filter.svg")): QIcon(QStringLiteral(":/shv/visu/images/filter-off.svg"))); | ||
}); | ||
} | ||
|
||
void DataViewWidget::onShowChannelFilterClicked() | ||
{ | ||
auto *channel_filter_dialog = new tl::ChannelFilterDialog(this, m_sitePath, m_graph); | ||
|
||
if (channel_filter_dialog->exec() == QDialog::Accepted) { | ||
m_graph->setChannelFilter(channel_filter_dialog->channelFilter()); | ||
} | ||
|
||
channel_filter_dialog->deleteLater(); | ||
} | ||
|
||
} |
Oops, something went wrong.