#ifndef MAINWINDOW_H#define MAINWINDOW_H#include <QMainWindow>#include <QtGui>namespace Ui { class MainWindow;}class MainWindow : public QMainWindow{ Q_OBJECTpublic: explicit MainWindow(QWidget *parent = 0); ~MainWindow();private: QTabWidget *tab; QLabel *lbl1; QLabel *lbl2; QLabel *lbl3; QVBoxLayout *vbxVerticalLayout; QTableWidget tblA; QTableWidget tblB; QLabel *lblN; QLineEdit *leN; QPushButton *pbFill; QPushButton *pbCalc;public slots: void setRange(QString); void fillTest(); void Calculation();};#endif // MAINWINDOW_H
#include "mainwindow.h"#include "ui_mainwindow.h"#include <QtGui>MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){ tab = new QTabWidget; lbl1 = new QLabel("Equation"); lbl2 = new QLabel("System of equation"); lbl3 = new QLabel("Root of m"); QHBoxLayout *hbxToolLayout = new QHBoxLayout; QHBoxLayout *hbxTableLayout = new QHBoxLayout; vbxVerticalLayout = new QVBoxLayout; lblN = new QLabel("Vvedite razmernost' matrici"); leN = new QLineEdit; pbFill = new QPushButton("TestFill"); pbCalc = new QPushButton("Calculation"); tblA.setRowCount(3); tblA.setColumnCount(3); leN->setText("3"); tblB.setRowCount(3); tblB.setColumnCount(1); hbxToolLayout->addWidget(lblN); hbxToolLayout->addWidget(leN); hbxToolLayout->addWidget(pbFill); hbxToolLayout->addWidget(pbCalc); hbxTableLayout->addWidget(&tblA); hbxTableLayout->addWidget(&tblB); vbxVerticalLayout->addLayout(hbxToolLayout); vbxVerticalLayout->addLayout(hbxTableLayout); tblA.horizontalHeader()->setResizeMode(0, QHeaderView::Stretch); tab->addTab(lbl1, "Equation"); tab->addTab(vbxVerticalLayout, "System of equation"); tab->addTab(lbl3, "Root of M"); tab->resize(500, 200); setCentralWidget(tab); resize(tab->size());}MainWindow::~MainWindow(){//}