mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-11 01:26:10 +01:00
qt: Add LogQtInfo() function
This commit is contained in:
parent
b931f61b9a
commit
a004673c54
3 changed files with 31 additions and 0 deletions
|
@ -556,6 +556,7 @@ int GuiMain(int argc, char* argv[])
|
|||
qInstallMessageHandler(DebugMessageHandler);
|
||||
// Allow parameter interaction before we create the options model
|
||||
app.parameterSetup();
|
||||
GUIUtil::LogQtInfo();
|
||||
// Load GUI settings from QSettings
|
||||
app.createOptionsModel(gArgs.GetBoolArg("-resetguisettings", false));
|
||||
|
||||
|
|
|
@ -44,14 +44,20 @@
|
|||
#include <QFont>
|
||||
#include <QFontDatabase>
|
||||
#include <QFontMetrics>
|
||||
#include <QGuiApplication>
|
||||
#include <QKeyEvent>
|
||||
#include <QLineEdit>
|
||||
#include <QList>
|
||||
#include <QMouseEvent>
|
||||
#include <QProgressDialog>
|
||||
#include <QScreen>
|
||||
#include <QSettings>
|
||||
#include <QSize>
|
||||
#include <QString>
|
||||
#include <QTextDocument> // for Qt::mightBeRichText
|
||||
#include <QThread>
|
||||
#include <QUrlQuery>
|
||||
#include <QtGlobal>
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
|
||||
|
@ -879,4 +885,23 @@ int TextWidth(const QFontMetrics& fm, const QString& text)
|
|||
#endif
|
||||
}
|
||||
|
||||
void LogQtInfo()
|
||||
{
|
||||
#ifdef QT_STATIC
|
||||
const std::string qt_link{"static"};
|
||||
#else
|
||||
const std::string qt_link{"dynamic"};
|
||||
#endif
|
||||
#ifdef QT_STATICPLUGIN
|
||||
const std::string plugin_link{"static"};
|
||||
#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("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());
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace GUIUtil
|
||||
|
|
|
@ -265,6 +265,11 @@ namespace GUIUtil
|
|||
* In Qt 5.11 the QFontMetrics::horizontalAdvance() was introduced.
|
||||
*/
|
||||
int TextWidth(const QFontMetrics& fm, const QString& text);
|
||||
|
||||
/**
|
||||
* Writes to debug.log short info about the used Qt and the host system.
|
||||
*/
|
||||
void LogQtInfo();
|
||||
} // namespace GUIUtil
|
||||
|
||||
#endif // BITCOIN_QT_GUIUTIL_H
|
||||
|
|
Loading…
Add table
Reference in a new issue