Merge #13458: gui: Drop qt4 support

af6ac3b677454644364fd24d0df0c02ac9b8c8db doc: Remove mention of Qt4 from build docs (Wladimir J. van der Laan)
462c71f71b5d753bc8327ab833dea23679450ca3 test: Update travis to not test Qt4 anymore (Wladimir J. van der Laan)
907f73bbc5b6c98b01d7c6088a294dea66634a3f gui: Remove QT_VERSION fallbacks for Qt < 5 (Wladimir J. van der Laan)
bad068ad9f4bc60bfc10e27d4ffaec92d7df8491 build: 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
(cherry picked from commit dc53f7f2514026db8a28632371e73e6dbf858083)

# Conflicts:
#	.travis.yml
#	build-aux/m4/bitcoin_qt.m4
#	configure.ac
#	doc/build-osx.md
#	doc/build-unix.md
#	doc/dependencies.md
#	src/qt/README.md
#	src/qt/bitcoingui.cpp
#	src/qt/coincontroldialog.cpp
#	src/qt/dash.cpp
#	src/qt/guiutil.cpp
#	src/qt/macdockiconhandler.mm
#	src/qt/networkstyle.cpp
#	src/qt/openuridialog.cpp
#	src/qt/peertablemodel.cpp
#	src/qt/signverifymessagedialog.cpp
#	src/qt/test/wallettests.cpp
#	src/qt/transactionview.cpp
This commit is contained in:
Wladimir J. van der Laan 2018-06-24 15:56:00 +02:00 committed by 10xcryptodev
parent e0ff9af2b0
commit f3799930f9
No known key found for this signature in database
GPG Key ID: 5F636314819D02FA
24 changed files with 102 additions and 314 deletions

View File

@ -53,8 +53,8 @@ dnl CAUTION: Do not use this inside of a conditional.
AC_DEFUN([BITCOIN_QT_INIT],[ AC_DEFUN([BITCOIN_QT_INIT],[
dnl enable qt support dnl enable qt support
AC_ARG_WITH([gui], AC_ARG_WITH([gui],
[AS_HELP_STRING([--with-gui@<:@=no|qt4|qt5|auto@:>@], [AS_HELP_STRING([--with-gui@<:@=no|qt5|auto@:>@],
[build dash-qt GUI (default=auto, qt5 tried first)])], [build dash-qt GUI (default=auto)])],
[ [
bitcoin_qt_want_version=$withval bitcoin_qt_want_version=$withval
if test "x$bitcoin_qt_want_version" = xyes; then if test "x$bitcoin_qt_want_version" = xyes; then
@ -94,18 +94,17 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
fi fi
if test "x$use_pkgconfig" = xyes; then if test "x$use_pkgconfig" = xyes; then
BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG([$2])]) BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG])
else else
BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG]) BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG])
fi fi
dnl This is ugly and complicated. Yuck. Works as follows: dnl This is ugly and complicated. Yuck. Works as follows:
dnl We can't discern whether Qt4 builds are static or not. For Qt5, we can dnl For Qt5, we can check a header to find out whether Qt is build
dnl check a header to find out. When Qt is built statically, some plugins must dnl statically. When Qt is built statically, some plugins must be linked into
dnl be linked into the final binary as well. These plugins have changed between dnl the final binary as well.
dnl Qt4 and Qt5. With Qt5, languages moved into core and the WindowsIntegration dnl With Qt5, languages moved into core and the WindowsIntegration plugin was
dnl plugin was added. Since we can't tell if Qt4 is static or not, it is dnl added.
dnl assumed for windows builds.
dnl _BITCOIN_QT_CHECK_STATIC_PLUGINS does a quick link-check and appends the dnl _BITCOIN_QT_CHECK_STATIC_PLUGINS does a quick link-check and appends the
dnl results to QT_LIBS. dnl results to QT_LIBS.
BITCOIN_QT_CHECK([ BITCOIN_QT_CHECK([
@ -113,53 +112,40 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
TEMP_CXXFLAGS=$CXXFLAGS TEMP_CXXFLAGS=$CXXFLAGS
CPPFLAGS="$QT_INCLUDES $CPPFLAGS" CPPFLAGS="$QT_INCLUDES $CPPFLAGS"
CXXFLAGS="$PIC_FLAGS $CXXFLAGS" CXXFLAGS="$PIC_FLAGS $CXXFLAGS"
if test "x$bitcoin_qt_got_major_vers" = x5; then _BITCOIN_QT_IS_STATIC
_BITCOIN_QT_IS_STATIC if test "x$bitcoin_cv_static_qt" = xyes; then
if test "x$bitcoin_cv_static_qt" = xyes; then _BITCOIN_QT_FIND_STATIC_PLUGINS
_BITCOIN_QT_FIND_STATIC_PLUGINS AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static])
AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static]) AC_CACHE_CHECK(for Qt < 5.4, bitcoin_cv_need_acc_widget,[
AC_CACHE_CHECK(for Qt < 5.4, bitcoin_cv_need_acc_widget,[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <QtCore/qconfig.h>
#include <QtCore/qconfig.h> #ifndef QT_VERSION
#ifndef QT_VERSION # include <QtCore/qglobal.h>
# include <QtCore/qglobal.h> #endif
#endif ]],
]], [[
[[ #if QT_VERSION >= 0x050400
#if QT_VERSION >= 0x050400 choke
choke #endif
#endif ]])],
]])], [bitcoin_cv_need_acc_widget=yes],
[bitcoin_cv_need_acc_widget=yes], [bitcoin_cv_need_acc_widget=no])
[bitcoin_cv_need_acc_widget=no]) ])
]) if test "x$bitcoin_cv_need_acc_widget" = xyes; then
if test "x$bitcoin_cv_need_acc_widget" = xyes; then _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(AccessibleFactory)], [-lqtaccessiblewidgets])
_BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(AccessibleFactory)], [-lqtaccessiblewidgets])
fi
_BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QMinimalIntegrationPlugin)],[-lqminimal])
AC_DEFINE(QT_QPA_PLATFORM_MINIMAL, 1, [Define this symbol if the minimal qt platform exists])
if test "x$TARGET_OS" = xwindows; then
_BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)],[-lqwindows])
AC_DEFINE(QT_QPA_PLATFORM_WINDOWS, 1, [Define this symbol if the qt platform is windows])
elif test "x$TARGET_OS" = xlinux; then
_BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)],[-lqxcb -lxcb-static])
AC_DEFINE(QT_QPA_PLATFORM_XCB, 1, [Define this symbol if the qt platform is xcb])
elif test "x$TARGET_OS" = xdarwin; then
AX_CHECK_LINK_FLAG([[-framework IOKit]],[QT_LIBS="$QT_LIBS -framework IOKit"],[AC_MSG_ERROR(could not iokit framework)])
_BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)],[-lqcocoa])
AC_DEFINE(QT_QPA_PLATFORM_COCOA, 1, [Define this symbol if the qt platform is cocoa])
fi
fi fi
else _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QMinimalIntegrationPlugin)],[-lqminimal])
AC_DEFINE(QT_QPA_PLATFORM_MINIMAL, 1, [Define this symbol if the minimal qt platform exists])
if test "x$TARGET_OS" = xwindows; then if test "x$TARGET_OS" = xwindows; then
AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static]) _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)],[-lqwindows])
_BITCOIN_QT_CHECK_STATIC_PLUGINS([ AC_DEFINE(QT_QPA_PLATFORM_WINDOWS, 1, [Define this symbol if the qt platform is windows])
Q_IMPORT_PLUGIN(qcncodecs) elif test "x$TARGET_OS" = xlinux; then
Q_IMPORT_PLUGIN(qjpcodecs) _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)],[-lqxcb -lxcb-static])
Q_IMPORT_PLUGIN(qtwcodecs) AC_DEFINE(QT_QPA_PLATFORM_XCB, 1, [Define this symbol if the qt platform is xcb])
Q_IMPORT_PLUGIN(qkrcodecs) elif test "x$TARGET_OS" = xdarwin; then
Q_IMPORT_PLUGIN(AccessibleFactory)], AX_CHECK_LINK_FLAG([[-framework IOKit]],[QT_LIBS="$QT_LIBS -framework IOKit"],[AC_MSG_ERROR(could not iokit framework)])
[-lqcncodecs -lqjpcodecs -lqtwcodecs -lqkrcodecs -lqtaccessiblewidgets]) _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)],[-lqcocoa])
AC_DEFINE(QT_QPA_PLATFORM_COCOA, 1, [Define this symbol if the qt platform is cocoa])
fi fi
fi fi
CPPFLAGS=$TEMP_CPPFLAGS CPPFLAGS=$TEMP_CPPFLAGS
@ -167,9 +153,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
]) ])
if test "x$use_pkgconfig$qt_bin_path" = xyes; then if test "x$use_pkgconfig$qt_bin_path" = xyes; then
if test "x$bitcoin_qt_got_major_vers" = x5; then qt_bin_path="`$PKG_CONFIG --variable=host_bins Qt5Core 2>/dev/null`"
qt_bin_path="`$PKG_CONFIG --variable=host_bins Qt5Core 2>/dev/null`"
fi
fi fi
if test "x$use_hardening" != xno; then if test "x$use_hardening" != xno; then
@ -219,11 +203,11 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
]) ])
fi fi
BITCOIN_QT_PATH_PROGS([MOC], [moc-qt${bitcoin_qt_got_major_vers} moc${bitcoin_qt_got_major_vers} moc], $qt_bin_path) BITCOIN_QT_PATH_PROGS([MOC], [moc-qt5 moc5 moc], $qt_bin_path)
BITCOIN_QT_PATH_PROGS([UIC], [uic-qt${bitcoin_qt_got_major_vers} uic${bitcoin_qt_got_major_vers} uic], $qt_bin_path) BITCOIN_QT_PATH_PROGS([UIC], [uic-qt5 uic5 uic], $qt_bin_path)
BITCOIN_QT_PATH_PROGS([RCC], [rcc-qt${bitcoin_qt_got_major_vers} rcc${bitcoin_qt_got_major_vers} rcc], $qt_bin_path) BITCOIN_QT_PATH_PROGS([RCC], [rcc-qt5 rcc5 rcc], $qt_bin_path)
BITCOIN_QT_PATH_PROGS([LRELEASE], [lrelease-qt${bitcoin_qt_got_major_vers} lrelease${bitcoin_qt_got_major_vers} lrelease], $qt_bin_path) BITCOIN_QT_PATH_PROGS([LRELEASE], [lrelease-qt5 lrelease5 lrelease], $qt_bin_path)
BITCOIN_QT_PATH_PROGS([LUPDATE], [lupdate-qt${bitcoin_qt_got_major_vers} lupdate${bitcoin_qt_got_major_vers} lupdate],$qt_bin_path, yes) BITCOIN_QT_PATH_PROGS([LUPDATE], [lupdate-qt5 lupdate5 lupdate],$qt_bin_path, yes)
BITCOIN_QT_CHECK([ BITCOIN_QT_CHECK([
AC_CACHE_CHECK([whether $RCC accepts --format-version option], AC_CACHE_CHECK([whether $RCC accepts --format-version option],
@ -277,7 +261,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
],[ ],[
bitcoin_enable_qt=no bitcoin_enable_qt=no
]) ])
AC_MSG_RESULT([$bitcoin_enable_qt (Qt${bitcoin_qt_got_major_vers})]) AC_MSG_RESULT([$bitcoin_enable_qt (Qt5)])
AC_SUBST(QT_PIE_FLAGS) AC_SUBST(QT_PIE_FLAGS)
AC_SUBST(QT_INCLUDES) AC_SUBST(QT_INCLUDES)
@ -287,7 +271,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
AC_SUBST(QT_DBUS_LIBS) AC_SUBST(QT_DBUS_LIBS)
AC_SUBST(QT_TEST_INCLUDES) AC_SUBST(QT_TEST_INCLUDES)
AC_SUBST(QT_TEST_LIBS) AC_SUBST(QT_TEST_LIBS)
AC_SUBST(QT_SELECT, qt${bitcoin_qt_got_major_vers}) AC_SUBST(QT_SELECT, qt5)
AC_SUBST(MOC_DEFS) AC_SUBST(MOC_DEFS)
]) ])
@ -316,7 +300,7 @@ AC_DEFUN([_BITCOIN_QT_CHECK_QT5],[
])]) ])])
dnl Internal. Check if the linked version of Qt was built as static libs. dnl Internal. Check if the linked version of Qt was built as static libs.
dnl Requires: Qt5. This check cannot determine if Qt4 is static. dnl Requires: Qt5.
dnl Requires: INCLUDES and LIBS must be populated as necessary. dnl Requires: INCLUDES and LIBS must be populated as necessary.
dnl Output: bitcoin_cv_static_qt=yes|no dnl Output: bitcoin_cv_static_qt=yes|no
dnl Output: Defines QT_STATICPLUGIN if plugins are static. dnl Output: Defines QT_STATICPLUGIN if plugins are static.
@ -361,58 +345,50 @@ AC_DEFUN([_BITCOIN_QT_CHECK_STATIC_PLUGINS],[
]) ])
dnl Internal. Find paths necessary for linking qt static plugins dnl Internal. Find paths necessary for linking qt static plugins
dnl Inputs: bitcoin_qt_got_major_vers. 4 or 5.
dnl Inputs: qt_plugin_path. optional. dnl Inputs: qt_plugin_path. optional.
dnl Outputs: QT_LIBS is appended dnl Outputs: QT_LIBS is appended
AC_DEFUN([_BITCOIN_QT_FIND_STATIC_PLUGINS],[ AC_DEFUN([_BITCOIN_QT_FIND_STATIC_PLUGINS],[
if test "x$bitcoin_qt_got_major_vers" = x5; then if test "x$qt_plugin_path" != x; then
if test "x$qt_plugin_path" != x; then QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms"
QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms" if test -d "$qt_plugin_path/accessible"; then
if test -d "$qt_plugin_path/accessible"; then QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
fi
fi fi
if test "x$use_pkgconfig" = xyes; then fi
: dnl if test "x$use_pkgconfig" = xyes; then
m4_ifdef([PKG_CHECK_MODULES],[ : dnl
PKG_CHECK_MODULES([QTPLATFORM], [Qt5PlatformSupport], [QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"]) m4_ifdef([PKG_CHECK_MODULES],[
if test "x$TARGET_OS" = xlinux; then PKG_CHECK_MODULES([QTPLATFORM], [Qt5PlatformSupport], [QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"])
PKG_CHECK_MODULES([X11XCB], [x11-xcb], [QT_LIBS="$X11XCB_LIBS $QT_LIBS"]) if test "x$TARGET_OS" = xlinux; then
if ${PKG_CONFIG} --exists "Qt5Core >= 5.5" 2>/dev/null; then PKG_CHECK_MODULES([X11XCB], [x11-xcb], [QT_LIBS="$X11XCB_LIBS $QT_LIBS"])
PKG_CHECK_MODULES([QTXCBQPA], [Qt5XcbQpa], [QT_LIBS="$QTXCBQPA_LIBS $QT_LIBS"]) if ${PKG_CONFIG} --exists "Qt5Core >= 5.5" 2>/dev/null; then
fi PKG_CHECK_MODULES([QTXCBQPA], [Qt5XcbQpa], [QT_LIBS="$QTXCBQPA_LIBS $QT_LIBS"])
elif test "x$TARGET_OS" = xdarwin; then
PKG_CHECK_MODULES([QTPRINT], [Qt5PrintSupport], [QT_LIBS="$QTPRINT_LIBS $QT_LIBS"])
fi fi
]) elif test "x$TARGET_OS" = xdarwin; then
else PKG_CHECK_MODULES([QTPRINT], [Qt5PrintSupport], [QT_LIBS="$QTPRINT_LIBS $QT_LIBS"])
if test "x$TARGET_OS" = xwindows; then fi
AC_CACHE_CHECK(for Qt >= 5.6, bitcoin_cv_need_platformsupport,[ ])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ else
#include <QtCore/qconfig.h> if test "x$TARGET_OS" = xwindows; then
#ifndef QT_VERSION AC_CACHE_CHECK(for Qt >= 5.6, bitcoin_cv_need_platformsupport,[
# include <QtCore/qglobal.h> AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#endif #include <QtCore/qconfig.h>
]], #ifndef QT_VERSION
[[ # include <QtCore/qglobal.h>
#if QT_VERSION < 0x050600 #endif
choke ]],
#endif [[
]])], #if QT_VERSION < 0x050600
[bitcoin_cv_need_platformsupport=yes], choke
[bitcoin_cv_need_platformsupport=no]) #endif
]) ]])],
if test "x$bitcoin_cv_need_platformsupport" = xyes; then [bitcoin_cv_need_platformsupport=yes],
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}PlatformSupport],[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}PlatformSupport not found))) [bitcoin_cv_need_platformsupport=no])
fi ])
if test "x$bitcoin_cv_need_platformsupport" = xyes; then
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}PlatformSupport],[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}PlatformSupport not found)))
fi fi
fi fi
else fi
if test "x$qt_plugin_path" != x; then
QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
QT_LIBS="$QT_LIBS -L$qt_plugin_path/codecs"
fi
fi
]) ])
dnl Internal. Find Qt libraries using pkg-config. dnl Internal. Find Qt libraries using pkg-config.
@ -421,38 +397,14 @@ dnl first.
dnl Inputs: $1: If bitcoin_qt_want_version is "auto", check for this version dnl Inputs: $1: If bitcoin_qt_want_version is "auto", check for this version
dnl first. dnl first.
dnl Outputs: All necessary QT_* variables are set. dnl Outputs: All necessary QT_* variables are set.
dnl Outputs: bitcoin_qt_got_major_vers is set to "4" or "5".
dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no. dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no.
AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG],[ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG],[
m4_ifdef([PKG_CHECK_MODULES],[ m4_ifdef([PKG_CHECK_MODULES],[
auto_priority_version=$1 QT_LIB_PREFIX=Qt5
if test "x$auto_priority_version" = x; then
auto_priority_version=qt5
fi
if test "x$bitcoin_qt_want_version" = xqt5 || ( test "x$bitcoin_qt_want_version" = xauto && test "x$auto_priority_version" = xqt5 ); then
QT_LIB_PREFIX=Qt5
bitcoin_qt_got_major_vers=5
else
QT_LIB_PREFIX=Qt
bitcoin_qt_got_major_vers=4
fi
qt5_modules="Qt5Core Qt5Gui Qt5Network Qt5Widgets" qt5_modules="Qt5Core Qt5Gui Qt5Network Qt5Widgets"
qt4_modules="QtCore QtGui QtNetwork"
BITCOIN_QT_CHECK([ BITCOIN_QT_CHECK([
if test "x$bitcoin_qt_want_version" = xqt5 || ( test "x$bitcoin_qt_want_version" = xauto && test "x$auto_priority_version" = xqt5 ); then PKG_CHECK_MODULES([QT5], [$qt5_modules], [QT_INCLUDES="$QT5_CFLAGS"; QT_LIBS="$QT5_LIBS" have_qt=yes],[have_qt=no])
PKG_CHECK_MODULES([QT5], [$qt5_modules], [QT_INCLUDES="$QT5_CFLAGS"; QT_LIBS="$QT5_LIBS" have_qt=yes],[have_qt=no])
elif test "x$bitcoin_qt_want_version" = xqt4 || ( test "x$bitcoin_qt_want_version" = xauto && test "x$auto_priority_version" = xqt4 ); then
PKG_CHECK_MODULES([QT4], [$qt4_modules], [QT_INCLUDES="$QT4_CFLAGS"; QT_LIBS="$QT4_LIBS" ; have_qt=yes], [have_qt=no])
fi
dnl qt version is set to 'auto' and the preferred version wasn't found. Now try the other.
if test "x$have_qt" = xno && test "x$bitcoin_qt_want_version" = xauto; then
if test "x$auto_priority_version" = xqt5; then
PKG_CHECK_MODULES([QT4], [$qt4_modules], [QT_INCLUDES="$QT4_CFLAGS"; QT_LIBS="$QT4_LIBS" ; have_qt=yes; QT_LIB_PREFIX=Qt; bitcoin_qt_got_major_vers=4], [have_qt=no])
else
PKG_CHECK_MODULES([QT5], [$qt5_modules], [QT_INCLUDES="$QT5_CFLAGS"; QT_LIBS="$QT5_LIBS" ; have_qt=yes; QT_LIB_PREFIX=Qt5; bitcoin_qt_got_major_vers=5], [have_qt=no])
fi
fi
if test "x$have_qt" != xyes; then if test "x$have_qt" != xyes; then
have_qt=no have_qt=no
BITCOIN_QT_FAIL([Qt dependencies not found]) BITCOIN_QT_FAIL([Qt dependencies not found])
@ -473,7 +425,6 @@ dnl from the discovered headers.
dnl Inputs: bitcoin_qt_want_version (from --with-gui=). The version to use. dnl Inputs: bitcoin_qt_want_version (from --with-gui=). The version to use.
dnl If "auto", the version will be discovered by _BITCOIN_QT_CHECK_QT5. dnl If "auto", the version will be discovered by _BITCOIN_QT_CHECK_QT5.
dnl Outputs: All necessary QT_* variables are set. dnl Outputs: All necessary QT_* variables are set.
dnl Outputs: bitcoin_qt_got_major_vers is set to "4" or "5".
dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no. dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no.
AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[
TEMP_CPPFLAGS="$CPPFLAGS" TEMP_CPPFLAGS="$CPPFLAGS"
@ -495,13 +446,7 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[
if test "x$bitcoin_qt_want_version" = xauto; then if test "x$bitcoin_qt_want_version" = xauto; then
_BITCOIN_QT_CHECK_QT5 _BITCOIN_QT_CHECK_QT5
fi fi
if test "x$bitcoin_cv_qt5" = xyes || test "x$bitcoin_qt_want_version" = xqt5; then QT_LIB_PREFIX=Qt5
QT_LIB_PREFIX=Qt5
bitcoin_qt_got_major_vers=5
else
QT_LIB_PREFIX=Qt
bitcoin_qt_got_major_vers=4
fi
]) ])
BITCOIN_QT_CHECK([ BITCOIN_QT_CHECK([
@ -523,9 +468,7 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Core] ,[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Core not found))) BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Core] ,[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Core not found)))
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Gui] ,[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Gui not found))) BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Gui] ,[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Gui not found)))
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Network],[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Network not found))) BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Network],[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Network not found)))
if test "x$bitcoin_qt_got_major_vers" = x5; then BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Widgets],[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Widgets not found)))
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Widgets],[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Widgets not found)))
fi
QT_LIBS="$LIBS" QT_LIBS="$LIBS"
LIBS="$TEMP_LIBS" LIBS="$TEMP_LIBS"
@ -551,4 +494,3 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[
CXXFLAGS="$TEMP_CXXFLAGS" CXXFLAGS="$TEMP_CXXFLAGS"
LIBS="$TEMP_LIBS" LIBS="$TEMP_LIBS"
]) ])

View File

@ -165,7 +165,7 @@ AC_ARG_ENABLE([lcov],
[enable lcov testing (default is no)])], [enable lcov testing (default is no)])],
[use_lcov=$enableval], [use_lcov=$enableval],
[use_lcov=no]) [use_lcov=no])
AC_ARG_ENABLE([lcov-branch-coverage], AC_ARG_ENABLE([lcov-branch-coverage],
[AS_HELP_STRING([--enable-lcov-branch-coverage], [AS_HELP_STRING([--enable-lcov-branch-coverage],
[enable lcov testing branch coverage (default is no)])], [enable lcov testing branch coverage (default is no)])],
@ -856,7 +856,7 @@ fi
BITCOIN_QT_INIT BITCOIN_QT_INIT
dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus
BITCOIN_QT_CONFIGURE([$use_pkgconfig], [qt5]) BITCOIN_QT_CONFIGURE([$use_pkgconfig])
if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench = xnonononono; then if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench = xnonononono; then
use_boost=no use_boost=no
@ -1442,12 +1442,11 @@ case ${OS} in
;; ;;
esac esac
echo echo
echo "Options used to compile and link:" echo "Options used to compile and link:"
echo " with wallet = $enable_wallet" echo " with wallet = $enable_wallet"
echo " with gui / qt = $bitcoin_enable_qt" echo " with gui / qt = $bitcoin_enable_qt"
if test x$bitcoin_enable_qt != xno; then if test x$bitcoin_enable_qt != xno; then
echo " qt version = $bitcoin_qt_got_major_vers"
echo " with qr = $use_qr" echo " with qr = $use_qr"
fi fi
echo " with zmq = $use_zmq" echo " with zmq = $use_zmq"
@ -1459,7 +1458,7 @@ echo " debug enabled = $enable_debug"
echo " crash hooks enabled = $enable_crashhooks" echo " crash hooks enabled = $enable_crashhooks"
echo " miner enabled = $enable_miner" echo " miner enabled = $enable_miner"
echo " werror = $enable_werror" echo " werror = $enable_werror"
echo echo
echo " target os = $TARGET_OS" echo " target os = $TARGET_OS"
echo " build os = $BUILD_OS" echo " build os = $BUILD_OS"
echo echo
@ -1470,4 +1469,4 @@ echo " CXX = $CXX"
echo " CXXFLAGS = $CXXFLAGS" echo " CXXFLAGS = $CXXFLAGS"
echo " LDFLAGS = $LDFLAGS" echo " LDFLAGS = $LDFLAGS"
echo " ARFLAGS = $ARFLAGS" echo " ARFLAGS = $ARFLAGS"
echo echo

View File

@ -141,13 +141,8 @@ void AddressBookPage::setModel(AddressTableModel *_model)
ui->tableView->sortByColumn(0, Qt::AscendingOrder); ui->tableView->sortByColumn(0, Qt::AscendingOrder);
// Set column widths // Set column widths
#if QT_VERSION < 0x050000
ui->tableView->horizontalHeader()->setResizeMode(AddressTableModel::Label, QHeaderView::Stretch);
ui->tableView->horizontalHeader()->setResizeMode(AddressTableModel::Address, QHeaderView::ResizeToContents);
#else
ui->tableView->horizontalHeader()->setSectionResizeMode(AddressTableModel::Label, QHeaderView::Stretch); ui->tableView->horizontalHeader()->setSectionResizeMode(AddressTableModel::Label, QHeaderView::Stretch);
ui->tableView->horizontalHeader()->setSectionResizeMode(AddressTableModel::Address, QHeaderView::ResizeToContents); ui->tableView->horizontalHeader()->setSectionResizeMode(AddressTableModel::Address, QHeaderView::ResizeToContents);
#endif
connect(ui->tableView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), connect(ui->tableView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
this, SLOT(selectionChanged())); this, SLOT(selectionChanged()));

View File

@ -52,9 +52,7 @@ public:
g_connman->GetBanned(banMap); g_connman->GetBanned(banMap);
cachedBanlist.clear(); cachedBanlist.clear();
#if QT_VERSION >= 0x040700
cachedBanlist.reserve(banMap.size()); cachedBanlist.reserve(banMap.size());
#endif
for (const auto& entry : banMap) for (const auto& entry : banMap)
{ {
CCombinedBan banEntry; CCombinedBan banEntry;

View File

@ -55,14 +55,8 @@
#include <QStyle> #include <QStyle>
#include <QTimer> #include <QTimer>
#include <QToolBar> #include <QToolBar>
#include <QVBoxLayout>
#if QT_VERSION < 0x050000
#include <QTextDocument>
#include <QUrl>
#else
#include <QUrlQuery> #include <QUrlQuery>
#endif #include <QVBoxLayout>
const std::string BitcoinGUI::DEFAULT_UIPLATFORM = const std::string BitcoinGUI::DEFAULT_UIPLATFORM =
#if defined(Q_OS_MAC) #if defined(Q_OS_MAC)
@ -152,12 +146,6 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *_platformStyle, const NetworkStyle *
setWindowIcon(networkStyle->getTrayAndWindowIcon()); setWindowIcon(networkStyle->getTrayAndWindowIcon());
setWindowTitle(windowTitle); setWindowTitle(windowTitle);
#if defined(Q_OS_MAC) && QT_VERSION < 0x050000
// This property is not implemented in Qt 5. Setting it has no effect.
// A replacement API (QtMacUnifiedToolBar) is available in QtMacExtras.
setUnifiedTitleAndToolBarOnMac(true);
#endif
rpcConsole = new RPCConsole(_platformStyle, 0); rpcConsole = new RPCConsole(_platformStyle, 0);
helpMessageDialog = new HelpMessageDialog(this, HelpMessageDialog::cmdline); helpMessageDialog = new HelpMessageDialog(this, HelpMessageDialog::cmdline);
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
@ -232,7 +220,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *_platformStyle, const NetworkStyle *
// Override style sheet for progress bar for styles that have a segmented progress bar, // Override style sheet for progress bar for styles that have a segmented progress bar,
// as they make the text unreadable (workaround for issue #1071) // as they make the text unreadable (workaround for issue #1071)
// See https://qt-project.org/doc/qt-4.8/gallery.html // See https://doc.qt.io/qt-5/gallery.html
QString curStyle = QApplication::style()->metaObject()->className(); QString curStyle = QApplication::style()->metaObject()->className();
if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle") if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle")
{ {

View File

@ -114,11 +114,7 @@ CoinControlDialog::CoinControlDialog(const PlatformStyle *_platformStyle, QWidge
connect(ui->treeWidget, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this, SLOT(viewItemChanged(QTreeWidgetItem*, int))); connect(ui->treeWidget, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this, SLOT(viewItemChanged(QTreeWidgetItem*, int)));
// click on header // click on header
#if QT_VERSION < 0x050000
ui->treeWidget->header()->setClickable(true);
#else
ui->treeWidget->header()->setSectionsClickable(true); ui->treeWidget->header()->setSectionsClickable(true);
#endif
connect(ui->treeWidget->header(), SIGNAL(sectionClicked(int)), this, SLOT(headerSectionClicked(int))); connect(ui->treeWidget->header(), SIGNAL(sectionClicked(int)), this, SLOT(headerSectionClicked(int)));
// ok button // ok button

View File

@ -59,13 +59,6 @@
#if defined(QT_STATICPLUGIN) #if defined(QT_STATICPLUGIN)
#include <QtPlugin> #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 #if QT_VERSION < 0x050400
Q_IMPORT_PLUGIN(AccessibleFactory) Q_IMPORT_PLUGIN(AccessibleFactory)
#endif #endif
@ -77,11 +70,6 @@ Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin); Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin);
#endif #endif
#endif #endif
#endif
#if QT_VERSION < 0x050000
#include <QTextCodec>
#endif
// Declare meta types used for QMetaObject::invokeMethod // Declare meta types used for QMetaObject::invokeMethod
Q_DECLARE_METATYPE(bool*) Q_DECLARE_METATYPE(bool*)
@ -154,16 +142,6 @@ static void initTranslations(QTranslator &qtTranslatorBase, QTranslator &qtTrans
} }
/* qDebug() message handler --> debug.log */ /* 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) void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString &msg)
{ {
Q_UNUSED(context); Q_UNUSED(context);
@ -173,7 +151,6 @@ void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, cons
LogPrintf("GUI: %s\n", msg.toStdString()); LogPrintf("GUI: %s\n", msg.toStdString());
} }
} }
#endif
/** Class encapsulating Dash Core startup and shutdown. /** Class encapsulating Dash Core startup and shutdown.
* Allows running startup and shutdown in a different thread from the UI thread. * Allows running startup and shutdown in a different thread from the UI thread.
@ -589,13 +566,7 @@ int main(int argc, char *argv[])
// Do not refer to data directory yet, this can be overridden by Intro::pickDataDirectory // Do not refer to data directory yet, this can be overridden by Intro::pickDataDirectory
/// 2. Basic Qt initialization (not dependent on parameters or configuration) /// 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(dash); Q_INIT_RESOURCE(dash);
Q_INIT_RESOURCE(dash_locale); Q_INIT_RESOURCE(dash_locale);
@ -718,17 +689,12 @@ int main(int argc, char *argv[])
/// 9. Main GUI initialization /// 9. Main GUI initialization
// Install global event filter that makes sure that long tooltips can be word-wrapped // Install global event filter that makes sure that long tooltips can be word-wrapped
app.installEventFilter(new GUIUtil::ToolTipToRichTextFilter(TOOLTIP_WRAP_THRESHOLD, &app)); 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) #if defined(Q_OS_WIN)
// Install global event filter for processing Windows session related Windows messages (WM_QUERYENDSESSION and WM_ENDSESSION) // Install global event filter for processing Windows session related Windows messages (WM_QUERYENDSESSION and WM_ENDSESSION)
qApp->installNativeEventFilter(new WinShutdownMonitor()); qApp->installNativeEventFilter(new WinShutdownMonitor());
#endif #endif
// Install qDebug() message handler to route to debug.log // Install qDebug() message handler to route to debug.log
qInstallMessageHandler(DebugMessageHandler); qInstallMessageHandler(DebugMessageHandler);
#endif
// Allow parameter interaction before we create the options model // Allow parameter interaction before we create the options model
app.parameterSetup(); app.parameterSetup();
// Load GUI settings from QSettings // Load GUI settings from QSettings
@ -749,7 +715,7 @@ int main(int argc, char *argv[])
// so the GUI thread won't be held up. // so the GUI thread won't be held up.
if (BitcoinCore::baseInitialize()) { if (BitcoinCore::baseInitialize()) {
app.requestInitialize(); 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()); WinShutdownMonitor::registerShutdownBlockReason(QObject::tr("%1 didn't yet exit safely...").arg(QObject::tr(PACKAGE_NAME)), (HWND)app.getMainWinId());
#endif #endif
app.exec(); app.exec();

View File

@ -51,13 +51,9 @@
#include <QSettings> #include <QSettings>
#include <QTextDocument> // for Qt::mightBeRichText #include <QTextDocument> // for Qt::mightBeRichText
#include <QThread> #include <QThread>
#include <QUrlQuery>
#include <QMouseEvent> #include <QMouseEvent>
#if QT_VERSION < 0x050000
#include <QUrl>
#else
#include <QUrlQuery>
#endif
#if QT_VERSION >= 0x50200 #if QT_VERSION >= 0x50200
#include <QFontDatabase> #include <QFontDatabase>
@ -158,11 +154,7 @@ QFont fixedPitchFont()
return QFontDatabase::systemFont(QFontDatabase::FixedFont); return QFontDatabase::systemFont(QFontDatabase::FixedFont);
#else #else
QFont font("Monospace"); QFont font("Monospace");
#if QT_VERSION >= 0x040800
font.setStyleHint(QFont::Monospace); font.setStyleHint(QFont::Monospace);
#else
font.setStyleHint(QFont::TypeWriter);
#endif
return font; return font;
#endif #endif
} }
@ -190,12 +182,10 @@ void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent, bool fAllow
parent->setFocusProxy(widget); parent->setFocusProxy(widget);
widget->setFont(fixedPitchFont()); widget->setFont(fixedPitchFont());
#if QT_VERSION >= 0x040700
// We don't want translators to use own addresses in translations // We don't want translators to use own addresses in translations
// and this is the only place, where this address is supplied. // and this is the only place, where this address is supplied.
widget->setPlaceholderText(QObject::tr("Enter a Dash address (e.g. %1)").arg( widget->setPlaceholderText(QObject::tr("Enter a Dash address (e.g. %1)").arg(
QString::fromStdString(DummyAddress(Params())))); QString::fromStdString(DummyAddress(Params()))));
#endif
widget->setValidator(new BitcoinAddressEntryValidator(parent, fAllowURI)); widget->setValidator(new BitcoinAddressEntryValidator(parent, fAllowURI));
widget->setCheckValidator(new BitcoinAddressCheckValidator(parent)); widget->setCheckValidator(new BitcoinAddressCheckValidator(parent));
} }
@ -223,12 +213,8 @@ bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out)
} }
rv.amount = 0; rv.amount = 0;
#if QT_VERSION < 0x050000
QList<QPair<QString, QString> > items = uri.queryItems();
#else
QUrlQuery uriQuery(uri); QUrlQuery uriQuery(uri);
QList<QPair<QString, QString> > items = uriQuery.queryItems(); QList<QPair<QString, QString> > items = uriQuery.queryItems();
#endif
for (QList<QPair<QString, QString> >::iterator i = items.begin(); i != items.end(); i++) for (QList<QPair<QString, QString> >::iterator i = items.begin(); i != items.end(); i++)
{ {
@ -334,11 +320,7 @@ bool isDust(const QString& address, const CAmount& amount)
QString HtmlEscape(const QString& str, bool fMultiLine) QString HtmlEscape(const QString& str, bool fMultiLine)
{ {
#if QT_VERSION < 0x050000
QString escaped = Qt::escape(str);
#else
QString escaped = str.toHtmlEscaped(); QString escaped = str.toHtmlEscaped();
#endif
escaped = escaped.replace(" ", "&nbsp;"); escaped = escaped.replace(" ", "&nbsp;");
if(fMultiLine) if(fMultiLine)
{ {
@ -380,11 +362,7 @@ QString getSaveFileName(QWidget *parent, const QString &caption, const QString &
QString myDir; QString myDir;
if(dir.isEmpty()) // Default to user documents location if(dir.isEmpty()) // Default to user documents location
{ {
#if QT_VERSION < 0x050000
myDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
#else
myDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); myDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
#endif
} }
else else
{ {
@ -430,11 +408,7 @@ QString getOpenFileName(QWidget *parent, const QString &caption, const QString &
QString myDir; QString myDir;
if(dir.isEmpty()) // Default to user documents location if(dir.isEmpty()) // Default to user documents location
{ {
#if QT_VERSION < 0x050000
myDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
#else
myDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); myDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
#endif
} }
else else
{ {
@ -611,11 +585,7 @@ void TableViewLastColumnResizingFixer::disconnectViewHeadersSignals()
// Refactored here for readability. // Refactored here for readability.
void TableViewLastColumnResizingFixer::setViewHeaderResizeMode(int logicalIndex, QHeaderView::ResizeMode resizeMode) void TableViewLastColumnResizingFixer::setViewHeaderResizeMode(int logicalIndex, QHeaderView::ResizeMode resizeMode)
{ {
#if QT_VERSION < 0x050000
tableView->horizontalHeader()->setResizeMode(logicalIndex, resizeMode);
#else
tableView->horizontalHeader()->setSectionResizeMode(logicalIndex, resizeMode); tableView->horizontalHeader()->setSectionResizeMode(logicalIndex, resizeMode);
#endif
} }
void TableViewLastColumnResizingFixer::resizeColumn(int nColumnIndex, int width) void TableViewLastColumnResizingFixer::resizeColumn(int nColumnIndex, int width)

View File

@ -283,7 +283,7 @@ namespace GUIUtil
void mouseReleaseEvent(QMouseEvent *event); void mouseReleaseEvent(QMouseEvent *event);
}; };
#if defined(Q_OS_MAC) && QT_VERSION >= 0x050000 #if defined(Q_OS_MAC)
// workaround for Qt OSX Bug: // workaround for Qt OSX Bug:
// https://bugreports.qt-project.org/browse/QTBUG-15631 // https://bugreports.qt-project.org/browse/QTBUG-15631
// QProgressBar uses around 10% CPU even when app is in background // QProgressBar uses around 10% CPU even when app is in background

View File

@ -7,10 +7,6 @@
#include <AppKit/AppKit.h> #include <AppKit/AppKit.h>
#include <objc/runtime.h> #include <objc/runtime.h>
#if QT_VERSION < 0x050000
extern void qt_mac_set_dock_menu(QMenu *);
#endif
static MacDockIconHandler *s_instance = nullptr; static MacDockIconHandler *s_instance = nullptr;
bool dockClickHandler(id self, SEL _cmd, ...) { bool dockClickHandler(id self, SEL _cmd, ...) {

View File

@ -85,13 +85,8 @@ NetworkStyle::NetworkStyle(const QString &_appName, const int iconColorHueShift,
rotateColors(splashImageImg, iconColorHueShift, iconColorSaturationReduction); rotateColors(splashImageImg, iconColorHueShift, iconColorSaturationReduction);
//convert back to QPixmap //convert back to QPixmap
#if QT_VERSION >= 0x040700
appIconPixmap.convertFromImage(appIconImg); appIconPixmap.convertFromImage(appIconImg);
splashImagePixmap.convertFromImage(splashImageImg); splashImagePixmap.convertFromImage(splashImageImg);
#else
appIconPixmap = QPixmap::fromImage(appIconImg);
splashImagePixmap = QPixmap::fromImage(splashImageImg);
#endif
} }
appIcon = QIcon(appIconPixmap); appIcon = QIcon(appIconPixmap);

View File

@ -16,9 +16,7 @@ OpenURIDialog::OpenURIDialog(QWidget *parent) :
ui(new Ui::OpenURIDialog) ui(new Ui::OpenURIDialog)
{ {
ui->setupUi(this); ui->setupUi(this);
#if QT_VERSION >= 0x040700
ui->uriEdit->setPlaceholderText("dash:"); ui->uriEdit->setPlaceholderText("dash:");
#endif
} }
OpenURIDialog::~OpenURIDialog() OpenURIDialog::~OpenURIDialog()

View File

@ -104,28 +104,16 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
/** check if the locale name consists of 2 parts (language_country) */ /** check if the locale name consists of 2 parts (language_country) */
if(langStr.contains("_")) if(langStr.contains("_"))
{ {
#if QT_VERSION >= 0x040800
/** display language strings as "native language - native country (locale name)", e.g. "Deutsch - Deutschland (de)" */ /** display language strings as "native language - native country (locale name)", e.g. "Deutsch - Deutschland (de)" */
ui->lang->addItem(locale.nativeLanguageName() + QString(" - ") + locale.nativeCountryName() + QString(" (") + langStr + QString(")"), QVariant(langStr)); ui->lang->addItem(locale.nativeLanguageName() + QString(" - ") + locale.nativeCountryName() + QString(" (") + langStr + QString(")"), QVariant(langStr));
#else
/** display language strings as "language - country (locale name)", e.g. "German - Germany (de)" */
ui->lang->addItem(QLocale::languageToString(locale.language()) + QString(" - ") + QLocale::countryToString(locale.country()) + QString(" (") + langStr + QString(")"), QVariant(langStr));
#endif
} }
else else
{ {
#if QT_VERSION >= 0x040800
/** display language strings as "native language (locale name)", e.g. "Deutsch (de)" */ /** display language strings as "native language (locale name)", e.g. "Deutsch (de)" */
ui->lang->addItem(locale.nativeLanguageName() + QString(" (") + langStr + QString(")"), QVariant(langStr)); ui->lang->addItem(locale.nativeLanguageName() + QString(" (") + langStr + QString(")"), QVariant(langStr));
#else
/** display language strings as "language (locale name)", e.g. "German (de)" */
ui->lang->addItem(QLocale::languageToString(locale.language()) + QString(" (") + langStr + QString(")"), QVariant(langStr));
#endif
} }
} }
#if QT_VERSION >= 0x040700
ui->thirdPartyTxUrls->setPlaceholderText("https://example.com/tx/%s"); ui->thirdPartyTxUrls->setPlaceholderText("https://example.com/tx/%s");
#endif
ui->unit->setModel(new BitcoinUnits(this)); ui->unit->setModel(new BitcoinUnits(this));

