-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdauseterminal.cpp
More file actions
28 lines (22 loc) · 843 Bytes
/
dauseterminal.cpp
File metadata and controls
28 lines (22 loc) · 843 Bytes
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
#include "dauseterminal.h"
DauseTerminal::DauseTerminal(QWidget *parent) : QWidget(parent) {
setMinimumSize(MIN_TERM_WIDTH, MIN_TERM_HEIGHT);
setAutoFillBackground(true);
setAttribute(Qt::WA_OpaquePaintEvent, true);
setAttribute(Qt::WA_NoSystemBackground, false);
setAttribute(Qt::WA_StyledBackground, true);
setStyleSheet(TERMINAL_STYLE);
m_terminal = new QTermWidget(0, this);
m_terminal->setStyleSheet("QTermWidget { border: none; }");
QVBoxLayout *layout = new QVBoxLayout(this);
layout->setContentsMargins(3, 3, 3, 3);
layout->setSpacing(0);
layout->addWidget(m_terminal);
setLayout(layout);
}
void DauseTerminal::paintEvent(QPaintEvent *event) {
QStyleOption opt;
opt.initFrom(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}