2 // blockitemwidget.cpp: Block item widget
4 // Part of the Architektonas Project
5 // (C) 2011 Underground Software
6 // See the README and GPLv3 files for licensing and warranty information
8 // JLH = James Hammons <jlhamm@acm.org>
11 // --- ---------- ------------------------------------------------------------
12 // JLH 07/13/2013 Created this file
15 #include "blockitemwidget.h"
17 BlockItemWidget::BlockItemWidget(QString s, QPixmap * i/*=0*/):
22 QHBoxLayout * mainLayout = new QHBoxLayout;
23 mainLayout->setContentsMargins(0, 0, 0, 0); // This is required, otherwise the layout engine puts too much space around this widget. :-/
27 i = new QPixmap(36, 32);
28 i->fill(); // Fills pixmap with white
31 p.drawLine(0, 0, 31, 31);
32 p.drawLine(0, 31, 31, 0);
37 mainLayout->addWidget(image);
38 mainLayout->addWidget(name);
39 mainLayout->addStretch();
40 setLayout(mainLayout);
41 QSize size = mainLayout->sizeHint();
42 printf("BlockItemWidget: size. w=%i, h=%i\n", size.width(), size.height());
45 BlockItemWidget::~BlockItemWidget()