From: Joel Holdsworth Date: Wed, 27 Jun 2012 21:24:48 +0000 (+0100) Subject: Added empty SamplingBar object X-Git-Tag: pulseview-0.1.0~333 X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=d4984fe7119c2fc9bf94b13cc38cc735887e377d Added empty SamplingBar object --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 4644dc83..7e137145 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,7 @@ set(sigrok-qt2_SOURCES logicsignal.cpp main.cpp mainwindow.cpp + samplingbar.cpp signaldata.cpp sigsession.cpp signal.cpp @@ -31,6 +32,7 @@ set(sigrok-qt2_SOURCES set(sigrok-qt2_HEADERS about.h mainwindow.h + samplingbar.h sigsession.h sigview.h ) diff --git a/mainwindow.cpp b/mainwindow.cpp index 10ef3013..04f852d9 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -28,6 +28,7 @@ extern "C" { #include "mainwindow.h" #include "ui_mainwindow.h" +#include "samplingbar.h" #include "sigview.h" extern "C" { @@ -46,6 +47,9 @@ MainWindow::MainWindow(QWidget *parent) : { ui->setupUi(this); + _sampling_bar = new SamplingBar(this); + addToolBar(_sampling_bar); + view = new SigView(session, this); ui->verticalLayout->addWidget(view); } diff --git a/mainwindow.h b/mainwindow.h index 1ba4c8e9..3ae04c43 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -25,6 +25,7 @@ #include "sigsession.h" +class SamplingBar; class SigView; namespace Ui { @@ -41,6 +42,9 @@ public: private: Ui::MainWindow *ui; + + SamplingBar *_sampling_bar; + SigSession session; SigView *view; diff --git a/samplingbar.cpp b/samplingbar.cpp new file mode 100644 index 00000000..8159a69a --- /dev/null +++ b/samplingbar.cpp @@ -0,0 +1,26 @@ +/* + * This file is part of the sigrok project. + * + * Copyright (C) 2012 Joel Holdsworth + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "samplingbar.h" + +SamplingBar::SamplingBar(QWidget *parent) : + QToolBar("Sampling Bar", parent) +{ +} diff --git a/samplingbar.h b/samplingbar.h new file mode 100644 index 00000000..ca6a0921 --- /dev/null +++ b/samplingbar.h @@ -0,0 +1,34 @@ +/* + * This file is part of the sigrok project. + * + * Copyright (C) 2012 Joel Holdsworth + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef SAMPLINGBAR_H +#define SAMPLINGBAR_H + +#include + +class SamplingBar : public QToolBar +{ + Q_OBJECT + +public: + SamplingBar(QWidget *parent); +}; + +#endif // SAMPLINGBAR_H