1 /**************************************************************************** 2 ** 3 ** DQt - D bindings for the Qt Toolkit 4 ** 5 ** GNU Lesser General Public License Usage 6 ** This file may be used under the terms of the GNU Lesser 7 ** General Public License version 3 as published by the Free Software 8 ** Foundation and appearing in the file LICENSE.LGPL3 included in the 9 ** packaging of this file. Please review the following information to 10 ** ensure the GNU Lesser General Public License version 3 requirements 11 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. 12 ** 13 ****************************************************************************/ 14 module qt.widgets.buttongroup; 15 extern(C++): 16 17 import qt.config; 18 import qt.core.list; 19 import qt.core.object; 20 import qt.helpers; 21 import qt.widgets.abstractbutton; 22 23 /+ QT_REQUIRE_CONFIG(buttongroup); 24 25 26 class QAbstractButton; 27 class QAbstractButtonPrivate; +/ 28 extern(C++, class) struct QButtonGroupPrivate; 29 30 class /+ Q_WIDGETS_EXPORT +/ QButtonGroup : QObject 31 { 32 mixin(Q_OBJECT); 33 34 /+ Q_PROPERTY(bool exclusive READ exclusive WRITE setExclusive) +/ 35 public: 36 /+ explicit +/this(QObject parent = null); 37 ~this(); 38 39 final void setExclusive(bool); 40 final bool exclusive() const; 41 42 final void addButton(QAbstractButton , int id = -1); 43 final void removeButton(QAbstractButton ); 44 45 final QList!(QAbstractButton) buttons() const; 46 47 final QAbstractButton checkedButton() const; 48 // no setter on purpose! 49 50 final QAbstractButton button(int id) const; 51 final void setId(QAbstractButton button, int id); 52 final int id(QAbstractButton button) const; 53 final int checkedId() const; 54 55 /+ Q_SIGNALS +/public: 56 @QSignal final void buttonClicked(QAbstractButton ); 57 @QSignal final void buttonPressed(QAbstractButton ); 58 @QSignal final void buttonReleased(QAbstractButton ); 59 @QSignal final void buttonToggled(QAbstractButton , bool); 60 @QSignal final void idClicked(int); 61 @QSignal final void idPressed(int); 62 @QSignal final void idReleased(int); 63 @QSignal final void idToggled(int, bool); 64 /+ #if QT_DEPRECATED_SINCE(5, 15) +/ 65 /+ QT_DEPRECATED_VERSION_X_5_15("Use QButtonGroup::idClicked(int) instead") +/ 66 @QSignal final void buttonClicked(int); 67 /+ QT_DEPRECATED_VERSION_X_5_15("Use QButtonGroup::idPressed(int) instead") +/ 68 @QSignal final void buttonPressed(int); 69 /+ QT_DEPRECATED_VERSION_X_5_15("Use QButtonGroup::idReleased(int) instead") +/ 70 @QSignal final void buttonReleased(int); 71 /+ QT_DEPRECATED_VERSION_X_5_15("Use QButtonGroup::idToggled(int, bool) instead") +/ 72 @QSignal final void buttonToggled(int, bool); 73 /+ #endif +/ 74 75 private: 76 /+ Q_DISABLE_COPY(QButtonGroup) +/ 77 /+ Q_DECLARE_PRIVATE(QButtonGroup) +/ 78 /+ friend class QAbstractButton; +/ 79 /+ friend class QAbstractButtonPrivate; +/ 80 } 81