View File

@ -97,12 +97,10 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c
qWarning() << "PaymentRequestPlus::getMerchant: Payment request: certificate expired or not yet active: " << qCert; qWarning() << "PaymentRequestPlus::getMerchant: Payment request: certificate expired or not yet active: " << qCert;
return false; return false;
} }
#if QT_VERSION >= 0x050000
if (qCert.isBlacklisted()) { if (qCert.isBlacklisted()) {
qWarning() << "PaymentRequestPlus::getMerchant: Payment request: certificate blacklisted: " << qCert; qWarning() << "PaymentRequestPlus::getMerchant: Payment request: certificate blacklisted: " << qCert;
return false; return false;
} }
#endif
const unsigned char *data = (const unsigned char *)certChain.certificate(i).data(); const unsigned char *data = (const unsigned char *)certChain.certificate(i).data();
X509 *cert = d2i_X509(nullptr, &data, certChain.certificate(i).size()); X509 *cert = d2i_X509(nullptr, &data, certChain.certificate(i).size());
if (cert) if (cert)

View File

@ -41,12 +41,7 @@
#include <QSslSocket> #include <QSslSocket>
#include <QStringList> #include <QStringList>
#include <QTextDocument> #include <QTextDocument>
#if QT_VERSION < 0x050000
#include <QUrl>
#else
#include <QUrlQuery> #include <QUrlQuery>
#endif
const int BITCOIN_IPC_CONNECT_TIMEOUT = 1000; // milliseconds const int BITCOIN_IPC_CONNECT_TIMEOUT = 1000; // milliseconds
const QString BITCOIN_IPC_PREFIX("dash:"); const QString BITCOIN_IPC_PREFIX("dash:");
@ -100,11 +95,7 @@ static QList<QString> savedPaymentRequests;
static void ReportInvalidCertificate(const QSslCertificate& cert) static void ReportInvalidCertificate(const QSslCertificate& cert)
{ {
#if QT_VERSION < 0x050000
qDebug() << QString("%1: Payment server found an invalid certificate: ").arg(__func__) << cert.serialNumber() << cert.subjectInfo(QSslCertificate::CommonName) << cert.subjectInfo(QSslCertificate::OrganizationalUnitName);
#else
qDebug() << QString("%1: Payment server found an invalid certificate: ").arg(__func__) << cert.serialNumber() << cert.subjectInfo(QSslCertificate::CommonName) << cert.subjectInfo(QSslCertificate::DistinguishedNameQualifier) << cert.subjectInfo(QSslCertificate::OrganizationalUnitName); qDebug() << QString("%1: Payment server found an invalid certificate: ").arg(__func__) << cert.serialNumber() << cert.subjectInfo(QSslCertificate::CommonName) << cert.subjectInfo(QSslCertificate::DistinguishedNameQualifier) << cert.subjectInfo(QSslCertificate::OrganizationalUnitName);
#endif
} }
// //
@ -157,13 +148,11 @@ void PaymentServer::LoadRootCAs(X509_STORE* _store)
continue; continue;
} }
#if QT_VERSION >= 0x050000
// Blacklisted certificate // Blacklisted certificate
if (cert.isBlacklisted()) { if (cert.isBlacklisted()) {
ReportInvalidCertificate(cert); ReportInvalidCertificate(cert);
continue; continue;
} }
#endif
QByteArray certData = cert.toDer(); QByteArray certData = cert.toDer();
const unsigned char *data = (const unsigned char *)certData.data(); const unsigned char *data = (const unsigned char *)certData.data();
@ -408,11 +397,7 @@ void PaymentServer::handleURIOrFile(const QString& s)
if (s.startsWith(BITCOIN_IPC_PREFIX, Qt::CaseInsensitive)) // dash: URI if (s.startsWith(BITCOIN_IPC_PREFIX, Qt::CaseInsensitive)) // dash: URI
{ {
#if QT_VERSION < 0x050000
QUrl uri(s);
#else
QUrlQuery uri((QUrl(s))); QUrlQuery uri((QUrl(s)));
#endif
if (uri.hasQueryItem("r")) // payment request URI if (uri.hasQueryItem("r")) // payment request URI
{ {
QByteArray temp; QByteArray temp;

View File

@ -63,9 +63,7 @@ public:
std::vector<CNodeStats> vstats; std::vector<CNodeStats> vstats;
if(g_connman) if(g_connman)
g_connman->GetNodeStats(vstats); g_connman->GetNodeStats(vstats);
#if QT_VERSION >= 0x040700
cachedNodeStats.reserve(vstats.size()); cachedNodeStats.reserve(vstats.size());
#endif
for (const CNodeStats& nodestats : vstats) for (const CNodeStats& nodestats : vstats)
{ {
CNodeCombinedStats stats; CNodeCombinedStats stats;

View File

@ -16,9 +16,6 @@
#include <QMimeData> #include <QMimeData>
#include <QMouseEvent> #include <QMouseEvent>
#include <QPixmap> #include <QPixmap>
#if QT_VERSION < 0x050000
#include <QUrl>
#endif
#if defined(HAVE_CONFIG_H) #if defined(HAVE_CONFIG_H)
#include <config/dash-config.h> /* for USE_QRCODE */ #include <config/dash-config.h> /* for USE_QRCODE */

View File

@ -40,10 +40,6 @@
#include <QTimer> #include <QTimer>
#include <QStringList> #include <QStringList>
#if QT_VERSION < 0x050000
#include <QUrl>
#endif
// TODO: add a scrollback limit, as there is currently none // TODO: add a scrollback limit, as there is currently none
// TODO: make it possible to filter out categories (esp debug messages when implemented) // TODO: make it possible to filter out categories (esp debug messages when implemented)
// TODO: receive errors and debug messages through ClientModel // TODO: receive errors and debug messages through ClientModel

View File

@ -27,9 +27,7 @@ SendCoinsEntry::SendCoinsEntry(const PlatformStyle *_platformStyle, QWidget *par
if (platformStyle->getUseExtraSpacing()) if (platformStyle->getUseExtraSpacing())
ui->payToLayout->setSpacing(4); ui->payToLayout->setSpacing(4);
#if QT_VERSION >= 0x040700
ui->addAsLabel->setPlaceholderText(tr("Enter a label for this address to add it to your address book")); ui->addAsLabel->setPlaceholderText(tr("Enter a label for this address to add it to your address book"));
#endif
// These icons are needed on Mac also! // These icons are needed on Mac also!
ui->addressBookButton->setIcon(QIcon(":/icons/address-book")); ui->addressBookButton->setIcon(QIcon(":/icons/address-book"));

View File

@ -29,9 +29,7 @@ SignVerifyMessageDialog::SignVerifyMessageDialog(const PlatformStyle *_platformS
{ {
ui->setupUi(this); ui->setupUi(this);
#if QT_VERSION >= 0x040700
ui->signatureOut_SM->setPlaceholderText(tr("Click \"Sign Message\" to generate signature")); ui->signatureOut_SM->setPlaceholderText(tr("Click \"Sign Message\" to generate signature"));
#endif
#ifdef Q_OS_MAC // Icons on push buttons are very uncommon on Mac #ifdef Q_OS_MAC // Icons on push buttons are very uncommon on Mac
ui->signMessageButton_SM->setIcon(QIcon()); ui->signMessageButton_SM->setIcon(QIcon());

View File

@ -27,12 +27,6 @@
#if defined(QT_STATICPLUGIN) #if defined(QT_STATICPLUGIN)
#include <QtPlugin> #include <QtPlugin>
#if QT_VERSION < 0x050000
Q_IMPORT_PLUGIN(qcncodecs)
Q_IMPORT_PLUGIN(qjpcodecs)
Q_IMPORT_PLUGIN(qtwcodecs)
Q_IMPORT_PLUGIN(qkrcodecs)
#else
#if defined(QT_QPA_PLATFORM_MINIMAL) #if defined(QT_QPA_PLATFORM_MINIMAL)
Q_IMPORT_PLUGIN(QMinimalIntegrationPlugin); Q_IMPORT_PLUGIN(QMinimalIntegrationPlugin);
#endif #endif
@ -44,7 +38,6 @@ Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin); Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin);
#endif #endif
#endif #endif
#endif
extern void noui_connect(); extern void noui_connect();

View File

@ -113,16 +113,12 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa
hlayout->addWidget(typeWidget); hlayout->addWidget(typeWidget);
search_widget = new QLineEdit(this); search_widget = new QLineEdit(this);
#if QT_VERSION >= 0x040700
search_widget->setPlaceholderText(tr("Enter address, transaction id, or label to search")); search_widget->setPlaceholderText(tr("Enter address, transaction id, or label to search"));
#endif
search_widget->setObjectName("search_widget"); search_widget->setObjectName("search_widget");
hlayout->addWidget(search_widget); hlayout->addWidget(search_widget);
amountWidget = new QLineEdit(this); amountWidget = new QLineEdit(this);
#if QT_VERSION >= 0x040700
amountWidget->setPlaceholderText(tr("Min amount")); amountWidget->setPlaceholderText(tr("Min amount"));
#endif
if (platformStyle->getUseExtraSpacing()) { if (platformStyle->getUseExtraSpacing()) {
amountWidget->setFixedWidth(118); amountWidget->setFixedWidth(118);
} else { } else {

View File

@ -4,7 +4,7 @@
#include <qt/winshutdownmonitor.h> #include <qt/winshutdownmonitor.h>
#if defined(Q_OS_WIN) && QT_VERSION >= 0x050000 #if defined(Q_OS_WIN)
#include <init.h> #include <init.h>
#include <util.h> #include <util.h>

View File

@ -9,7 +9,6 @@
#include <QByteArray> #include <QByteArray>
#include <QString> #include <QString>
#if QT_VERSION >= 0x050000
#include <windef.h> // for HWND #include <windef.h> // for HWND
#include <QAbstractNativeEventFilter> #include <QAbstractNativeEventFilter>
@ -24,6 +23,5 @@ public:
static void registerShutdownBlockReason(const QString& strReason, const HWND& mainWinId); static void registerShutdownBlockReason(const QString& strReason, const HWND& mainWinId);
}; };
#endif #endif
#endif
#endif // BITCOIN_QT_WINSHUTDOWNMONITOR_H #endif // BITCOIN_QT_WINSHUTDOWNMONITOR_H