Advertisement
Guest User

Untitled

a guest
Jul 13th, 2010
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.09 KB | None | 0 0
  1. //! @author Adam Emil Skoog
  2. //! @date   2010-07-13
  3.  
  4. #include "MainWindow.h"
  5.  
  6. namespace smith
  7.  {
  8.     /**
  9.      * Constructor. Creates the window and its components.
  10.      */
  11.     MainWindow::MainWindow()
  12.     :
  13.     content      (new QWidget),
  14.     layout       (new QGridLayout),
  15.     viewport     (new Viewport(1024,768,this)),
  16.     groupTiles   (new QGroupBox(tr("Tiles"))),
  17.     layoutTiles  (new QVBoxLayout),
  18.     dropdownTiles(new QComboBox)
  19.      {
  20.         // Show the viewport.
  21.         viewport->show();
  22.  
  23.         // Add the viewport to the grid.
  24.         layout->addWidget(viewport,0,0);
  25.  
  26.         // Tile section.
  27.         groupTiles->setLayout(layoutTiles);
  28.         layout->addWidget(groupTiles,0,1);
  29.         dropdownTiles->insertItem(0,"Test 1");
  30.         dropdownTiles->insertItem(1,"Test 2");
  31.         dropdownTiles->insertItem(2,"Test 3");
  32.         layoutTiles->addWidget(dropdownTiles,Qt::AlignTop);
  33.         layoutTiles->addStretch();
  34.  
  35.         // Add the grid to the content.
  36.         content->setLayout(layout);
  37.  
  38.         // Add the content to the window.
  39.         setCentralWidget(content);
  40.  
  41.         // Set the caption.
  42.         setWindowTitle("Regin");
  43.         setWindowState(windowState() | Qt::WindowMaximized);
  44.      }
  45.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement