-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsellorderwidget.cpp
More file actions
39 lines (29 loc) · 888 Bytes
/
sellorderwidget.cpp
File metadata and controls
39 lines (29 loc) · 888 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
39
#include "sellorderwidget.h"
SellOrderWidget::SellOrderWidget(QWidget *parent) :
QWidget(parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout();
QLabel *wLabel = new QLabel("What amount?");
m_weightLineEdit = new QLineEdit();
QPushButton *okButton = new QPushButton("OK");
mainLayout->addWidget(wLabel);
mainLayout->addWidget(m_weightLineEdit);
mainLayout->addWidget(okButton);
this->setLayout(mainLayout);
this->setWindowFlags(Qt::Dialog);
connect(okButton, SIGNAL(clicked()), this, SLOT(onOKButtonClick()));
}
void SellOrderWidget::setIsAdding(bool _isAdding)
{
m_isAdding = _isAdding;
}
void SellOrderWidget::showEvent(QShowEvent *)
{
m_weightLineEdit->clear();
m_weightLineEdit->setFocus();
}
void SellOrderWidget::onOKButtonClick()
{
emit amount(m_weightLineEdit->text().toInt(), m_isAdding);
this->close();
}