Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "solution.h"
- #include <QApplication>
- #include <QWidget>
- #include <QLabel>
- #include <QPushButton>
- #include <QRadioButton>
- #include <QCheckBox>
- #include <QGridLayout>
- #include <QVBoxLayout>
- #include <QHBoxLayout>
- #include <QLineEdit>
- #include <QTextEdit>
- int main(int argc, char *argv[])
- {
- QApplication app(argc, argv);
- Widget wgt_1;
- QLabel* lbl_XVal = new QLabel("X value");
- QLabel* lbl_YVal = new QLabel("Y value");
- QLabel* lbl_f1 = new QLabel("cos(x)");
- QLabel* lbl_f2 = new QLabel("sin(x)");
- QLabel* lbl_f3 = new QLabel("hyinus(x)");
- QLabel* lbl_min = new QLabel("min");
- QLabel* lbl_max = new QLabel("max");
- QLabel* lbl_res = new QLabel("Results");
- QLineEdit* lEd_XVal = new QLineEdit;
- QLineEdit* lEd_YVal = new QLineEdit;
- QTextEdit* tEd_res = new QTextEdit;
- QRadioButton* rBt_f1 = new QRadioButton;
- QRadioButton* rBt_f2 = new QRadioButton;
- QRadioButton* rBt_f3 = new QRadioButton;
- QCheckBox* chB_min = new QCheckBox;
- QCheckBox* chB_max = new QCheckBox;
- QPushButton* pBt_eval = new QPushButton("Evaluate");
- QPushButton* pBt_close = new QPushButton("Close");
- QGridLayout* grLay_input = new QGridLayout;
- grLay_input->setMargin(5);
- grLay_input->setSpacing(10);
- grLay_input->addWidget(lbl_XVal, 0, 0);
- grLay_input->addWidget(lbl_YVal, 2, 0);
- grLay_input->addWidget(lEd_XVal, 0, 1);
- grLay_input->addWidget(lEd_YVal, 2, 1);
- QGridLayout* grLay_func = new QGridLayout;
- grLay_func->setMargin(5);
- grLay_func->setSpacing(10);
- grLay_func->addWidget(lbl_f1, 0, 0);
- grLay_func->addWidget(lbl_f2, 1, 0);
- grLay_func->addWidget(lbl_f3, 2, 0);
- grLay_func->addWidget(rBt_f1, 0, 1);
- grLay_func->addWidget(rBt_f2, 1, 1);
- grLay_func->addWidget(rBt_f3, 2, 1);
- QHBoxLayout* hbLay_layOne = new QHBoxLayout;
- hbLay_layOne->setMargin(5);
- hbLay_layOne->setSpacing(10);
- hbLay_layOne->addLayout(grLay_input);
- hbLay_layOne->addLayout(grLay_func);
- QHBoxLayout* hbLay_ext = new QHBoxLayout;
- hbLay_ext->setMargin(5);
- hbLay_ext->setSpacing(10);
- hbLay_ext->addWidget(lbl_min);
- hbLay_ext->addWidget(chB_min);
- hbLay_ext->addWidget(lbl_max);
- hbLay_ext->addWidget(chB_max);
- QHBoxLayout* hbLay_res = new QHBoxLayout;
- hbLay_res->setMargin(5);
- hbLay_res->setSpacing(10);
- hbLay_res->addWidget(lbl_res);
- hbLay_res->addWidget(tEd_res);
- QHBoxLayout* hbLay_btn = new QHBoxLayout;
- hbLay_btn->setMargin(5);
- hbLay_btn->setSpacing(10);
- hbLay_btn->addWidget(pBt_eval);
- hbLay_btn->addWidget(pBt_close);
- QVBoxLayout* vbLay_layOne = new QVBoxLayout;
- vbLay_layOne->setMargin(5);
- vbLay_layOne->setSpacing(10);
- vbLay_layOne->addLayout(hbLay_layOne);
- vbLay_layOne->addLayout(hbLay_ext);
- vbLay_layOne->addLayout(hbLay_res);
- vbLay_layOne->addLayout(hbLay_btn);
- wgt_1.setLayout(vbLay_layOne);
- wgt_1.show();
- return app.exec();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement