pv/view/viewitem.cpp
pv/view/viewitempaintparams.cpp
pv/view/viewport.cpp
+ pv/view/viewwidget.cpp
pv/widgets/colourbutton.cpp
pv/widgets/colourpopup.cpp
pv/widgets/popup.cpp
pv/view/view.hpp
pv/view/viewitem.hpp
pv/view/viewport.hpp
+ pv/view/viewwidget.hpp
pv/widgets/colourbutton.hpp
pv/widgets/colourpopup.hpp
pv/widgets/popup.hpp
namespace view {
MarginWidget::MarginWidget(View &parent) :
- QWidget(&parent),
- view_(parent),
+ ViewWidget(parent),
dragging_(false)
{
setAttribute(Qt::WA_NoSystemBackground, true);
#include <memory>
#include <QPoint>
-#include <QWidget>
+
+#include "viewwidget.hpp"
namespace pv {
namespace view {
-class View;
class ViewItem;
-class MarginWidget : public QWidget
+class MarginWidget : public ViewWidget
{
Q_OBJECT
void selection_changed();
protected:
- pv::view::View &view_;
QPoint mouse_point_;
QPoint mouse_down_point_;
std::shared_ptr<ViewItem> mouse_down_item_;
namespace view {
Viewport::Viewport(View &parent) :
- QWidget(&parent),
- view_(parent),
+ ViewWidget(parent),
mouse_down_valid_(false),
pinch_zoom_active_(false)
{
setAttribute(Qt::WA_AcceptTouchEvents, true);
- setMouseTracking(true);
setAutoFillBackground(true);
setBackgroundRole(QPalette::Base);
#define PULSEVIEW_PV_VIEW_VIEWPORT_H
#include <QTimer>
-#include <QWidget>
#include <QTouchEvent>
+#include "viewwidget.hpp"
+
class QPainter;
class QPaintEvent;
class Session;
class View;
-class Viewport : public QWidget
+class Viewport : public ViewWidget
{
Q_OBJECT
void on_signals_moved();
private:
- View &view_;
-
QPoint mouse_down_point_;
double mouse_down_offset_;
bool mouse_down_valid_;
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2014 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * 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 "view.hpp"
+#include "viewwidget.hpp"
+
+namespace pv {
+namespace view {
+
+ViewWidget::ViewWidget(View &parent) :
+ QWidget(&parent),
+ view_(parent)
+{
+}
+
+} // namespace view
+} // namespace pv
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * 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 PULSEVIEW_PV_VIEWWIDGET_H
+#define PULSEVIEW_PV_VIEWWIDGET_H
+
+#include <QWidget>
+
+namespace pv {
+namespace view {
+
+class View;
+
+class ViewWidget : public QWidget
+{
+ Q_OBJECT
+
+protected:
+ ViewWidget(View &parent);
+
+protected:
+ pv::view::View &view_;
+};
+
+} // namespace view
+} // namespace pv
+
+#endif // PULSEVIEW_PV_VIEWWIDGET_H
${PROJECT_SOURCE_DIR}/pv/view/viewitem.cpp
${PROJECT_SOURCE_DIR}/pv/view/viewitempaintparams.cpp
${PROJECT_SOURCE_DIR}/pv/view/viewport.cpp
+ ${PROJECT_SOURCE_DIR}/pv/view/viewwidget.cpp
${PROJECT_SOURCE_DIR}/pv/widgets/colourbutton.cpp
${PROJECT_SOURCE_DIR}/pv/widgets/colourpopup.cpp
${PROJECT_SOURCE_DIR}/pv/widgets/popup.cpp
${PROJECT_SOURCE_DIR}/pv/view/view.hpp
${PROJECT_SOURCE_DIR}/pv/view/viewitem.hpp
${PROJECT_SOURCE_DIR}/pv/view/viewport.hpp
+ ${PROJECT_SOURCE_DIR}/pv/view/viewwidget.hpp
${PROJECT_SOURCE_DIR}/pv/widgets/colourbutton.hpp
${PROJECT_SOURCE_DIR}/pv/widgets/colourpopup.hpp
${PROJECT_SOURCE_DIR}/pv/widgets/popup.hpp