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
|
#include "customerAddLayout.h"
CustomerAddLayout::CustomerAddLayout() {
name = new QLabel("Vardas:", this);
lastname = new QLabel("Pavarde:", this);
address = new QLabel("Gyvenamoji vieta:", this);
ID = new QLabel("Asmens kodas: ", this);
phoneNr = new QLabel("Tel. numeris:", this);
nameEdit = new QLineEdit(this);
lastnameEdit = new QLineEdit(this);
addressEdit = new QLineEdit(this);
phoneNrEdit = new QLineEdit(this);
IDedit = new QLineEdit(this);
addCustomerButton = new QPushButton("Prideti pirkeja", this);
grid = new QGridLayout();
setCustomerAddLayout();
}
void CustomerAddLayout::setCustomerAddLayout() {
grid->addWidget(name, 0, 0);
grid->addWidget(nameEdit, 0, 1, 1, 10);
grid->addWidget(lastname, 1, 0);
grid->addWidget(lastnameEdit, 1, 1, 1, 10);
grid->addWidget(address, 2, 0);
grid->addWidget(addressEdit, 2, 1, 1, 10);
grid->addWidget(ID, 3, 0);
grid->addWidget(IDedit, 3, 1, 1, 10);
grid->addWidget(phoneNr, 4, 0);
grid->addWidget(phoneNrEdit, 4, 1, 1, 10);
grid->addWidget(addCustomerButton, 6, 9, 1, 2);
}
QVBoxLayout *CustomerAddLayout::returnCustomerLayout() {
QVBoxLayout *vbox = new QVBoxLayout;
vbox->addLayout(grid);
return vbox;
}
|