Skip to content

Commit

Permalink
Merge bitcoin-core/gui#72: util: Log static plugins meta data and use…
Browse files Browse the repository at this point in the history
…d style

957895c util: Log static plugins meta data and style (Hennadii Stepanov)

Pull request description:

  This PR is a follow-up of bitcoin#17826, and adds additional info about the imported static plugins and the used style to the `debug.log` I found useful for testing (e.g., with `QT_QPA_PLATFORM`, `QT_QPA_PLATFORMTHEME`, `QT_STYLE_OVERRIDE` variables) and debugging issues (e.g., bitcoin#19716 (comment)).

  The excerpt from the log:
  ```
  2020-11-15T18:41:45Z [main] Bitcoin Core version v0.20.99.0-f0b933f78 (release build)
  2020-11-15T18:41:45Z [main] Qt 5.9.8 (static), plugin=xcb (static)
  2020-11-15T18:41:45Z [main] Static plugins:
  2020-11-15T18:41:45Z [main]  QXcbIntegrationPlugin, version 329992
  2020-11-15T18:41:45Z [main] Style: fusion / QFusionStyle
  ...
  ```

ACKs for top commit:
  jarolrod:
    ACK 957895c, Tested on macOS 11.1
  jonasschnelli:
    utACK 957895c

Tree-SHA512: 0e46db7560f380fbda8ce5e53faa5d419a456e90ca595ce46be8e3030c99d3a113586edad1988a97e9bf0279e944f975968ed1156817bc16723ed31c64850239
  • Loading branch information
jonasschnelli authored and knst committed Apr 6, 2024
1 parent 1dccb8b commit f971206
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@
#include <QFontDatabase>
#include <QFontMetrics>
#include <QGuiApplication>
#include <QJsonObject>
#include <QKeyEvent>
#include <QLineEdit>
#include <QList>
#include <QLocale>
#include <QMenu>
#include <QMouseEvent>
#include <QPluginLoader>
#include <QPointer>
#include <QProgressDialog>
#include <QScreen>
Expand Down Expand Up @@ -1814,6 +1816,20 @@ void LogQtInfo()
const std::string plugin_link{"dynamic"};
#endif
LogPrintf("Qt %s (%s), plugin=%s (%s)\n", qVersion(), qt_link, QGuiApplication::platformName().toStdString(), plugin_link);
const auto static_plugins = QPluginLoader::staticPlugins();
if (static_plugins.empty()) {
LogPrintf("No static plugins.\n");
} else {
LogPrintf("Static plugins:\n");
for (const QStaticPlugin& p : static_plugins) {
QJsonObject meta_data = p.metaData();
const std::string plugin_class = meta_data.take(QString("className")).toString().toStdString();
const int plugin_version = meta_data.take(QString("version")).toInt();
LogPrintf(" %s, version %d\n", plugin_class, plugin_version);
}
}

LogPrintf("Style: %s / %s\n", QApplication::style()->objectName().toStdString(), QApplication::style()->metaObject()->className());
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 f971206

Please sign in to comment.