libyui-qt  2.47.1.1
YQAlignment.h
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: YQAlignment.h
20 
21  Author: Stefan Hundhammer <sh@suse.de>
22 
23 /-*/
24 
25 
26 #ifndef YQAlignment_h
27 #define YQAlignment_h
28 
29 #include <qwidget.h>
30 
31 #include <yui/YAlignment.h>
32 
33 class QWidget;
34 
35 class YQAlignment : public QWidget, public YAlignment
36 {
37  Q_OBJECT
38 
39 public:
40 
41  /**
42  * Constructor.
43  **/
44  YQAlignment( YWidget * parent,
45  YAlignmentType horAlign,
46  YAlignmentType vertAlign );
47 
48  /**
49  * Constructor for cases where the YWidget parent's widgetRep() isn't the
50  * QWidget parent, for example in compound widgets like YQWizard where it
51  * makes sense to pass a child of the YQWizard (the client area) as the
52  * QWidget parent.
53  *
54  * Use this only if you know very well what you are doing.
55  **/
56  YQAlignment( YWidget * yParent,
57  QWidget * qParent,
58  YAlignmentType horAlign,
59  YAlignmentType vertAlign );
60 
61  /**
62  * Move the child widget to a new position.
63  *
64  * Implemented from YAlignment.
65  **/
66  virtual void moveChild( YWidget * child, int newX, int newY );
67 
68  /**
69  * Enable or disable this widget and its child.
70  *
71  * Reimplemented from YWidget.
72  **/
73  virtual void setEnabled( bool enabled );
74 
75  /**
76  * Set the new size of the widget.
77  *
78  * Reimplemented from YWidget.
79  **/
80  virtual void setSize( int newWidth, int newHeight );
81 
82  /**
83  * Set the background pixmap.
84  *
85  * Reimplemented from YAlignment.
86  **/
87  virtual void setBackgroundPixmap( const std::string & pixmapFileName );
88 
89 protected:
90  std::string _pixmapFileName;
91  virtual void paintEvent ( QPaintEvent * event );
92 
93 };
94 
95 
96 #endif // YQAlignment_h
virtual void setBackgroundPixmap(const std::string &pixmapFileName)
Set the background pixmap.
Definition: YQAlignment.cc:84
virtual void setEnabled(bool enabled)
Enable or disable this widget and its child.
Definition: YQAlignment.cc:56
virtual void moveChild(YWidget *child, int newX, int newY)
Move the child widget to a new position.
Definition: YQAlignment.cc:63
YQAlignment(YWidget *parent, YAlignmentType horAlign, YAlignmentType vertAlign)
Constructor.
Definition: YQAlignment.cc:35
virtual void setSize(int newWidth, int newHeight)
Set the new size of the widget.
Definition: YQAlignment.cc:70