47 Qt::WindowModality windowModality,
50 Q_UNUSED(windowFlags);
51 Q_UNUSED(windowModality);
53 QSharedPointer<QMessageDialogOptions> opt = options();
57 if (!opt->checkBoxLabel().isNull())
60 m_javaMessageDialog.callMethod<
void>(
"setStandardIcon",
"(I)V", opt->standardIcon());
62 QString str = htmlText(opt->windowTitle());
64 m_javaMessageDialog.callMethod<
void>(
"setTile",
"(Ljava/lang/String;)V",
65 QJniObject::fromString(str).object());
68 str = htmlText(opt->text());
70 m_javaMessageDialog.callMethod<
void>(
"setText",
"(Ljava/lang/String;)V",
71 QJniObject::fromString(str).object());
74 str = htmlText(opt->informativeText());
76 m_javaMessageDialog.callMethod<
void>(
"setInformativeText",
"(Ljava/lang/String;)V",
77 QJniObject::fromString(str).object());
80 str = htmlText(opt->detailedText());
82 m_javaMessageDialog.callMethod<
void>(
"setDetailedText",
"(Ljava/lang/String;)V",
83 QJniObject::fromString(str).object());
86 const int *currentLayout = buttonLayout(Qt::Horizontal, AndroidLayout);
87 while (*currentLayout != QPlatformDialogHelper::EOL) {
88 const int role = (*currentLayout & ~QPlatformDialogHelper::Reverse);
89 addButtons(opt,
static_cast<ButtonRole>(role));
93 m_javaMessageDialog.callMethod<
void>(
"show",
"(J)V", jlong(
static_cast<QObject*>(
this)));
128 if (m_loop.isRunning())
135 const StandardButton standardButton =
static_cast<StandardButton>(buttonID);
136 ButtonRole role = QPlatformDialogHelper::buttonRole(standardButton);
137 if (buttonID > QPlatformDialogHelper::LastButton) {
139 const QMessageDialogOptions::CustomButton *custom = options()->customButton(buttonID);
144 emit clicked(standardButton, role);
167 const char QtMessageHandlerHelperClassName[] =
"org/qtproject/qt/android/QtMessageDialogHelper";
168 jclass clazz = env.findClass(QtMessageHandlerHelperClassName);
170 __android_log_print(ANDROID_LOG_FATAL, QtAndroid::qtTagText(), QtAndroid::classErrorMsgFmt()
171 , QtMessageHandlerHelperClassName);
174 g_messageDialogHelperClass =
static_cast<jclass>(env->NewGlobalRef(clazz));
176 if (!env.registerNativeMethods(
"org/qtproject/qt/android/QtNativeDialogHelper",
178 __android_log_print(ANDROID_LOG_FATAL,
"Qt",
"RegisterNatives failed");