-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtextdialog.cpp
More file actions
32 lines (25 loc) · 865 Bytes
/
Copy pathtextdialog.cpp
File metadata and controls
32 lines (25 loc) · 865 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
29
30
31
32
#include "textdialog.h"
TextDialog::TextDialog(QWidget *parent): QDialog(parent)
{
setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint);
setWindowTitle("Добавить надпись");
setWindowIcon(QIcon(":/images/logo.png"));
setFixedSize(300, 150);
QFont tmp_font = label.font();
tmp_font.setPixelSize(15);
setFont(tmp_font);
label.setText("Введите текст надписи");
ok_button.setText("ОК");
exit_button.setText("Отмена");
layout.addWidget(&label);
layout.addWidget(&edit);
layout.addWidget(&ok_button);
layout.addWidget(&exit_button);
setLayout(&layout);
connect(&ok_button, SIGNAL(clicked()), SLOT(accept()));
connect(&exit_button, SIGNAL(clicked()), SLOT(reject()));
}
QString TextDialog::getText() const
{
return edit.text();
}