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.dialog; 13 extern(C++): 14 15 import qt.config; 16 import qt.core.coreevent; 17 import qt.core.namespace; 18 import qt.core.object; 19 import qt.core.size; 20 import qt.gui.event; 21 import qt.helpers; 22 import qt.widgets.widget; 23 24 /+ QT_REQUIRE_CONFIG(dialog); +/ 25 26 27 28 extern(C++, class) struct QDialogPrivate; 29 30 /// Binding for C++ class [QDialog](https://doc.qt.io/qt-6/qdialog.html). 31 class /+ Q_WIDGETS_EXPORT +/ QDialog : QWidget 32 { 33 mixin(Q_OBJECT); 34 /+ friend class QPushButton; +/ 35 36 /+ Q_PROPERTY(bool sizeGripEnabled READ isSizeGripEnabled WRITE setSizeGripEnabled) 37 Q_PROPERTY(bool modal READ isModal WRITE setModal) +/ 38 39 public: 40 /+ explicit +/this(QWidget parent = null, /+ Qt:: +/qt.core.namespace.WindowFlags f = /+ Qt:: +/qt.core.namespace.WindowFlags()); 41 ~this(); 42 43 enum DialogCode { Rejected, Accepted } 44 45 final int result() const; 46 47 override void setVisible(bool visible); 48 49 override QSize sizeHint() const; 50 override QSize minimumSizeHint() const; 51 52 final void setSizeGripEnabled(bool); 53 final bool isSizeGripEnabled() const; 54 55 final void setModal(bool modal); 56 final void setResult(int r); 57 58 /+ Q_SIGNALS +/public: 59 @QSignal final void finished(int result); 60 @QSignal final void accepted(); 61 @QSignal final void rejected(); 62 63 public /+ Q_SLOTS +/: 64 /+ virtual +/ @QSlot void open(); 65 /+ virtual +/ @QSlot int exec(); 66 /+ virtual +/ @QSlot void done(int); 67 /+ virtual +/ @QSlot void accept(); 68 /+ virtual +/ @QSlot void reject(); 69 70 protected: 71 this(ref QDialogPrivate , QWidget parent, /+ Qt:: +/qt.core.namespace.WindowFlags f = /+ Qt:: +/qt.core.namespace.WindowFlags()); 72 73 override void keyPressEvent(QKeyEvent ); 74 override void closeEvent(QCloseEvent ); 75 override void showEvent(QShowEvent ); 76 override void resizeEvent(QResizeEvent ); 77 version(QT_NO_CONTEXTMENU){}else 78 { 79 override void contextMenuEvent(QContextMenuEvent ); 80 } 81 override bool eventFilter(QObject , QEvent ); 82 final void adjustPosition(QWidget); 83 private: 84 /+ Q_DECLARE_PRIVATE(QDialog) +/ 85 /+ Q_DISABLE_COPY(QDialog) +/ 86 mixin(CREATE_CONVENIENCE_WRAPPERS); 87 } 88