forked from qt-creator/qt-creator
try only show MessageBoxes if that is possible
Change-Id: I70f41b7a2936d6797895559530050e8de54b2913 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -120,15 +120,15 @@ static inline QString toHtml(const QString &t)
|
|||||||
|
|
||||||
static void displayHelpText(const QString &t)
|
static void displayHelpText(const QString &t)
|
||||||
{
|
{
|
||||||
if (Utils::HostOsInfo::isWindowsHost())
|
if (Utils::HostOsInfo::isWindowsHost() && qApp)
|
||||||
QMessageBox::information(0, QLatin1String(Core::Constants::IDE_DISPLAY_NAME), toHtml(t));
|
QMessageBox::information(nullptr, QLatin1String(Core::Constants::IDE_DISPLAY_NAME), toHtml(t));
|
||||||
else
|
else
|
||||||
qWarning("%s", qPrintable(t));
|
qWarning("%s", qPrintable(t));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void displayError(const QString &t)
|
static void displayError(const QString &t)
|
||||||
{
|
{
|
||||||
if (Utils::HostOsInfo::isWindowsHost())
|
if (Utils::HostOsInfo::isWindowsHost() && qApp)
|
||||||
QMessageBox::critical(0, QLatin1String(Core::Constants::IDE_DISPLAY_NAME), t);
|
QMessageBox::critical(0, QLatin1String(Core::Constants::IDE_DISPLAY_NAME), t);
|
||||||
else
|
else
|
||||||
qCritical("%s", qPrintable(t));
|
qCritical("%s", qPrintable(t));
|
||||||
|
Reference in New Issue
Block a user