File indexing completed on 2024-05-05 04:49:25

0001 /*
0002  * Copyright (C) 2017  Malte Veerman <malte.veerman@gmail.com>
0003  *
0004  * This program is free software; you can redistribute it and/or modify
0005  * it under the terms of the GNU General Public License as published by
0006  * the Free Software Foundation; either version 2 of the License, or
0007  * (at your option) any later version.
0008  *
0009  * This program is distributed in the hope that it will be useful,
0010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0012  * GNU General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU General Public License along
0015  * with this program; if not, write to the Free Software Foundation, Inc.,
0016  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
0017  *
0018  */
0019 
0020 #ifndef BOXWIDGET_H
0021 #define BOXWIDGET_H
0022 
0023 #include "amarok_export.h"
0024 
0025 #include <QFrame>
0026 
0027 class QBoxLayout;
0028 
0029 /**
0030  * A Simple QFrame subclass that automatically adds new children to its layout
0031  */
0032 class AMAROK_EXPORT BoxWidget : public QFrame
0033 {
0034     Q_OBJECT
0035 
0036 public:
0037     /**
0038      * Constructor
0039      * @param vertical defines if this BoxWidget has a vertical Layout.
0040      * Has a horizontal if false.
0041      * @param parent the parent widget.
0042      */
0043     explicit BoxWidget( bool vertical = true, QWidget *parent = nullptr );
0044     ~BoxWidget() override {}
0045 
0046     QBoxLayout* layout() const;
0047 
0048 protected:
0049     void childEvent(QChildEvent* event) override;
0050 };
0051 
0052 #endif // BOXWIDGET_H