Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <authorization.hpp>
- Authorization::Authorization(Authorization* parent): QWidget(parent) {
- /**
- * Create the common widget for next objects
- */
- this->setFixedSize(QApplication::desktop()->width(), QApplication::desktop()->height());
- /**
- * Create header label
- */
- QLabel* plbl = new QLabel("MuseumQuest");
- plbl->setFixedSize(QApplication::desktop()->width(), QApplication::desktop()->height()/100*10);
- QPalette plt;
- plt.setColor(plbl->backgroundRole(), gray);
- plbl->setPalette(plt);
- plbl->setAutoFillBackground(true);
- plbl->setStyleSheet("color: black;");
- plbl->setAlignment(AlignCenter);
- /**
- * Create label for Authoriztion
- */
- QLabel* plbl2 = new QLabel("Регистрация");
- plbl2->setFixedWidth(QApplication::desktop()->width()/100*53);
- plbl2->setAlignment(AlignCenter);
- plbl2->setStyleSheet("color: black;");
- /**
- * Create input field for name
- */
- QLineEdit* pline1 = new QLineEdit;
- pline1->setObjectName("Name");
- pline1->setPlaceholderText("Введите ваше имя");
- pline1->setStyleSheet("border: none; border-bottom: 1px solid black; background-color: transparent;");
- pline1->setFixedWidth(QApplication::desktop()->width()/100*48);
- /**
- * Create input field for password
- */
- QLineEdit* pline2 = new QLineEdit;
- pline2->setObjectName("Password");
- pline2->setPlaceholderText("Введите пароль");
- pline2->setEchoMode(QLineEdit::Password);
- pline2->setFixedWidth(QApplication::desktop()->width()/100*48);
- pline2->setStyleSheet("border: none; border-bottom: 1px solid black; background-color: transparent;");
- /**
- * Create the button
- */
- QPushButton* pbtn = new QPushButton("Зарегистрироваться");
- pbtn->setFixedSize(QApplication::desktop()->width()/100*60, QApplication::desktop()->height()/100*6);
- pbtn->setCursor(PointingHandCursor);
- pbtn->setObjectName("Signing up");
- pbtn->setStyleSheet("background-color: gray; color: black; border-radius: 20px;");
- /**
- * Create the last label
- */
- QLabel* plbl3 = new QLabel("Войти в аккаунт");
- plbl3->setFixedWidth(QApplication::desktop()->width());
- plbl3->setAlignment(AlignCenter);
- plbl3->setCursor(PointingHandCursor);
- plbl3->setStyleSheet("color: black;");
- /**
- * Create layout
- */
- QVBoxLayout* pvbox = new QVBoxLayout;
- pvbox->setContentsMargins(0, 0, 0, 0);
- pvbox->addWidget(plbl, 0, AlignCenter);
- pvbox->addSpacing(QApplication::desktop()->height()/100*6);
- pvbox->addWidget(plbl2, 0, AlignCenter);
- pvbox->addSpacing(QApplication::desktop()->height()/100*7);
- pvbox->addWidget(pline1, 0, AlignCenter);
- pvbox->addSpacing(QApplication::desktop()->height()/100*7);
- pvbox->addWidget(pline2, 0, AlignCenter);
- pvbox->addSpacing(QApplication::desktop()->height()/100*13);
- pvbox->addWidget(pbtn, 0, AlignCenter);
- pvbox->addSpacing(QApplication::desktop()->height()/100*7);
- pvbox->addWidget(plbl3, 0, AlignCenter);
- pvbox->setAlignment(AlignTop | AlignHCenter);
- this->setLayout(pvbox);
- /**
- * Create connection to the server
- */
- Client client(pline1, pline2);
- connect(pbtn, SIGNAL(clicked()), &client, SLOT(slotSendToServer()));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement