6#include <QtGui/qwindow.h>
7#include <QtGui/private/qguiapplication_p.h>
8#include <qpa/qplatformtheme.h>
10#include <QtCore/private/qcore_mac_p.h>
29inline QString QIOSMessageDialog::messageTextPlain()
34 const QString &informativeText =
opt->informativeText();
35 const QString &detailedText =
opt->detailedText();
39 text += lineShift + informativeText;
41 text += lineShift + detailedText;
49inline UIAlertAction *QIOSMessageDialog::createAction(
53 const UIAlertActionStyle style = UIAlertActionStyleDefault;
55 return [UIAlertAction actionWithTitle:
label.toNSString() style:style handler:^(UIAlertAction *) {
61inline UIAlertAction *QIOSMessageDialog::createAction(StandardButton
button)
67 UIAlertActionStyle style = UIAlertActionStyleDefault;
69 style = UIAlertActionStyleCancel;
71 style = UIAlertActionStyleDestructive;
73 return [UIAlertAction actionWithTitle:
label.toNSString() style:style handler:^(UIAlertAction *) {
95 if (!
options()->checkBoxLabel().isNull())
98 m_alertController = [[UIAlertController
100 message:messageTextPlain().toNSString()
101 preferredStyle:UIAlertControllerStyleAlert] retain];
105 UIAlertAction *act = createAction(
button);
106 [m_alertController addAction:act];
109 if (StandardButtons buttons =
options()->standardButtons()) {
114 }
else if (customButtons.
isEmpty()) {
116 [m_alertController addAction:createAction(
NoButton)];
121 qCDebug(lcQpaWindow,
"Attempting to exec a dialog without any window/widget visible.");
126 window = primaryScreen->uiWindow();
139 [
window.rootViewController presentViewController:m_alertController animated:YES completion:nil];
146 [m_alertController dismissViewControllerAnimated:YES completion:nil];
148 m_alertController =
nullptr;
int exec(ProcessEventsFlags flags=AllEvents)
Enters the main event loop and waits until exit() is called.
void exit(int returnCode=0)
Tells the event loop to exit with a return code.
static QPlatformTheme * platformTheme()
QScreen * primaryScreen
the primary (or default) screen of the application.
bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent) override
bool isEmpty() const noexcept
QString windowTitle() const
const QList< CustomButton > & customButtons()
QObject * parent() const
Returns a pointer to the parent object.
\inmodule QtCore \reentrant
QPlatformScreen * handle() const
Get the platform screen handle.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString & replace(qsizetype i, qsizetype len, QChar after)
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QString & remove(qsizetype i, qsizetype len)
Removes n characters from the string, starting at the given position index, and returns a reference t...
AppleApplication * qt_apple_sharedApplication()
#define qCDebug(category,...)
GLuint GLsizei const GLchar * label
[43]
GLuint GLsizei const GLchar * message
#define QStringLiteral(str)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent