-
Notifications
You must be signed in to change notification settings - Fork 46
/
tab_raw.cpp
58 lines (49 loc) · 1.25 KB
/
tab_raw.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include "tab_raw.h"
#include <QPushButton>
#include <QFont>
#include <QPushButton>
#include <QWidget>
#include <QCheckBox>
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
#include <qwt_plot_grid.h>
#include <qwt_legend.h>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QThread>
#include <QStatusBar>
#include <QTreeWidget>
#include <QTabWidget>
#include <QTextEdit>
#include <QLabel>
#include <QLineEdit>
TabRaw::TabRaw(QWidget* parent): QWidget(parent)
{
QVBoxLayout *layout = new QVBoxLayout;
edit=new QTextEdit("",this);
edit->setReadOnly(true);
layout->addWidget(edit);
//layout->addWidget(slider);
QHBoxLayout *hlayout = new QHBoxLayout;
hlayout->addWidget(new QLabel("Send:",this));
sendText= new QLineEdit("",this);
hlayout->addWidget(sendText);
btClear=new QPushButton("clear",this);
hlayout->addWidget(btClear);
layout->addLayout(hlayout);
setLayout(layout);
}
void TabRaw::displayText(const QString& text)
{
edit->moveCursor(QTextCursor::End);
edit->insertPlainText(text);
if(!edit->underMouse())
edit->ensureCursorVisible();
}
void TabRaw::displayTextHtml(const QString& text)
{
edit->moveCursor(QTextCursor::End);
edit->insertHtml(text);
if(!edit->underMouse())
edit->ensureCursorVisible();
}