Fix game:addSpawnShapesByZone
[ryzomcore.git] / nel / tools / 3d / tile_edit_qt / tile_widget.cpp
blobd789e45c2fc6ec410886d46c14211fc0b3a38221
1 #include "common.h"
2 #include <QtGui/QtGui>
3 #include "tile_widget.h"
5 CTile_Widget::CTile_Widget(QWidget *parent)
6 : QWidget(parent)
9 ui.setupUi(this);
13 void CTile_Widget::initWidget(const QPixmap& pixmap, const int pixmapSide, const QString& label)
15 int nbPixel = pixmapSide;
16 this->resize( nbPixel + (PIXMAP_MARGIN * 2), nbPixel + (PIXMAP_MARGIN * 2) + ui.tileLabel->height());
18 ui.tilePixmapLabel->resize(pixmapSide, pixmapSide);
19 ui.tilePixmapLabel->move(PIXMAP_MARGIN, PIXMAP_MARGIN);
20 ui.tilePixmapLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
22 ui.tileLabel->setText(label);
23 ui.tileLabel->setToolTip(label);
24 ui.tileLabel->resize(nbPixel, ui.tileLabel->height());
25 ui.tileLabel->move(PIXMAP_MARGIN, nbPixel + PIXMAP_MARGIN * 2);
26 ui.tileLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
28 if(!pixmap.isNull())
30 ui.tilePixmapLabel->setPixmap(pixmap);
31 ui.tilePixmapLabel->setFrameShape(QFrame::NoFrame);