void QAndroidOffscreenEditText::setTypefaceFromAsset(const QString & filename, int style) { if (QJniObject * view = offscreenView()) { view->callParamVoid("setTypefaceFromAsset", "Ljava/lang/String;I", QJniLocalRef(filename).jObject(), style); } }
void QAndroidOffscreenEditText::setTypeface(const QString & name, int style) { if (QJniObject * view = offscreenView()) { view->callParamVoid("setTypeface", "Ljava/lang/String;I", QJniLocalRef(name).jObject(), jint(style)); } }
void QAndroidDialog::showMessage( const QString & title, const QString & explanation, const QString & positive_button_text, const QString & negative_button_text, const QString & neutral_button_text, bool pause, bool lock_rotation) { if (!isInteractiveMode()) { qDebug() << "Dialog was not shown due to non-interactive mode"; qDebug() << "title: \"" << title << "\""; qDebug() << "explanation: " << explanation << "\""; return; } if (dialog_helper_) { if (pause) { lock_rotation = true; } // TODO: We can't read or lock orientation when we don't have an activity. // Currently, we check it via customContextSet(), but this might not always be the right way. bool in_activity = !QAndroidQPAPluginGap::customContextSet(); int orientation = (lock_rotation && in_activity)? QAndroidScreenOrientation::getCurrentFixedOrientation(): -1; dialog_helper_->callParamVoid("showMessage", "Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZIZ", QJniLocalRef(title).jObject(), QJniLocalRef(explanation).jObject(), QJniLocalRef(positive_button_text).jObject(), QJniLocalRef(negative_button_text).jObject(), QJniLocalRef(neutral_button_text).jObject(), jboolean(pause), jint(orientation), jboolean(in_activity) ); } else { qCritical()<<"Failed to show message because DialogHelper instance not created!"; } }