WinRT/QMessageBox: Default to QtWidgets-based dialog for rich text.

Change-Id: I071810cc5bc2773df9f6202c4547379d3ecd8b5c
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
This commit is contained in:
Friedemann Kleint 2015-12-04 10:55:56 +01:00
parent 98f326e9b8
commit dc0c68262e

View File

@ -37,6 +37,7 @@
#include "qwinrtmessagedialoghelper.h"
#include "qwinrttheme.h"
#include <QtGui/QTextDocument>
#include <QtCore/qfunctions_winrt.h>
#include <private/qeventdispatcher_winrt_p.h>
@ -110,6 +111,10 @@ bool QWinRTMessageDialogHelper::show(Qt::WindowFlags windowFlags, Qt::WindowModa
const QString informativeText = options->informativeText();
const QString title = options->windowTitle();
const QString text = informativeText.isEmpty() ? options->text() : (options->text() + QLatin1Char('\n') + informativeText);
if (Qt::mightBeRichText(text)) {
qWarning("Rich text detected, defaulting to QtWidgets-based dialog.");
return false;
}
HRESULT hr;
ComPtr<IMessageDialogFactory> dialogFactory;