QML UI: adjust to modified logging API

appendTextToLog prepends the elapsed time which can be useful, so let's
not remove that but instead have it log to qDebug() instead.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-06-05 23:22:19 -07:00
parent 2d8489158d
commit 3b993fbaad
2 changed files with 10 additions and 14 deletions

View file

@ -120,8 +120,6 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false),
m_instance = this; m_instance = this;
m_lastDevicePixelRatio = qApp->devicePixelRatio(); m_lastDevicePixelRatio = qApp->devicePixelRatio();
connect(qobject_cast<QApplication *>(QApplication::instance()), &QApplication::applicationStateChanged, this, &QMLManager::applicationStateChanged); connect(qobject_cast<QApplication *>(QApplication::instance()), &QApplication::applicationStateChanged, this, &QMLManager::applicationStateChanged);
appendTextToLog(getUserAgent());
appendTextToLog(QStringLiteral("build with Qt Version %1, runtime from Qt Version %2").arg(QT_VERSION_STR).arg(qVersion()));
qDebug() << "Starting" << getUserAgent(); qDebug() << "Starting" << getUserAgent();
qDebug() << QStringLiteral("build with Qt Version %1, runtime from Qt Version %2").arg(QT_VERSION_STR).arg(qVersion()); qDebug() << QStringLiteral("build with Qt Version %1, runtime from Qt Version %2").arg(QT_VERSION_STR).arg(qVersion());
setStartPageText(tr("Starting...")); setStartPageText(tr("Starting..."));
@ -1270,8 +1268,7 @@ void QMLManager::appendTextToLog(const QString &newText)
{ {
if (!timer.isValid()) if (!timer.isValid())
timer.start(); timer.start();
m_logText += "\n" + QString::number(timer.elapsed() / 1000.0,'f', 3) + ": " + newText; qDebug() << QString::number(timer.elapsed() / 1000.0,'f', 3) + ": " + newText;
emit logTextChanged();
} }
bool QMLManager::locationServiceEnabled() const bool QMLManager::locationServiceEnabled() const

View file

@ -60,17 +60,16 @@ void QMLProfile::paint(QPainter *painter)
QTransform painterTransform = painter->transform(); QTransform painterTransform = painter->transform();
painterTransform.translate(-painterRect.width() * magicShiftFactor ,-painterRect.height() * magicShiftFactor); painterTransform.translate(-painterRect.width() * magicShiftFactor ,-painterRect.height() * magicShiftFactor);
#if PROFILE_SCALING_DEBUG #if defined(PROFILE_SCALING_DEBUG)
// some debugging messages to help adjust this in case the magic above is insufficient // some debugging messages to help adjust this in case the magic above is insufficient
QMLManager::instance()->appendTextToLog(QString("dpr %1 profile viewport %2 %3 painter viewport %4 %5").arg(dpr).arg(profileRect.width()).arg(profileRect.height()) qDebug() << QString("dpr %1 profile viewport %2 %3 painter viewport %4 %5").arg(dpr).arg(profileRect.width()).arg(profileRect.height())
.arg(painterRect.width()).arg(painterRect.height())); .arg(painterRect.width()).arg(painterRect.height());
QMLManager::instance()->appendTextToLog(QString("profile matrix %1 %2 %3 %4 %5 %6 %7 %8 %9").arg(profileTransform.m11()).arg(profileTransform.m12()).arg(profileTransform.m13()) qDebug() << QString("profile matrix %1 %2 %3 %4 %5 %6 %7 %8 %9").arg(profileTransform.m11()).arg(profileTransform.m12()).arg(profileTransform.m13())
.arg(profileTransform.m21()).arg(profileTransform.m22()).arg(profileTransform.m23()) .arg(profileTransform.m21()).arg(profileTransform.m22()).arg(profileTransform.m23())
.arg(profileTransform.m31()).arg(profileTransform.m32()).arg(profileTransform.m33())); .arg(profileTransform.m31()).arg(profileTransform.m32()).arg(profileTransform.m33()));
QMLManager::instance()->appendTextToLog(QString("painter matrix %1 %2 %3 %4 %5 %6 %7 %8 %9").arg(painterTransform.m11()).arg(painterTransform.m12()).arg(painterTransform.m13()) qDebug() << QString("painter matrix %1 %2 %3 %4 %5 %6 %7 %8 %9").arg(painterTransform.m11()).arg(painterTransform.m12()).arg(painterTransform.m13())
.arg(painterTransform.m21()).arg(painterTransform.m22()).arg(painterTransform.m23()) .arg(painterTransform.m21()).arg(painterTransform.m22()).arg(painterTransform.m23())
.arg(painterTransform.m31()).arg(painterTransform.m32()).arg(painterTransform.m33())); .arg(painterTransform.m31()).arg(painterTransform.m32()).arg(painterTransform.m33()));
qDebug() << "profile scaled by" << profileTransform.m11() << profileTransform.m22() << "and translated by" << profileTransform.m31() << profileTransform.m32();
qDebug() << "exist profile transform" << m_profileWidget->transform() << "painter transform" << painter->transform(); qDebug() << "exist profile transform" << m_profileWidget->transform() << "painter transform" << painter->transform();
#endif #endif
// apply the transformation // apply the transformation