QML: Use new message manager API

That is more evocative. Also avoid some instances of popping up the
general messages pane, which should preferably only happen on direct
user interaction.

Task-number: QTCREATORBUG-24430
Change-Id: I69bb49f84c1486fd32b2a048ca4d76dceb6a0b2b
Reviewed-by: Knud Dollereder <knud.dollereder@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Eike Ziller
2020-12-17 10:30:03 +01:00
parent c2911ab7f1
commit 37a0ef29c0
4 changed files with 36 additions and 27 deletions

View File

@@ -196,11 +196,13 @@ void QmlPreviewConnectionManager::createPreviewClient()
m_qmlPreviewClient->announceError(path);
});
connect(m_qmlPreviewClient.data(), &QmlPreviewClient::errorReported,
this, [](const QString &error) {
Core::MessageManager::write("Error loading QML Live Preview:");
Core::MessageManager::write(error);
});
connect(m_qmlPreviewClient.data(),
&QmlPreviewClient::errorReported,
this,
[](const QString &error) {
Core::MessageManager::writeDisrupting("Error loading QML Live Preview:");
Core::MessageManager::writeSilently(error);
});
connect(m_qmlPreviewClient.data(), &QmlPreviewClient::fpsReported,
this, [this](const QmlPreviewClient::FpsInfo &frames) {

View File

@@ -119,7 +119,7 @@ static bool defaultFileClassifier(const QString &filename)
static void defaultFpsHandler(quint16 frames[8])
{
Core::MessageManager::write(QString::fromLatin1("QML preview: %1 fps").arg(frames[0]));
Core::MessageManager::writeSilently(QString::fromLatin1("QML preview: %1 fps").arg(frames[0]));
}
class QmlPreviewPluginPrivate : public QObject