radixnavigationwidget.cc 1.26 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
/*
 * @file:   mainwindow.cpp
 * @author: Jordan P. Lefebvre, lefebvrejp@ornl.gov
 *
 * Created on May 31, 2016, 10:52 PM
 */

#include "radixnavigationwidget.hh"
#include <QApplication>
#include <QGridLayout>
#include <QLabel>
#include <limits>
13
14
#include "radixwidgets/navigationitem.hh"
#include "radixwidgets/navigationmodel.hh"
15
#include "radixwidgets/navigationwidget.hh"
16
using namespace radix;
17

18
MainWindow::MainWindow(QWidget* parent)
19
20
21
22
    : QMainWindow(parent)
{
  setGeometry(400, 250, 542, 390);

23
  mWidget = new NavigationWidget(this);
24

25
26
27
28
29
  NavigationModel* model = mWidget->navigationModel();
  NavigationItem* root   = model->rootItem();
  auto hello             = model->addItem("Hello", root);
  auto world             = model->addItem("World", root);
  auto hidden_beneath    = model->addItem("Hidden beneath", world);
30
31
32
33
34
35
36
37
38
  setCentralWidget(mWidget);
}

MainWindow::~MainWindow() {}

/******************************************************************************/
/******************************** MAIN PROGRAM ********************************/
/******************************************************************************/

39
int main(int argc, char** argv)
40
41
42
43
44
45
46
47
{
  QApplication app(argc, argv);
  MainWindow mainWindow;
  mainWindow.show();
  mainWindow.raise();

  return app.exec();
}