#include <libsigrokdecode/libsigrokdecode.h>
#include <QMenu>
+#include <QToolBar>
#include <QVBoxLayout>
#include "view.hpp"
namespace views {
namespace decoder_output {
-View::View(Session &session, bool is_main_view, QWidget *parent) :
+View::View(Session &session, bool is_main_view, QMainWindow *parent) :
ViewBase(session, is_main_view, parent)
// Note: Place defaults in View::reset_view_state(), not here
QVBoxLayout *root_layout = new QVBoxLayout(this);
root_layout->setContentsMargins(0, 0, 0, 0);
+ QToolBar* tool_bar = new QToolBar();
+ tool_bar->setContextMenuPolicy(Qt::PreventContextMenu);
+
+ parent->addToolBar(tool_bar);
+
reset_view_state();
}
Q_OBJECT
public:
- explicit View(Session &session, bool is_main_view=false, QWidget *parent = nullptr);
+ explicit View(Session &session, bool is_main_view=false, QMainWindow *parent = nullptr);
~View();
}
}
-View::View(Session &session, bool is_main_view, QWidget *parent) :
+View::View(Session &session, bool is_main_view, QMainWindow *parent) :
ViewBase(session, is_main_view, parent),
// Note: Place defaults in View::reset_view_state(), not here
static const int ScaleUnits[3];
public:
- explicit View(Session &session, bool is_main_view=false, QWidget *parent = nullptr);
+ explicit View(Session &session, bool is_main_view=false, QMainWindow *parent = nullptr);
~View();
const int ViewBase::MaxViewAutoUpdateRate = 25; // No more than 25 Hz
-ViewBase::ViewBase(Session &session, bool is_main_view, QWidget *parent) :
+ViewBase::ViewBase(Session &session, bool is_main_view, QMainWindow *parent) :
// Note: Place defaults in ViewBase::reset_view_state(), not here
QWidget(parent),
session_(session),
#include <unordered_set>
#include <vector>
+#include <QMainWindow>
#include <QTimer>
#include <QWidget>
static const int MaxViewAutoUpdateRate;
public:
- explicit ViewBase(Session &session, bool is_main_view = false, QWidget *parent = nullptr);
+ explicit ViewBase(Session &session, bool is_main_view = false, QMainWindow *parent = nullptr);
/**
* Resets the view to its default state after construction. It does however