-
Notifications
You must be signed in to change notification settings - Fork 6
/
editremarkdialog.cpp
68 lines (54 loc) · 1.94 KB
/
editremarkdialog.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include "editremarkdialog.h"
#include "ui_editremarkdialog.h"
#include "goopal.h"
EditRemarkDialog::EditRemarkDialog(QString remark, QWidget *parent) :
QDialog(parent),
ui(new Ui::EditRemarkDialog)
{
ui->setupUi(this);
// Goopal::getInstance()->appendCurrentDialogVector(this);
setParent(Goopal::getInstance()->mainFrame);
setAttribute(Qt::WA_TranslucentBackground, true);
setWindowFlags(Qt::FramelessWindowHint);
ui->widget->setObjectName("widget");
ui->widget->setStyleSheet("#widget {background-color:rgba(10, 10, 10,100);}");
ui->containerWidget->setObjectName("containerwidget");
ui->containerWidget->setStyleSheet("#containerwidget{background-color: rgb(246, 246, 246);border:1px groove rgb(180,180,180);}");
ui->okBtn->setStyleSheet("QToolButton{background-color:#4dc8cf;color:#ffffff;border:0px solid rgb(64,153,255);border-radius:3px;}"
"QToolButton:hover{background-color:#7dd9df;}");
ui->remarkLineEdit->setText( remark);
ui->remarkLineEdit->setStyleSheet("color:black;border:1px solid #CCCCCC;border-radius:3px;");
ui->remarkLineEdit->setTextMargins(8,0,0,0);
ui->remarkLineEdit->setFocus();
}
EditRemarkDialog::~EditRemarkDialog()
{
delete ui;
// Goopal::getInstance()->removeCurrentDialogVector(this);
}
void EditRemarkDialog::on_okBtn_clicked()
{
close();
// emit accepted();
}
QString EditRemarkDialog::pop()
{
// QEventLoop loop;
// show();
// ui->remarkLineEdit->grabKeyboard();
// connect(this,SIGNAL(accepted()),&loop,SLOT(quit()));
// loop.exec(); //进入事件 循环处理,阻塞
move(0,0);
exec();
return ui->remarkLineEdit->text();
}
void EditRemarkDialog::on_remarkLineEdit_textChanged(const QString &arg1)
{
QString remark = arg1;
if( remark.contains("=") || remark.contains(";"))
{
remark.remove("=");
remark.remove(";");
ui->remarkLineEdit->setText( remark);
}
}