GNU Radio's DISPLAY Package
display_text_msg.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2022 Volker Schroer
4 *
5 * SPDX-License-Identifier: GPL-3.0-or-later
6 *
7 */
8
9#ifndef INCLUDED_DISPLAY_TEXT_MSG_H
10#define INCLUDED_DISPLAY_TEXT_MSG_H
11
12#ifdef ENABLE_PYTHON
13#pragma push_macro("slots")
14#undef slots
15#include "Python.h"
16#pragma pop_macro("slots")
17#endif
18
19#include <gnuradio/block.h>
20#include <display/api.h>
21#include <qapplication.h>
22#include <QWidget>
23
24#include <string>
25
26namespace gr {
27namespace display {
28
29/*!
30 * \brief Create a QT Text box widget (QLabel) where the values are posted as a message.
31 * \ingroup display
32 *
33 * \details
34 * This block creates a QT Text box widget that manages data
35 * through message passing interfaces. It is derived from the
36 * gnuradio Message Edit Box
37 *
38 * Message Ports:
39 *
40 * - text (input):
41 * Accepts text messages to be displayed
42 *
43 */
44class DISPLAY_API text_msg : virtual public block
45{
46public:
47 typedef std::shared_ptr<text_msg> sptr;
48
49 /*!
50 * \brief Constructs the Edit box block.
51 *
52 * \param label Header text of the window
53 * usefull if using several windows
54 * \param message_key name of the message key or empty
55 * \param splitlength enter newline after splitlength
56 * characters without newline
57 * \param maxlines maximum number of lines that
58 * can be displayed in the scrollarea
59 * \param parent a QWidget parent in the QT app.
60 *
61 */
62 static sptr make(const std::string& label,
63 const std::string& message_key,
64 int splitlength = 80,
65 int maxlines = 100,
66 QWidget* parent = nullptr);
67
68 virtual void exec_() = 0;
69 virtual QWidget* qwidget() = 0;
70};
71
72} /* namespace display */
73} /* namespace gr */
74
75#endif /* INCLUDED_DISPLAY_TEXT_MSG_H */
#define DISPLAY_API
Definition api.h:30
Create a QT Text box widget (QLabel) where the values are posted as a message.
Definition display_text_msg.h:45
std::shared_ptr< text_msg > sptr
Definition display_text_msg.h:47
virtual QWidget * qwidget()=0
virtual void exec_()=0
static sptr make(const std::string &label, const std::string &message_key, int splitlength=80, int maxlines=100, QWidget *parent=nullptr)
Constructs the Edit box block.
Definition display_text_msg.h:27
Definition display_text_msg.h:26