-
Notifications
You must be signed in to change notification settings - Fork 0
/
CuaSoXemTruoc.cpp
38 lines (28 loc) · 1.17 KB
/
CuaSoXemTruoc.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
#include "CuaSoXemTruoc.h"
CuaSoXemTruoc::CuaSoXemTruoc(const QString &noiDung, QWidget* cuaSoMe) : QDialog(cuaSoMe) {
QLabel *nhanChinh = new QLabel(tr("Nội dung file"));
m_khungHienThi = new QTextEdit(noiDung);
m_khungHienThi->setReadOnly(true);
m_khungHienThi->setWordWrapMode(QTextOption::NoWrap);
QLabel *nhan = new QLabel(tr("Ghi chú (Thông tin này sẽ được bổ sung vào cuối file khi xuất)"));
m_khungGhiChu = new QTextEdit();
m_khungGhiChu->setWordWrapMode(QTextOption::NoWrap);
QVBoxLayout *lopChinh = new QVBoxLayout();
lopChinh->addWidget(nhanChinh);
lopChinh->addWidget(m_khungHienThi);
lopChinh->addWidget(nhan);
lopChinh->addWidget(m_khungGhiChu);
setLayout(lopChinh);
setWindowIcon(QIcon(":/icons/icons/Documents.png"));
setWindowTitle(tr("Nhật kí theo dõi"));
setMinimumSize(300, 400);
}
QString CuaSoXemTruoc::noiDungHienThi() const {
return m_khungHienThi->toPlainText();
}
void CuaSoXemTruoc::setNoiDungHienThi(const QString &noiDung) {
m_khungHienThi->setPlainText(noiDung);
}
QString CuaSoXemTruoc::ghiChu() const {
return m_khungGhiChu->toPlainText();
}