26 #define YUILogComponent "qt-ui"
27 #include <yui/YUILog.h>
38 const std::string & initialLabel )
39 : QGroupBox( (QWidget *) parent->widgetRep() )
40 , YFrame( parent, initialLabel )
42 setWidgetRep (
this );
43 QGroupBox::setTitle( fromUTF8( label() ) );
55 QGroupBox::setEnabled( enabled );
56 YWidget::setEnabled( enabled );
63 resize( newWidth, newHeight );
67 int left, top, right, bottom;
68 getContentsMargins( &left, &top, &right, &bottom );
69 int newChildWidth = newWidth - left - right;
70 int newChildHeight = newHeight - bottom - top;
72 firstChild()->setSize( newChildWidth, newChildHeight );
74 QWidget * qChild = (QWidget *) firstChild()->widgetRep();
75 qChild->move( left, top );
83 YFrame::setLabel( newLabel );
84 QGroupBox::setTitle( fromUTF8( label() ) );
90 int preferredWidth = hasChildren() ? firstChild()->preferredWidth() : 0;
91 int left, top, right, bottom;
92 getContentsMargins( &left, &top, &right, &bottom );
94 preferredWidth += left + right;
96 if ( minimumSizeHint().width() > preferredWidth )
97 preferredWidth = minimumSizeHint().width();
105 int preferredHeight = hasChildren() ? firstChild()->preferredHeight() : 0;
106 int left, top, right, bottom;
107 getContentsMargins( &left, &top, &right, &bottom );
109 return preferredHeight + top + left;
113 #include "YQFrame.moc"
YQFrame(YWidget *parent, const std::string &label)
Constructor.
virtual void setSize(int newWidth, int newHeight)
Set the new size of the widget.
virtual ~YQFrame()
Destructor.
virtual int preferredWidth()
Preferred width of the widget.
virtual void setEnabled(bool enabled)
Set enabled/disabled state.
virtual int preferredHeight()
Preferred height of the widget.
virtual void setLabel(const std::string &newLabel)
Change the frame label.