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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
MainWindow::MainWindow()
{
centre = new QWidget;
layFenetre = new QVBoxLayout;
tab = new QTabWidget;
//STOCK
QWidget *stock = new QWidget;
QHBoxLayout *layStock = new QHBoxLayout;
QTableWidget *table = new QTableWidget(0, 6);
QStringList titre;
titre << "Code Article" << "Article" << "Quantité" << "Prix Unitaire" << "Montant Total" << "Famille";
table->setHorizontalHeaderLabels(titre);
layStock->addWidget(table);
stock->setLayout(layStock);
//ENTREES
QWidget *entree = new QWidget;
QLineEdit *lineFournisseurE = new QLineEdit;
QLineEdit *lineNumCommandeE = new QLineEdit;
QLineEdit *lineCodeArticleE = new QLineEdit;
QLineEdit *lineArticleE = new QLineEdit;
QSpinBox *spinQuantiteeE = new QSpinBox;
spinQuantiteeE->setAccelerated(true);
spinQuantiteeE->setRange(0, 999999);
QSpinBox *spinPrixUE = new QSpinBox;
spinPrixUE->setAccelerated(true);
spinPrixUE->setRange(0, 999999);
spinPrixUE->setSuffix(" ");
QLineEdit *linePrixTotalE = new QLineEdit;
QComboBox *comboFamilleE = new QComboBox;
comboFamilleE->addItem("Fer");
comboFamilleE->addItem("Electricité");
QPushButton *btAjouterStock = new QPushButton("Ajouter au stock");
QFormLayout *layEntree = new QFormLayout;
layEntree->addRow("Fournisseur: ", lineFournisseurE);
layEntree->addRow("N° Commande: ", lineNumCommandeE);
layEntree->addRow("Code Article: ", lineCodeArticleE);
layEntree->addRow("Article: ", lineArticleE);
layEntree->addRow("Quantité: ", spinQuantiteeE);
layEntree->addRow("Prix Unitaire: ", spinPrixUE);
layEntree->addRow("Prix Total: ", linePrixTotalE);
layEntree->addRow("Famille: ", comboFamilleE);
layEntree->addRow(btAjouterStock);
entree->setLayout(layEntree);
//SORTIES
QWidget *sortie = new QWidget;
QLineEdit *lineCodeArticleS = new QLineEdit;
QLineEdit *lineArticleS = new QLineEdit;
QSpinBox *spinQuantiteeS = new QSpinBox;
spinQuantiteeS->setAccelerated(true);
spinQuantiteeS->setRange(0, 999999);
QComboBox *comboFamilleS = new QComboBox;
comboFamilleS->addItem("Fer");
comboFamilleS->addItem("Electricité");
QLineEdit *lineBatimentS = new QLineEdit;
QPushButton *btSortie = new QPushButton("Sortie");
QFormLayout *laySortie = new QFormLayout;
laySortie->addRow("Code Article: ", lineCodeArticleS);
laySortie->addRow("Article: ", lineArticleS);
laySortie->addRow("Quantité: ", spinQuantiteeS);
laySortie->addRow("Famille: ", comboFamilleS);
laySortie->addRow("Batiment: ", lineBatimentS);
laySortie->addRow(btSortie);
sortie->setLayout(laySortie);
//On ajoute les onglets
tab->addTab(stock, "Stock");
tab->addTab(entree, "Entrées");
tab->addTab(sortie, "Sortie");
//On ajoute les onglets au layout principal
layFenetre->addWidget(tab);
//On met le layout principal sur le widget central
centre->setLayout(layFenetre);
//On met le Widget qui contient le centre au centre
setCentralWidget(centre); |
Partager