#include <QColor>
#include <QFormLayout>
#include <QLineEdit>
+#include <QMenu>
#include <libsigrok/libsigrok.hpp>
return popup;
}
+QMenu* Flag::create_context_menu(QWidget *parent)
+{
+ QMenu *const menu = new QMenu(parent);
+
+ QAction *const del = new QAction(tr("Delete"), this);
+ del->setShortcuts(QKeySequence::Delete);
+ connect(del, SIGNAL(triggered()), this, SLOT(on_delete()));
+ menu->addAction(del);
+
+ return menu;
+}
+
void Flag::delete_pressed()
+{
+ on_delete();
+}
+
+void Flag::on_delete()
{
view_.remove_flag(shared_ptr<Flag>(shared_from_this()));
}
#include "timemarker.hpp"
+class QMenu;
+
namespace pv {
namespace view {
pv::widgets::Popup* create_popup(QWidget *parent);
+ QMenu* create_context_menu(QWidget *parent);
+
void delete_pressed();
private Q_SLOTS:
+ void on_delete();
+
void on_text_changed(const QString &text);
private: