mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-12 10:30:08 +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);
|
qInstallMessageHandler(DebugMessageHandler);
|
||||||
// Allow parameter interaction before we create the options model
|
// Allow parameter interaction before we create the options model
|
||||||
app.parameterSetup();
|
app.parameterSetup();
|
||||||
|
GUIUtil::LogQtInfo();
|
||||||
// Load GUI settings from QSettings
|
// Load GUI settings from QSettings
|
||||||
app.createOptionsModel(gArgs.GetBoolArg("-resetguisettings", false));
|
app.createOptionsModel(gArgs.GetBoolArg("-resetguisettings", false));
|
||||||
|
|
||||||
|
|
|
@ -44,14 +44,20 @@
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
#include <QFontDatabase>
|
#include <QFontDatabase>
|
||||||
#include <QFontMetrics>
|
#include <QFontMetrics>
|
||||||
|
#include <QGuiApplication>
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
|
#include <QList>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QProgressDialog>
|
#include <QProgressDialog>
|
||||||
|
#include <QScreen>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
#include <QSize>
|
||||||
|
#include <QString>
|
||||||
#include <QTextDocument> // for Qt::mightBeRichText
|
#include <QTextDocument> // for Qt::mightBeRichText
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include <QUrlQuery>
|
#include <QUrlQuery>
|
||||||
|
#include <QtGlobal>
|
||||||
|
|
||||||
#if defined(Q_OS_MAC)
|
#if defined(Q_OS_MAC)
|
||||||
|
|
||||||
|
@ -879,4 +885,23 @@ int TextWidth(const QFontMetrics& fm, const QString& text)
|
||||||
#endif
|
#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
|
} // namespace GUIUtil
|
||||||
|
|
|
@ -265,6 +265,11 @@ namespace GUIUtil
|
||||||
* In Qt 5.11 the QFontMetrics::horizontalAdvance() was introduced.
|
* In Qt 5.11 the QFontMetrics::horizontalAdvance() was introduced.
|
||||||
*/
|
*/
|
||||||
int TextWidth(const QFontMetrics& fm, const QString& text);
|
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
|
} // namespace GUIUtil
|
||||||
|
|
||||||
#endif // BITCOIN_QT_GUIUTIL_H
|
#endif // BITCOIN_QT_GUIUTIL_H
|
||||||
|
|
Loading…
Add table
Reference in a new issue