]> Shamusworld >> Repos - architektonas/blob - src/blockwidget.cpp
Initial work on BlockWidget.
[architektonas] / src / blockwidget.cpp
1 // blockwidget.cpp: Block add/remove/use widget
2 //
3 // Part of the Architektonas Project
4 // (C) 2011 Underground Software
5 // See the README and GPLv3 files for licensing and warranty information
6 //
7 // JLH = James Hammons <jlhamm@acm.org>
8 //
9 // WHO  WHEN        WHAT
10 // ---  ----------  ------------------------------------------------------------
11 // JLH  07/15/2013  Created this file
12 //
13
14 #include "blockwidget.h"
15 #include "blockitemwidget.h"
16
17
18 BlockWidget::BlockWidget(void): QWidget()
19 {
20         BlockItemWidget * biw1 = new BlockItemWidget("2x4");
21         BlockItemWidget * biw2 = new BlockItemWidget("2x6");
22         BlockItemWidget * biw3 = new BlockItemWidget("36\" door RHS");
23         BlockItemWidget * biw4 = new BlockItemWidget("36\" door LHS");
24         BlockItemWidget * biw5 = new BlockItemWidget("Person");
25
26         QListWidget * qlw = new QListWidget;
27         QListWidgetItem * qli1 = new QListWidgetItem(qlw);
28         QListWidgetItem * qli2 = new QListWidgetItem(qlw);
29         QListWidgetItem * qli3 = new QListWidgetItem(qlw);
30         QListWidgetItem * qli4 = new QListWidgetItem(qlw);
31         QListWidgetItem * qli5 = new QListWidgetItem(qlw);
32         qli1->setSizeHint(biw1->sizeHint());
33         qli2->setSizeHint(biw2->sizeHint());
34         qli3->setSizeHint(biw3->sizeHint());
35         qli4->setSizeHint(biw4->sizeHint());
36         qli5->setSizeHint(biw5->sizeHint());
37         qlw->setItemWidget(qli1, biw1);
38         qlw->setItemWidget(qli2, biw2);
39         qlw->setItemWidget(qli3, biw3);
40         qlw->setItemWidget(qli4, biw4);
41         qlw->setItemWidget(qli5, biw5);
42
43         QPushButton * pb1 = new QPushButton("+");
44         QPushButton * pb2 = new QPushButton("-");
45         QPushButton * pb3 = new QPushButton("Edit");
46         QPushButton * pb4 = new QPushButton("Import");
47 //      QPushButton * pb5 = new QPushButton("v");
48
49         QHBoxLayout * hbox1 = new QHBoxLayout;
50         hbox1->addWidget(pb1);
51         hbox1->addWidget(pb2);
52         hbox1->addWidget(pb3);
53         hbox1->addWidget(pb4);
54 //      hbox1->addWidget(pb5);
55         hbox1->addStretch();
56
57         QVBoxLayout * mainLayout = new QVBoxLayout;
58         mainLayout->addWidget(qlw);
59         mainLayout->addLayout(hbox1);
60
61         setLayout(mainLayout);
62 }
63
64
65 BlockWidget::~BlockWidget()
66 {
67 }
68