-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
infos.cpp
45 lines (40 loc) · 1.08 KB
/
infos.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
#include "infos.h"
#include "ui_infos.h"
#include <QLabel>
#include <QLineEdit>
#include <QPainter>
QString Infos::InfoData;
Infos::Infos(QWidget *parent) :
QDialog(parent),
ui(new Ui::Infos)
{
ui->setupUi(this);
this->setAccessibleName("Infos");
this->setWindowTitle("Infos");
}
void Infos::showEvent(QShowEvent *event)
{
// ui->label->setText(InfoData);
QStringList Infos = InfoData.split("\n");
Infos.removeAt(0);
foreach (QString InfosData, Infos) {
QStringList Data = InfosData.split(": ");
QLabel *Name = new (QLabel);
Name->setText(Data.at(0));
// Name->setParent(ui->formLayout);
QLineEdit *Value = new (QLineEdit);
Value->setText(Data.at(1));
Value->setDragEnabled(true);
Value->setMouseTracking(true);
Value->setAcceptDrops(true);
// Value->setParent(ui->formLayoutWidget);
ui->formLayout->addRow(Name,Value);
Name->setVisible(true);
Value->setVisible(true);
}
resize(ui->formLayout->sizeHint());
}
Infos::~Infos()
{
delete ui;
}