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()
32 const QSharedPointer<QMessageDialogOptions> &
opt =
options();
33 constexpr auto lineShift =
"\n\n"_L1;
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)];
131 [
window.rootViewController presentViewController:m_alertController animated:YES completion:nil];
138 [m_alertController dismissViewControllerAnimated:YES completion:nil];
140 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()
bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent) override
QString windowTitle() const
const QList< CustomButton > & customButtons()
QObject * parent() const
Returns a pointer to the parent object.
\inmodule QtCore \reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString & replace(qsizetype i, qsizetype len, QChar after)
bool isEmpty() const noexcept
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...
UIWindow * presentationWindow(QWindow *)
GLuint GLsizei const GLchar * label
[43]
GLuint GLsizei const GLchar * message
#define QStringLiteral(str)