1 // blockwidget.cpp: Block add/remove/use widget
3 // Part of the Architektonas Project
4 // (C) 2011 Underground Software
5 // See the README and GPLv3 files for licensing and warranty information
7 // JLH = James Hammons <jlhamm@acm.org>
10 // --- ---------- ------------------------------------------------------------
11 // JLH 07/15/2013 Created this file
14 #include "blockwidget.h"
15 #include "blockitemwidget.h"
18 BlockWidget::BlockWidget(void): QWidget()
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");
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);
43 QPushButton * pb1 = new QPushButton("+");
44 QPushButton * pb2 = new QPushButton("-");
45 QPushButton * pb3 = new QPushButton("Edit");
46 QPushButton * pb4 = new QPushButton("Import");
48 QHBoxLayout * hbox1 = new QHBoxLayout;
49 hbox1->addWidget(pb1);
50 hbox1->addWidget(pb2);
51 hbox1->addWidget(pb3);
52 hbox1->addWidget(pb4);
55 QVBoxLayout * mainLayout = new QVBoxLayout;
56 mainLayout->addWidget(qlw);
57 mainLayout->addLayout(hbox1);
59 setLayout(mainLayout);
63 BlockWidget::~BlockWidget()