Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 09:11:48

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 
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     Q_ENUM(DialogCode)
0032 
0033     int result() const;
0034 
0035     void setVisible(bool visible) override;
0036 
0037     QSize sizeHint() const override;
0038     QSize minimumSizeHint() const override;
0039 
0040     void setSizeGripEnabled(bool);
0041     bool isSizeGripEnabled() const;
0042 
0043     void setModal(bool modal);
0044     void setResult(int r);
0045 
0046 Q_SIGNALS:
0047     void finished(int result);
0048     void accepted();
0049     void rejected();
0050 
0051 public Q_SLOTS:
0052     virtual void open();
0053     virtual int exec();
0054     virtual void done(int);
0055     virtual void accept();
0056     virtual void reject();
0057 
0058 protected:
0059     QDialog(QDialogPrivate &, QWidget *parent, Qt::WindowFlags f = Qt::WindowFlags());
0060 
0061     void keyPressEvent(QKeyEvent *) override;
0062     void closeEvent(QCloseEvent *) override;
0063     void showEvent(QShowEvent *) override;
0064     void resizeEvent(QResizeEvent *) override;
0065 #ifndef QT_NO_CONTEXTMENU
0066     void contextMenuEvent(QContextMenuEvent *) override;
0067 #endif
0068     bool eventFilter(QObject *, QEvent *) override;
0069     void adjustPosition(QWidget*);
0070 private:
0071     Q_DECLARE_PRIVATE(QDialog)
0072     Q_DISABLE_COPY(QDialog)
0073 };
0074 
0075 QT_END_NAMESPACE
0076 
0077 #endif // QDIALOG_H