blob: b8c273469a3b43a28abad8be20b55bc68ab8199d (
plain)
1234567891011121314151617181920212223242526272829303132333435363738 | // Copyright (C) 2022 The Qt Company Ltd.// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only#ifndef QCOCOAMESSAGEDIALOG_H#define QCOCOAMESSAGEDIALOG_H#include <qpa/qplatformdialoghelper.h>Q_FORWARD_DECLARE_OBJC_CLASS(NSAlert);typedeflong NSInteger;typedef NSInteger NSModalResponse; QT_BEGIN_NAMESPACE class QEventLoop;class QCocoaMessageDialog :public QPlatformMessageDialogHelper {public:QCocoaMessageDialog() =default;~QCocoaMessageDialog();voidexec() override;boolshow(Qt::WindowFlags windowFlags,Qt::WindowModality windowModality, QWindow *parent) override;voidhide() override;private:Qt::WindowModality modality()const; NSAlert *m_alert =nullptr; QEventLoop *m_eventLoop =nullptr; NSModalResponse runModal()const;voidprocessResponse(NSModalResponse response);}; QT_END_NAMESPACE #endif// QCOCOAMESSAGEDIALOG_H
|