1 /* 2 * DQt - D bindings for the Qt Toolkit 3 * 4 * GNU Lesser General Public License Usage 5 * This file may be used under the terms of the GNU Lesser 6 * General Public License version 3 as published by the Free Software 7 * Foundation and appearing in the file LICENSE.LGPL3 included in the 8 * packaging of this file. Please review the following information to 9 * ensure the GNU Lesser General Public License version 3 requirements 10 * will be met: https://www.gnu.org/licenses/lgpl-3.0.html. 11 */ 12 module qt.widgets.boxlayout; 13 extern(C++): 14 15 import qt.config; 16 import qt.core.namespace; 17 import qt.core.rect; 18 import qt.core.size; 19 import qt.helpers; 20 import qt.widgets.layout; 21 import qt.widgets.layoutitem; 22 import qt.widgets.widget; 23 24 /+ #ifdef QT_INCLUDE_COMPAT 25 #endif +/ 26 27 28 29 extern(C++, class) struct QBoxLayoutPrivate; 30 31 /// Binding for C++ class [QBoxLayout](https://doc.qt.io/qt-6/qboxlayout.html). 32 class /+ Q_WIDGETS_EXPORT +/ QBoxLayout : QLayout 33 { 34 mixin(Q_OBJECT); 35 /+ Q_DECLARE_PRIVATE(QBoxLayout) +/ 36 public: 37 enum Direction { LeftToRight, RightToLeft, TopToBottom, BottomToTop, 38 Down = Direction.TopToBottom, Up = Direction.BottomToTop } 39 40 /+ explicit +/this(Direction, QWidget parent = null); 41 42 ~this(); 43 44 final Direction direction() const; 45 final void setDirection(Direction); 46 47 final void addSpacing(int size); 48 final void addStretch(int stretch = 0); 49 final void addSpacerItem(QSpacerItem spacerItem); 50 final void addWidget(QWidget , int stretch = 0, /+ Qt:: +/qt.core.namespace.Alignment alignment = /+ Qt:: +/qt.core.namespace.Alignment()); 51 final void addLayout(QLayout layout, int stretch = 0); 52 final void addStrut(int); 53 override void addItem(QLayoutItem ); 54 55 final void insertSpacing(int index, int size); 56 final void insertStretch(int index, int stretch = 0); 57 final void insertSpacerItem(int index, QSpacerItem spacerItem); 58 final void insertWidget(int index, QWidget widget, int stretch = 0, /+ Qt:: +/qt.core.namespace.Alignment alignment = /+ Qt:: +/qt.core.namespace.Alignment()); 59 final void insertLayout(int index, QLayout layout, int stretch = 0); 60 final void insertItem(int index, QLayoutItem ); 61 62 override int spacing() const; 63 override void setSpacing(int spacing); 64 65 final bool setStretchFactor(QWidget w, int stretch); 66 final bool setStretchFactor(QLayout l, int stretch); 67 final void setStretch(int index, int stretch); 68 final int stretch(int index) const; 69 70 override QSize sizeHint() const; 71 override QSize minimumSize() const; 72 override QSize maximumSize() const; 73 74 override bool hasHeightForWidth() const; 75 override int heightForWidth(int) const; 76 override int minimumHeightForWidth(int) const; 77 78 override /+ Qt:: +/qt.core.namespace.Orientations expandingDirections() const; 79 override void invalidate(); 80 override QLayoutItem itemAt(int) const; 81 override QLayoutItem takeAt(int); 82 override int count() const; 83 override void setGeometry(ref const(QRect)); 84 85 private: 86 /+ Q_DISABLE_COPY(QBoxLayout) +/ 87 mixin(CREATE_CONVENIENCE_WRAPPERS); 88 } 89 90 /// Binding for C++ class [QHBoxLayout](https://doc.qt.io/qt-6/qhboxlayout.html). 91 class /+ Q_WIDGETS_EXPORT +/ QHBoxLayout : QBoxLayout 92 { 93 mixin(Q_OBJECT); 94 public: 95 this(); 96 /+ explicit +/this(QWidget parent); 97 ~this(); 98 99 100 private: 101 /+ Q_DISABLE_COPY(QHBoxLayout) +/ 102 mixin(CREATE_CONVENIENCE_WRAPPERS); 103 } 104 105 /// Binding for C++ class [QVBoxLayout](https://doc.qt.io/qt-6/qvboxlayout.html). 106 class /+ Q_WIDGETS_EXPORT +/ QVBoxLayout : QBoxLayout 107 { 108 mixin(Q_OBJECT); 109 public: 110 this(); 111 /+ explicit +/this(QWidget parent); 112 ~this(); 113 114 115 private: 116 /+ Q_DISABLE_COPY(QVBoxLayout) +/ 117 mixin(CREATE_CONVENIENCE_WRAPPERS); 118 } 119