Guest User

Untitled

a guest
Feb 20th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. #include "studentbrowser.h"
  2. #include <QBoxLayout>
  3.  
  4. StudentBrowser::StudentBrowser(QWidget *parent) :
  5. QMainWindow(parent)
  6. {
  7. this->createView();
  8. this->createActions();
  9. this->createMenu();
  10. }
  11.  
  12. void StudentBrowser::createView() {
  13. this->hLayout = new QHBoxLayout();
  14. this->vLayout = new QVBoxLayout();
  15. this->buttonLayout = new QHBoxLayout;
  16.  
  17. this->firstNameLabel = new QLabel("Etunimi");
  18. this->lastNameLabel = new QLabel("Sukunimi");
  19. this->gradeLabel = new QLabel("Arvosana: ");
  20. this->grade = new QLabel("5");
  21. this->cw = new QWidget();
  22.  
  23. this->next = new QPushButton(">>");
  24. this->previous = new QPushButton("<<");
  25. vLayout->addWidget(this->firstNameLabel);
  26. vLayout->addWidget(this->lastNameLabel);
  27. hLayout->addWidget(this->gradeLabel);
  28. hLayout->addWidget(this->grade);
  29. hLayout->addStretch(0);
  30.  
  31. buttonLayout->addWidget((this->previous));
  32. buttonLayout->addWidget(this->next);
  33.  
  34. //Asetetaan centralwidgetille layout
  35. vLayout->addLayout(hLayout);
  36. vLayout->addLayout(buttonLayout);
  37. cw->setLayout(vLayout);
  38. //cw->setLayout(hLayout);
  39.  
  40.  
  41. //asettaa mainwindow oliolle keskuwidget
  42. this->setCentralWidget(cw);
  43. }
  44.  
  45. void StudentBrowser::createActions(){
  46.  
  47. }
  48.  
  49. void StudentBrowser::createMenu(){
  50.  
  51. }
Add Comment
Please, Sign In to add comment