Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-28 09:26:41

0001 // Copyright (C) 2016 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 // Qt-Security score:significant reason:default
0004 
0005 #ifndef QDIALOG_H
0006 #define QDIALOG_H
0007 
0008 #include <QtWidgets/qtwidgetsglobal.h>
0009 #include <QtWidgets/qwidget.h>
0010 
0011 QT_REQUIRE_CONFIG(dialog);
0012 
0013 QT_BEGIN_NAMESPACE
0014 
0015 
0016 class QPushButton;
0017 class QDialogPrivate;
0018 
0019 class Q_WIDGETS_EXPORT QDialog : public QWidget
0020 {
0021     Q_OBJECT
0022     friend class QPushButton;
0023 
0024     Q_PROPERTY(bool sizeGripEnabled READ isSizeGripEnabled WRITE setSizeGripEnabled)
0025     Q_PROPERTY(bool modal READ isModal WRITE setModal)
0026 
0027 public:
0028     explicit QDialog(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
0029     ~QDialog();
0030 
0031     enum DialogCode { Rejected, Accepted };
0032     Q_ENUM(DialogCode)
0033 
0034     int result() const;
0035 
0036     void setVisible(bool visible) override;
0037 
0038     QSize sizeHint() const override;
0039     QSize minimumSizeHint() const override;
0040 
0041     void setSizeGripEnabled(bool);
0042     bool isSizeGripEnabled() const;
0043 
0044     void setModal(bool modal);
0045     void setResult(int r);
0046 
0047 Q_SIGNALS:
0048     void finished(int result);
0049     void accepted();
0050     void rejected();
0051 
0052 public Q_SLOTS:
0053     virtual void open();
0054     virtual int exec();
0055     virtual void done(int);
0056     virtual void accept();
0057     virtual void reject();
0058 
0059 protected:
0060     QDialog(QDialogPrivate &, QWidget *parent, Qt::WindowFlags f = Qt::WindowFlags());
0061 
0062     void keyPressEvent(QKeyEvent *) override;
0063     void closeEvent(QCloseEvent *) override;
0064     void showEvent(QShowEvent *) override;
0065     void resizeEvent(QResizeEvent *) override;
0066 #ifndef QT_NO_CONTEXTMENU
0067     void contextMenuEvent(QContextMenuEvent *) override;
0068 #endif
0069     bool eventFilter(QObject *, QEvent *) override;
0070     void adjustPosition(QWidget*);
0071 private:
0072     Q_DECLARE_PRIVATE(QDialog)
0073     Q_DISABLE_COPY(QDialog)
0074 };
0075 
0076 QT_END_NAMESPACE
0077 
0078 #endif // QDIALOG_H