libyui-qt
2.42.4
Main Page
Classes
Files
File List
All
Classes
Functions
Variables
YQWizardButton.cc
1
/*
2
Copyright (C) 2000-2012 Novell, Inc
3
This library is free software; you can redistribute it and/or modify
4
it under the terms of the GNU Lesser General Public License as
5
published by the Free Software Foundation; either version 2.1 of the
6
License, or (at your option) version 3.0 of the License. This library
7
is distributed in the hope that it will be useful, but WITHOUT ANY
8
WARRANTY; without even the implied warranty of MERCHANTABILITY or
9
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10
License for more details. You should have received a copy of the GNU
11
Lesser General Public License along with this library; if not, write
12
to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13
Floor, Boston, MA 02110-1301 USA
14
*/
15
16
17
/*-/
18
19
File: YQWizardButton.cc
20
21
Author: Stefan Hundhammer <sh@suse.de>
22
23
/-*/
24
25
26
#include <qpushbutton.h>
27
#include <qsize.h>
28
#define YUILogComponent "qt-ui"
29
#include <yui/YUILog.h>
30
31
#include "utf8.h"
32
#include "YQUI.h"
33
#include "YQWizardButton.h"
34
#include "YQWizard.h"
35
36
37
YQWizardButton::YQWizardButton
(
YQWizard
* wizard,
38
QWidget * buttonParent,
39
const
std::string & label )
40
:
YQGenericButton
( wizard, label )
41
, _wizard( wizard )
42
{
43
QPushButton * button =
new
QPushButton( fromUTF8( label ), buttonParent );
44
Q_CHECK_PTR( button );
45
46
setQPushButton
( button );
47
setWidgetRep( button );
48
49
connect( button, SIGNAL(
clicked
() ),
50
this
, SIGNAL(
clicked
() ) );
51
52
53
// This widget itself will never be visible, only its button - which is not
54
// a child of this widget.
55
QWidget::hide();
56
}
57
58
59
YQWizardButton::~YQWizardButton
()
60
{
61
// Don't delete qPushButton() here - its parent (buttonParent) will take
62
// care of that!
63
}
64
65
66
void
YQWizardButton::hide
()
67
{
68
if
(
qPushButton
() )
69
qPushButton
()->hide();
70
}
71
72
73
void
YQWizardButton::show
()
74
{
75
if
(
qPushButton
() )
76
qPushButton
()->show();
77
}
78
79
80
bool
YQWizardButton::isShown
()
const
81
{
82
if
(
qPushButton
() )
83
return
!
qPushButton
()->isHidden();
84
else
85
return
false
;
86
}
87
88
89
bool
YQWizardButton::isHidden
()
const
90
{
91
return
!
isShown
();
92
}
93
94
95
int
YQWizardButton::preferredWidth
()
96
{
97
// This widget doesn't have a YWidget-based visual representation, it's
98
// only a YWidget for shortcut checking etc.
99
100
return
0;
101
}
102
103
104
int
YQWizardButton::preferredHeight
()
105
{
106
// This widget doesn't have a YWidget-based visual representation, it's
107
// only a YWidget for shortcut checking etc.
108
109
return
0;
110
}
111
112
113
void
YQWizardButton::setSize
(
int
newWidth,
int
newHeight )
114
{
115
// NOP
116
}
117
118
119
120
#include "YQWizardButton.moc"
src
YQWizardButton.cc
Generated by
1.8.3