Warning, file /office/calligra/libs/widgets/KoVBox.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* This file is part of the KDE libraries
0002    Copyright (C) 2005 David Faure <faure@kde.org>
0003 
0004    This library is free software; you can redistribute it and/or
0005    modify it under the terms of the GNU Library General Public
0006    License version 2 as published by the Free Software Foundation.
0007 
0008    This library is distributed in the hope that it will be useful,
0009    but WITHOUT ANY WARRANTY; without even the implied warranty of
0010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0011    Library General Public License for more details.
0012 
0013    You should have received a copy of the GNU Library General Public License
0014    along with this library; see the file COPYING.LIB.  If not, write to
0015    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0016    Boston, MA 02110-1301, USA.
0017 */
0018 
0019 #ifndef KoVBOX_H
0020 #define KoVBOX_H
0021 
0022 #include <kowidgets_export.h>
0023 
0024 #include <QFrame>
0025 
0026 class QChildEvent;
0027 
0028 /**
0029  * A container widget which arranges its children vertically.
0030  * 
0031  * When using a KoVBox you don't need to create a layout nor
0032  * to add the child widgets to it.
0033  *
0034  * Both margin and spacing are initialized to 0. Use QHBoxLayout
0035  * if you need standard layout margins.
0036  *
0037  * @see KVBox
0038  */
0039 class KOWIDGETS_EXPORT KoVBox : public QFrame
0040 {
0041     Q_OBJECT
0042 
0043 public:
0044     /**
0045      * Creates a new hbox.
0046      */
0047     explicit KoVBox(QWidget *parent = 0);
0048 
0049     /**
0050      * Destructor.
0051      */
0052     ~KoVBox() override;
0053 
0054     /**
0055      * Sets the @p margin of the hbox.
0056      */
0057     void setMargin(int margin);
0058 
0059     /**
0060      * Sets the spacing between the child widgets to @p space.
0061      *
0062      * To get the default layout spacing, set @p space to -1.
0063      */
0064     void setSpacing(int space);
0065 
0066     /**
0067      * Sets the stretch factor of @p widget to @p stretch.
0068      */
0069     void setStretchFactor(QWidget *widget, int stretch);
0070 
0071     /**
0072      * Calculate the recommended size for this hbox.
0073      */
0074     QSize sizeHint() const override;
0075 
0076     /**
0077      * Calculate the recommended minimum size for this hbox.
0078      */
0079     QSize minimumSizeHint() const override;
0080 
0081 protected:
0082 
0083     void childEvent(QChildEvent *ev) override;
0084 
0085 private:
0086     class Private;
0087     friend class Private;
0088     Private *const d;
0089 
0090     Q_DISABLE_COPY(KoVBox)
0091 };
0092 
0093 #endif