| 1 | // Copyright (C) 2017 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #include "qwidgetplatformdialog_p.h" |
| 5 | |
| 6 | #include <QtGui/qwindow.h> |
| 7 | #include <QtWidgets/qdialog.h> |
| 8 | |
| 9 | QT_BEGIN_NAMESPACE |
| 10 | |
| 11 | bool QWidgetPlatformDialog::show(QDialog *dialog, Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent) |
| 12 | { |
| 13 | dialog->setWindowFlags(flags); |
| 14 | dialog->setWindowModality(modality); |
| 15 | |
| 16 | dialog->createWinId(); |
| 17 | QWindow *handle = dialog->windowHandle(); |
| 18 | Q_ASSERT(handle); |
| 19 | handle->setTransientParent(const_cast<QWindow *>(parent)); |
| 20 | |
| 21 | dialog->show(); |
| 22 | return true; |
| 23 | } |
| 24 | |
| 25 | QT_END_NAMESPACE |
| 26 |
