Skip to content

Commit

Permalink
qml: Add GUIUtil::LogQtInfo() call
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Aug 27, 2021
1 parent 2aa44e6 commit 6be715b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/qml/bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <noui.h>
#include <qml/nodemodel.h>
#include <qt/guiconstants.h>
#include <qt/guiutil.h>
#include <qt/initexecutor.h>
#include <util/system.h>
#include <util/translation.h>
Expand Down Expand Up @@ -113,6 +114,8 @@ int QmlGuiMain(int argc, char* argv[])
InitLogging(gArgs);
InitParameterInteraction(gArgs);

GUIUtil::LogQtInfo();

std::unique_ptr<interfaces::Node> node = interfaces::MakeNode(&node_context);
if (!node->baseInitialize()) {
// A dialog with detailed error will have been shown by InitError().
Expand Down
14 changes: 13 additions & 1 deletion src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifdef HAVE_CONFIG_H
#include <config/bitcoin-config.h>
#endif

#include <qt/guiutil.h>

#include <qt/bitcoinaddressvalidator.h>
Expand Down Expand Up @@ -61,6 +65,9 @@
#include <QThread>
#include <QUrlQuery>
#include <QtGlobal>
#if USE_QML
#include <QQuickStyle>
#endif // USE_QML

#include <cassert>
#include <chrono>
Expand Down Expand Up @@ -881,7 +888,7 @@ void LogQtInfo()
#else
const std::string plugin_link{"dynamic"};
#endif
LogPrintf("Qt %s (%s), plugin=%s (%s)\n", qVersion(), qt_link, QGuiApplication::platformName().toStdString(), plugin_link);
LogPrintf("Qt %s (%s), plugin=%s (%s)\n", qVersion(), qt_link, qGuiApp->platformName().toStdString(), plugin_link);
const auto static_plugins = QPluginLoader::staticPlugins();
if (static_plugins.empty()) {
LogPrintf("No static plugins.\n");
Expand All @@ -895,7 +902,12 @@ void LogQtInfo()
}
}

#if USE_QML
LogPrintf("QQuickStyle: %s\n", QQuickStyle::name().toStdString());
#else
LogPrintf("Style: %s / %s\n", QApplication::style()->objectName().toStdString(), QApplication::style()->metaObject()->className());
#endif // USE_QML

LogPrintf("System: %s, %s\n", QSysInfo::prettyProductName().toStdString(), QSysInfo::buildAbi().toStdString());
for (const QScreen* s : QGuiApplication::screens()) {
LogPrintf("Screen: %s %dx%d, pixel ratio=%.1f\n", s->name().toStdString(), s->size().width(), s->size().height(), s->devicePixelRatio());
Expand Down

0 comments on commit 6be715b

Please sign in to comment.