1 // layeritemwidget.cpp: Layer item 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/13/2013 Created this file
14 #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());
46 BlockItemWidget::~BlockItemWidget()