-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcreateusers.cpp
More file actions
38 lines (33 loc) · 872 Bytes
/
createusers.cpp
File metadata and controls
38 lines (33 loc) · 872 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
33
34
35
36
37
38
#include "createusers.h"
#include "ui_createusers.h"
#include <QPainter>
createUsers::createUsers(QWidget *parent) :
QWidget(parent),
ui(new Ui::createUsers)
{
ui->setupUi(this);
connect(ui->exitButton, SIGNAL(clicked()), this, SLOT(hide()));
connect(ui->okButton, SIGNAL(clicked()), this, SLOT(sendUser()));
}
createUsers::~createUsers()
{
delete ui;
}
void createUsers::paintEvent(QPaintEvent *e)
{
QPainter painter(this);
painter.drawPixmap(0, 0, QPixmap(":/new/prefix1/peachColor.png").scaled(size()));
QWidget::paintEvent(e);
}
void createUsers::sendUser()
{
QString userName = ui->nameEdit->toPlainText();
bool fl = false;
for (int i = 0; i < userName.size(); ++i)
if (userName[i].toLatin1() != ' ')
fl = true;
if (fl){
ui->nameEdit->setText("");
emit newUser(userName);
}
}