digiKam
dlayoutbox.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2014-09-12
7  * Description : Vertical and horizontal layout widget helpers.
8  *
9  * Copyright (C) 2014-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_DLAYOUT_BOX_H
25 #define DIGIKAM_DLAYOUT_BOX_H
26 
27 // Qt includes
28 
29 #include <QWidget>
30 #include <QFrame>
31 #include <QSize>
32 #include <QMargins>
33 
34 // Local includes
35 
36 #include "digikam_export.h"
37 
38 namespace Digikam
39 {
40 
44 class DIGIKAM_EXPORT DHBox : public QFrame
45 {
46  Q_OBJECT
47  Q_DISABLE_COPY(DHBox)
48 
49 public:
50 
51  explicit DHBox(QWidget* const parent = nullptr);
52  ~DHBox() override;
53 
54  void setSpacing(int space);
55  void setContentsMargins(const QMargins& margins);
56  void setContentsMargins(int left, int top, int right, int bottom);
57  void setStretchFactor(QWidget* const widget, int stretch);
58 
59  QSize sizeHint() const override;
60  QSize minimumSizeHint() const override;
61 
62 protected:
63 
64  DHBox(bool vertical, QWidget* const parent);
65 
66  void childEvent(QChildEvent* e) override;
67 };
68 
69 // ------------------------------------------------------------------------------------
70 
74 class DIGIKAM_EXPORT DVBox : public DHBox
75 {
76  Q_OBJECT
77  Q_DISABLE_COPY(DVBox)
78 
79  public:
80 
81  explicit DVBox(QWidget* const parent = nullptr);
82  ~DVBox() override;
83 };
84 
85 } // namespace Digikam
86 
87 #endif // DIGIKAM_DLAYOUT_BOX_H
Definition: dlayoutbox.h:45
Definition: dlayoutbox.h:75
Definition: datefolderview.cpp:43