mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Merge #13458: gui: Drop qt4 support
af6ac3b677doc: Remove mention of Qt4 from build docs (Wladimir J. van der Laan)462c71f71btest: Update travis to not test Qt4 anymore (Wladimir J. van der Laan)907f73bbc5gui: Remove QT_VERSION fallbacks for Qt < 5 (Wladimir J. van der Laan)bad068ad9fbuild: Build system changes to support only Qt5 (Wladimir J. van der Laan) Pull request description: Implements #8263. Qt4.x has been EOL since 2015, and at least Gentoo has, or is going to drop support for it. I wouldn't be surprised if other Linux distributions follow. This removes Qt4 detection from the build system, as well as removes all Qt4 fallbacks from the code. Turns out there's more than I expected: this is going to make maintenance of the GUI code, as well as adding new features significantly easier. (I know there's still some references left to qt4 in RPM and Debian build script, but I don't have the knowledge how to fix them) Tree-SHA512: d495924fd4dda6f6566ba44ee96be7cbe62e69ba1ca993b80a8449f78da852b7f1bd3e8200d57cfa1d72233c340eeff4596fb0032ecbddc715d99aea63817d3f
This commit is contained in:
@@ -55,13 +55,6 @@
|
||||
|
||||
#if defined(QT_STATICPLUGIN)
|
||||
#include <QtPlugin>
|
||||
#if QT_VERSION < 0x050000
|
||||
Q_IMPORT_PLUGIN(qcncodecs)
|
||||
Q_IMPORT_PLUGIN(qjpcodecs)
|
||||
Q_IMPORT_PLUGIN(qtwcodecs)
|
||||
Q_IMPORT_PLUGIN(qkrcodecs)
|
||||
Q_IMPORT_PLUGIN(qtaccessiblewidgets)
|
||||
#else
|
||||
#if QT_VERSION < 0x050400
|
||||
Q_IMPORT_PLUGIN(AccessibleFactory)
|
||||
#endif
|
||||
@@ -73,11 +66,6 @@ Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
|
||||
Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
#include <QTextCodec>
|
||||
#endif
|
||||
|
||||
// Declare meta types used for QMetaObject::invokeMethod
|
||||
Q_DECLARE_METATYPE(bool*)
|
||||
@@ -151,16 +139,6 @@ static void initTranslations(QTranslator &qtTranslatorBase, QTranslator &qtTrans
|
||||
}
|
||||
|
||||
/* qDebug() message handler --> debug.log */
|
||||
#if QT_VERSION < 0x050000
|
||||
void DebugMessageHandler(QtMsgType type, const char *msg)
|
||||
{
|
||||
if (type == QtDebugMsg) {
|
||||
LogPrint(BCLog::QT, "GUI: %s\n", msg);
|
||||
} else {
|
||||
LogPrintf("GUI: %s\n", msg);
|
||||
}
|
||||
}
|
||||
#else
|
||||
void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString &msg)
|
||||
{
|
||||
Q_UNUSED(context);
|
||||
@@ -170,7 +148,6 @@ void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, cons
|
||||
LogPrintf("GUI: %s\n", msg.toStdString());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Class encapsulating Bitcoin Core startup and shutdown.
|
||||
* Allows running startup and shutdown in a different thread from the UI thread.
|
||||
@@ -586,12 +563,6 @@ int main(int argc, char *argv[])
|
||||
// Do not refer to data directory yet, this can be overridden by Intro::pickDataDirectory
|
||||
|
||||
/// 1. Basic Qt initialization (not dependent on parameters or configuration)
|
||||
#if QT_VERSION < 0x050000
|
||||
// Internal string conversion is all UTF-8
|
||||
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
|
||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForTr());
|
||||
#endif
|
||||
|
||||
Q_INIT_RESOURCE(bitcoin);
|
||||
Q_INIT_RESOURCE(bitcoin_locale);
|
||||
|
||||
@@ -722,17 +693,12 @@ int main(int argc, char *argv[])
|
||||
/// 9. Main GUI initialization
|
||||
// Install global event filter that makes sure that long tooltips can be word-wrapped
|
||||
app.installEventFilter(new GUIUtil::ToolTipToRichTextFilter(TOOLTIP_WRAP_THRESHOLD, &app));
|
||||
#if QT_VERSION < 0x050000
|
||||
// Install qDebug() message handler to route to debug.log
|
||||
qInstallMsgHandler(DebugMessageHandler);
|
||||
#else
|
||||
#if defined(Q_OS_WIN)
|
||||
// Install global event filter for processing Windows session related Windows messages (WM_QUERYENDSESSION and WM_ENDSESSION)
|
||||
qApp->installNativeEventFilter(new WinShutdownMonitor());
|
||||
#endif
|
||||
// Install qDebug() message handler to route to debug.log
|
||||
qInstallMessageHandler(DebugMessageHandler);
|
||||
#endif
|
||||
// Allow parameter interaction before we create the options model
|
||||
app.parameterSetup();
|
||||
// Load GUI settings from QSettings
|
||||
@@ -753,7 +719,7 @@ int main(int argc, char *argv[])
|
||||
// so the GUI thread won't be held up.
|
||||
if (node->baseInitialize()) {
|
||||
app.requestInitialize();
|
||||
#if defined(Q_OS_WIN) && QT_VERSION >= 0x050000
|
||||
#if defined(Q_OS_WIN)
|
||||
WinShutdownMonitor::registerShutdownBlockReason(QObject::tr("%1 didn't yet exit safely...").arg(QObject::tr(PACKAGE_NAME)), (HWND)app.getMainWinId());
|
||||
#endif
|
||||
app.exec();
|
||||
|
||||
Reference in New Issue
Block a user