Warning, file /include/QtWidgets/qdialog.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004 #ifndef QDIALOG_H
0005 #define QDIALOG_H
0006
0007 #include <QtWidgets/qtwidgetsglobal.h>
0008 #include <QtWidgets/qwidget.h>
0009
0010 QT_REQUIRE_CONFIG(dialog);
0011
0012 QT_BEGIN_NAMESPACE
0013
0014
0015 class QPushButton;
0016 class QDialogPrivate;
0017
0018 class Q_WIDGETS_EXPORT QDialog : public QWidget
0019 {
0020 Q_OBJECT
0021 friend class QPushButton;
0022
0023 Q_PROPERTY(bool sizeGripEnabled READ isSizeGripEnabled WRITE setSizeGripEnabled)
0024 Q_PROPERTY(bool modal READ isModal WRITE setModal)
0025
0026 public:
0027 explicit QDialog(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
0028 ~QDialog();
0029
0030 enum DialogCode { Rejected, Accepted };
0031
0032 int result() const;
0033
0034 void setVisible(bool visible) override;
0035
0036 QSize sizeHint() const override;
0037 QSize minimumSizeHint() const override;
0038
0039 void setSizeGripEnabled(bool);
0040 bool isSizeGripEnabled() const;
0041
0042 void setModal(bool modal);
0043 void setResult(int r);
0044
0045 Q_SIGNALS:
0046 void finished(int result);
0047 void accepted();
0048 void rejected();
0049
0050 public Q_SLOTS:
0051 virtual void open();
0052 virtual int exec();
0053 virtual void done(int);
0054 virtual void accept();
0055 virtual void reject();
0056
0057 protected:
0058 QDialog(QDialogPrivate &, QWidget *parent, Qt::WindowFlags f = Qt::WindowFlags());
0059
0060 void keyPressEvent(QKeyEvent *) override;
0061 void closeEvent(QCloseEvent *) override;
0062 void showEvent(QShowEvent *) override;
0063 void resizeEvent(QResizeEvent *) override;
0064 #ifndef QT_NO_CONTEXTMENU
0065 void contextMenuEvent(QContextMenuEvent *) override;
0066 #endif
0067 bool eventFilter(QObject *, QEvent *) override;
0068 void adjustPosition(QWidget*);
0069 private:
0070 Q_DECLARE_PRIVATE(QDialog)
0071 Q_DISABLE_COPY(QDialog)
0072 };
0073
0074 QT_END_NAMESPACE
0075
0076 #endif