1 /*---------------------------------------------------------------------\
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
11 \----------------------------------------------------------------------/
13 File: YQWizardButton.cc
15 Author: Stefan Hundhammer <sh@suse.de>
20 #include <qpushbutton.h>
22 #define y2log_component "qt-ui"
23 #include <ycp/y2log.h>
27 #include "YQWizardButton.h"
31 YQWizardButton::YQWizardButton( YQWizard * wizard,
32 QWidget * buttonParent,
33 const string & label )
34 : YQGenericButton( wizard, label )
37 QPushButton * button = new QPushButton( fromUTF8( label ), buttonParent );
38 Q_CHECK_PTR( button );
40 setQPushButton( button );
41 setWidgetRep( button );
43 connect( button, SIGNAL( clicked() ),
44 this, SIGNAL( clicked() ) );
47 // This widget itself will never be visible, only its button - which is not
48 // a child of this widget.
53 YQWizardButton::~YQWizardButton()
55 // Don't delete qPushButton() here - its parent (buttonParent) will take
60 void YQWizardButton::hide()
63 qPushButton()->hide();
67 void YQWizardButton::show()
70 qPushButton()->show();
74 bool YQWizardButton::isShown() const
77 return qPushButton()->isShown();
83 bool YQWizardButton::isHidden() const
89 int YQWizardButton::preferredWidth()
91 // This widget doesn't have a YWidget-based visual representation, it's
92 // only a YWidget for shortcut checking etc.
98 int YQWizardButton::preferredHeight()
100 // This widget doesn't have a YWidget-based visual representation, it's
101 // only a YWidget for shortcut checking etc.
107 void YQWizardButton::setSize( int newWidth, int newHeight )
114 #include "YQWizardButton.moc"