GNU Radio's DISPLAY Package
show_text.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2022 Volker Schroer, DL1KSV
4 *
5 * SPDX-License-Identifier: GPL-3.0-or-later
6 *
7 */
8
9#ifndef INCLUDED_DISPLAY_SHOW_TEXT_H
10#define INCLUDED_DISPLAY_SHOW_TEXT_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/sync_block.h>
20#include <display/api.h>
21
22#include <QWidget>
23
24#include <string>
25
26// class QApplication;
27
28namespace gr {
29namespace display {
30
31/*!
32 * \brief Create a QT Text sink, where the values are received as stream.
33 * \ingroup display
34 *
35 * \details
36 * This is a QT-based graphical sink that display simply ascii text in a scrollable
37 * window
38 */
39class DISPLAY_API show_text : virtual public sync_block
40{
41public:
42 typedef std::shared_ptr<show_text> sptr;
43
44 /*!
45 * \brief Build a graphical sink to display ascii text
46 *
47 * \param label Header text of the window
48 * usefull if using several windows
49 * \param splitlength enter newline after splitlength
50 * characters without newline
51 * \param maxlines maximum number of lines that
52 * can be displayed in the scrollarea
53 * \param parent a QWidget parent in the QT app.
54 */
55 static sptr make(const std::string& label,
56 int splitlength = 80,
57 int maxlines = 100,
58 QWidget* parent = nullptr);
59 virtual QWidget* qwidget() = 0;
60 virtual void exec_() = 0;
61};
62
63} // namespace display
64} // namespace gr
65
66#endif /* INCLUDED_DISPLAY_SHOW_TEXT_H */
#define DISPLAY_API
Definition api.h:30
Create a QT Text sink, where the values are received as stream.
Definition show_text.h:40
virtual QWidget * qwidget()=0
static sptr make(const std::string &label, int splitlength=80, int maxlines=100, QWidget *parent=nullptr)
Build a graphical sink to display ascii text.
virtual void exec_()=0
std::shared_ptr< show_text > sptr
Definition show_text.h:42
Definition display_text_msg.h:27
Definition display_text_msg.h:26