area.
emit mouseCursorLeft();
}
+void GraphView::mouseDoubleClickEvent(QMouseEvent* ev)
+{
+ /* Prevent doubleclick on GraphView from propagating to SignalView */
+ switch (ev->button()) {
+ case Qt::LeftButton:
+ break;
+ case Qt::RightButton:
+ break;
+ default:
+ break;
+ }
+}
+
void GraphView::mouseMoveEvent(QMouseEvent* ev)
{
emit mouseMoved(ev->x(), ev->y());
public:
explicit GraphView(QWidget* parent = nullptr);
void leaveEvent(QEvent* );
+ void mouseDoubleClickEvent(QMouseEvent* );
void mouseMoveEvent(QMouseEvent* ev);
void mousePressEvent(QMouseEvent* ev);
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
+ m_singleSignalView(false),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
else if(ui->qpb_zoom->isChecked())
sw->setControlMode(GraphControlModes::ZOOM);
- //m_itemsOnDashboard.push_back(sw);
connect(this, SIGNAL(controlModeChanged(GraphControlModes)), sw, SLOT(onControlModeChanged(GraphControlModes)));
+ connect(sw, SIGNAL(fullSizeToggle()), this, SLOT(onSWFullSizeToggle()));
m_dashboard->addWidget(sw);
}
}
}
-void MainWindow::onZoomSelected()
-{
- emit controlModeChanged(GraphControlModes::ZOOM);
-}
-
-/* Private slots */
void MainWindow::onSequenceSelected(const QString &str)
{
emit sequenceSelected(str);
emit singleRunSelected(str);
}
+void MainWindow::onSWFullSizeToggle()
+{
+ QWidget* sender = qobject_cast<QWidget*>(QObject::sender());
+
+ for (int idx = 0; idx < m_dashboard->count(); idx++) {
+ if (m_dashboard->widget(idx) != sender) {
+ if (!m_singleSignalView)
+ m_dashboard->widget(idx)->hide();
+ else
+ m_dashboard->widget(idx)->show();
+ }
+ }
+
+ m_singleSignalView = !m_singleSignalView;
+}
+
+void MainWindow::onZoomSelected()
+{
+ emit controlModeChanged(GraphControlModes::ZOOM);
+}
+
MainWindow::~MainWindow()
{
delete ui;
//std::vector<SignalView*> m_itemsOnDashboard;
QSplitter* m_dashboard;
QFileDialog* m_loadDataFileDialog;
+ bool m_singleSignalView;
Ui::MainWindow *ui;
public slots:
void onLoadSingleRun();
void onSequenceSelected(const QString& str);
void onSingleRunSelected(const QString& str);
+ void onSWFullSizeToggle();
void onZoomSelected();
signals:
#include <QtGui/QFontMetrics>
#include <QtGui/QPainter>
-#include <QDebug>
+//#include <QDebug>
SignalView::SignalView(QWidget *parent) :
QWidget(parent),
}
/* Public functions */
+void SignalView::mouseDoubleClickEvent(QMouseEvent* ev)
+{
+ switch (ev->button()) {
+ case Qt::LeftButton:
+ emit fullSizeToggle();
+ break;
+ default:
+ break;
+ }
+}
+
void SignalView::setControlMode(GraphControlModes mode)
{
m_graphCtrlMode = mode;
explicit SignalView(QWidget* parent = nullptr);
~SignalView();
+ void mouseDoubleClickEvent(QMouseEvent* ev);
void setControlMode(GraphControlModes mode);
void setDataTableModel (SignalDataTableModel* model);
void setIntegrationTableModel(IntegrationTableModel* model);
signals:
void crosshairErased();
void crosshairMoved(const int x, const int y);
+ void fullSizeToggle();
void integrated(const int fromX, const int fromY, const int toX, const int toY);
void redrawNeeded();
void resized(const int x, const int y);