26 #define YUILogComponent "qt-ui"
27 #include <yui/YUILog.h>
30 #include "YQAlignment.h"
36 YAlignmentType horAlign,
37 YAlignmentType vertAlign )
38 : QWidget( (QWidget *) parent->widgetRep() )
39 , YAlignment( parent, horAlign, vertAlign ), _pixmapFileName()
47 YAlignmentType horAlign,
48 YAlignmentType vertAlign )
50 , YAlignment( yParent, horAlign, vertAlign ), _pixmapFileName()
58 QWidget::setEnabled( enabled );
59 YWidget::setEnabled( enabled );
65 QWidget * qw = (QWidget *) ( child->widgetRep() );
66 qw->move( newX, newY );
72 resize( newWidth, newHeight );
73 YAlignment::setSize( newWidth, newHeight );
76 void YQAlignment::paintEvent ( QPaintEvent * event )
78 QPainter painter(
this);
79 painter.drawPixmap(rect(), QPixmap(_pixmapFileName.c_str()));
81 QWidget::paintEvent(event);
86 _pixmapFileName = pixmapFileName;
88 YAlignment::setBackgroundPixmap( _pixmapFileName );
89 _pixmapFileName = YAlignment::backgroundPixmap();
94 #include "YQAlignment.moc"
virtual void setBackgroundPixmap(const std::string &pixmapFileName)
Set the background pixmap.
virtual void setEnabled(bool enabled)
Enable or disable this widget and its child.
virtual void moveChild(YWidget *child, int newX, int newY)
Move the child widget to a new position.
YQAlignment(YWidget *parent, YAlignmentType horAlign, YAlignmentType vertAlign)
Constructor.
virtual void setSize(int newWidth, int newHeight)
Set the new size of the widget.