mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
Merge #13458: gui: Drop qt4 support
af6ac3b677
doc: Remove mention of Qt4 from build docs (Wladimir J. van der Laan)462c71f71b
test: Update travis to not test Qt4 anymore (Wladimir J. van der Laan)907f73bbc5
gui: Remove QT_VERSION fallbacks for Qt < 5 (Wladimir J. van der Laan)bad068ad9f
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
This commit is contained in:
commit
dc53f7f251
30 changed files with 110 additions and 344 deletions
|
@ -35,8 +35,8 @@ env:
|
||||||
- HOST=i686-pc-linux-gnu PACKAGES="g++-multilib python3-zmq" DEP_OPTS="NO_QT=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++" CONFIG_SHELL="/bin/dash"
|
- HOST=i686-pc-linux-gnu PACKAGES="g++-multilib python3-zmq" DEP_OPTS="NO_QT=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++" CONFIG_SHELL="/bin/dash"
|
||||||
# x86_64 Linux (uses qt5 dev package instead of depends Qt to speed up build and avoid timeout)
|
# x86_64 Linux (uses qt5 dev package instead of depends Qt to speed up build and avoid timeout)
|
||||||
- HOST=x86_64-unknown-linux-gnu PACKAGES="python3-zmq qtbase5-dev qttools5-dev-tools protobuf-compiler libdbus-1-dev libharfbuzz-dev libprotobuf-dev" DEP_OPTS="NO_QT=1 NO_UPNP=1 DEBUG=1 ALLOW_HOST_PACKAGES=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --with-gui=qt5 --enable-glibc-back-compat --enable-reduce-exports CPPFLAGS=-DDEBUG_LOCKORDER"
|
- HOST=x86_64-unknown-linux-gnu PACKAGES="python3-zmq qtbase5-dev qttools5-dev-tools protobuf-compiler libdbus-1-dev libharfbuzz-dev libprotobuf-dev" DEP_OPTS="NO_QT=1 NO_UPNP=1 DEBUG=1 ALLOW_HOST_PACKAGES=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --with-gui=qt5 --enable-glibc-back-compat --enable-reduce-exports CPPFLAGS=-DDEBUG_LOCKORDER"
|
||||||
# Qt4 & system libs
|
# x86_64 Linux (Qt5 & system libs)
|
||||||
- HOST=x86_64-unknown-linux-gnu PACKAGES="python3-zmq qt4-dev-tools libssl1.0-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libprotobuf-dev protobuf-compiler libqrencode-dev xvfb libqt4-dev" NO_DEPENDS=1 NEED_XVFB=1 RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --enable-glibc-back-compat --enable-reduce-exports --with-gui=qt4 CPPFLAGS=-DDEBUG_LOCKORDER" DISPLAY=:99.0
|
- HOST=x86_64-unknown-linux-gnu PACKAGES="python3-zmq qtbase5-dev qttools5-dev-tools libssl1.0-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libprotobuf-dev protobuf-compiler libqrencode-dev" NO_DEPENDS=1 RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --enable-glibc-back-compat --enable-reduce-exports --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER"
|
||||||
# x86_64 Linux, No wallet
|
# x86_64 Linux, No wallet
|
||||||
- HOST=x86_64-unknown-linux-gnu PACKAGES="python3" DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports"
|
- HOST=x86_64-unknown-linux-gnu PACKAGES="python3" DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports"
|
||||||
# Cross-Mac
|
# Cross-Mac
|
||||||
|
@ -45,7 +45,7 @@ env:
|
||||||
before_install:
|
before_install:
|
||||||
- export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g")
|
- export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g")
|
||||||
install:
|
install:
|
||||||
- env | grep -E '^(CCACHE_|WINEDEBUG|DISPLAY|BOOST_TEST_RANDOM|CONFIG_SHELL)' | tee /tmp/env
|
- env | grep -E '^(CCACHE_|WINEDEBUG|BOOST_TEST_RANDOM|CONFIG_SHELL)' | tee /tmp/env
|
||||||
- if [[ $HOST = *-mingw32 ]]; then DOCKER_ADMIN="--cap-add SYS_ADMIN"; fi
|
- if [[ $HOST = *-mingw32 ]]; then DOCKER_ADMIN="--cap-add SYS_ADMIN"; fi
|
||||||
- DOCKER_ID=$(docker run $DOCKER_ADMIN -idt --mount type=bind,src=$TRAVIS_BUILD_DIR,dst=$TRAVIS_BUILD_DIR --mount type=bind,src=$CCACHE_DIR,dst=$CCACHE_DIR -w $TRAVIS_BUILD_DIR --env-file /tmp/env ubuntu:18.04)
|
- DOCKER_ID=$(docker run $DOCKER_ADMIN -idt --mount type=bind,src=$TRAVIS_BUILD_DIR,dst=$TRAVIS_BUILD_DIR --mount type=bind,src=$CCACHE_DIR,dst=$CCACHE_DIR -w $TRAVIS_BUILD_DIR --env-file /tmp/env ubuntu:18.04)
|
||||||
- DOCKER_EXEC () { docker exec $DOCKER_ID bash -c "cd $PWD && $*"; }
|
- DOCKER_EXEC () { docker exec $DOCKER_ID bash -c "cd $PWD && $*"; }
|
||||||
|
@ -58,8 +58,6 @@ before_script:
|
||||||
- if [ -n "$OSX_SDK" -a -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then tar -C depends/SDKs -xf depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi
|
- if [ -n "$OSX_SDK" -a -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then tar -C depends/SDKs -xf depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi
|
||||||
- if [[ $HOST = *-mingw32 ]]; then DOCKER_EXEC update-alternatives --set $HOST-g++ \$\(which $HOST-g++-posix\); fi
|
- if [[ $HOST = *-mingw32 ]]; then DOCKER_EXEC update-alternatives --set $HOST-g++ \$\(which $HOST-g++-posix\); fi
|
||||||
- if [ -z "$NO_DEPENDS" ]; then DOCKER_EXEC CONFIG_SHELL= make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS; fi
|
- if [ -z "$NO_DEPENDS" ]; then DOCKER_EXEC CONFIG_SHELL= make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS; fi
|
||||||
# Start xvfb if needed, as documented at https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI
|
|
||||||
- if [ "$NEED_XVFB" = 1 ]; then DOCKER_EXEC /sbin/start-stop-daemon --start --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac; fi
|
|
||||||
script:
|
script:
|
||||||
- export TRAVIS_COMMIT_LOG=`git log --format=fuller -1`
|
- export TRAVIS_COMMIT_LOG=`git log --format=fuller -1`
|
||||||
- OUTDIR=$BASE_OUTDIR/$TRAVIS_PULL_REQUEST/$TRAVIS_JOB_NUMBER-$HOST
|
- OUTDIR=$BASE_OUTDIR/$TRAVIS_PULL_REQUEST/$TRAVIS_JOB_NUMBER-$HOST
|
||||||
|
|
|
@ -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 bitcoin-qt GUI (default=auto, qt5 tried first)])],
|
[build bitcoin-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)
|
||||||
|
|
||||||
MOC_DEFS='-DHAVE_CONFIG_H -I$(srcdir)'
|
MOC_DEFS='-DHAVE_CONFIG_H -I$(srcdir)'
|
||||||
case $host in
|
case $host in
|
||||||
|
@ -262,7 +246,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)
|
||||||
|
@ -272,7 +256,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)
|
||||||
])
|
])
|
||||||
|
|
||||||
|
@ -301,7 +285,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.
|
||||||
|
@ -346,58 +330,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.
|
||||||
|
@ -406,38 +382,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])
|
||||||
|
@ -458,7 +410,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"
|
||||||
|
@ -480,13 +431,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([
|
||||||
|
@ -508,9 +453,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"
|
||||||
|
|
||||||
|
|
|
@ -837,7 +837,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
|
||||||
|
@ -1422,7 +1422,6 @@ 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"
|
||||||
|
|
|
@ -24,8 +24,6 @@ If you want to build the disk image with `make deploy` (.dmg / optional), you ne
|
||||||
|
|
||||||
brew install librsvg
|
brew install librsvg
|
||||||
|
|
||||||
NOTE: Building with Qt4 is still supported, however, could result in a broken UI. Building with Qt5 is recommended.
|
|
||||||
|
|
||||||
Berkeley DB
|
Berkeley DB
|
||||||
-----------
|
-----------
|
||||||
It is recommended to use Berkeley DB 4.8. If you have to build it yourself,
|
It is recommended to use Berkeley DB 4.8. If you have to build it yourself,
|
||||||
|
|
|
@ -100,18 +100,13 @@ ZMQ dependencies (provides ZMQ API 4.x):
|
||||||
#### Dependencies for the GUI
|
#### Dependencies for the GUI
|
||||||
|
|
||||||
If you want to build Bitcoin-Qt, make sure that the required packages for Qt development
|
If you want to build Bitcoin-Qt, make sure that the required packages for Qt development
|
||||||
are installed. Either Qt 5 or Qt 4 are necessary to build the GUI.
|
are installed. Qt 5 is necessary to build the GUI.
|
||||||
If both Qt 4 and Qt 5 are installed, Qt 5 will be used. Pass `--with-gui=qt4` to configure to choose Qt4.
|
|
||||||
To build without GUI pass `--without-gui`.
|
To build without GUI pass `--without-gui`.
|
||||||
|
|
||||||
To build with Qt 5 (recommended) you need the following:
|
To build with Qt 5 you need the following:
|
||||||
|
|
||||||
sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler
|
sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler
|
||||||
|
|
||||||
Alternatively, to build with Qt 4 you need the following:
|
|
||||||
|
|
||||||
sudo apt-get install libqt4-dev libprotobuf-dev protobuf-compiler
|
|
||||||
|
|
||||||
libqrencode (optional) can be installed with:
|
libqrencode (optional) can be installed with:
|
||||||
|
|
||||||
sudo apt-get install libqrencode-dev
|
sudo apt-get install libqrencode-dev
|
||||||
|
@ -132,7 +127,7 @@ Optional:
|
||||||
|
|
||||||
sudo dnf install miniupnpc-devel
|
sudo dnf install miniupnpc-devel
|
||||||
|
|
||||||
To build with Qt 5 (recommended) you need the following:
|
To build with Qt 5 you need the following:
|
||||||
|
|
||||||
sudo dnf install qt5-qttools-devel qt5-qtbase-devel protobuf-devel
|
sudo dnf install qt5-qttools-devel qt5-qtbase-devel protobuf-devel
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ These are the dependencies currently used by Bitcoin Core. You can find instruct
|
||||||
| protobuf | [2.6.3](https://github.com/google/protobuf/releases) | | No | | |
|
| protobuf | [2.6.3](https://github.com/google/protobuf/releases) | | No | | |
|
||||||
| Python (tests) | | [3.4](https://www.python.org/downloads) | | | |
|
| Python (tests) | | [3.4](https://www.python.org/downloads) | | | |
|
||||||
| qrencode | [3.4.4](https://fukuchi.org/works/qrencode) | | No | | |
|
| qrencode | [3.4.4](https://fukuchi.org/works/qrencode) | | No | | |
|
||||||
| Qt | [5.7.1](https://download.qt.io/official_releases/qt/) | 4.7+ | No | | |
|
| Qt | [5.7.1](https://download.qt.io/official_releases/qt/) | 5.x | No | | |
|
||||||
| XCB | | | | | [Yes](https://github.com/bitcoin/bitcoin/blob/master/depends/packages/qt.mk#L94) (Linux only) |
|
| XCB | | | | | [Yes](https://github.com/bitcoin/bitcoin/blob/master/depends/packages/qt.mk#L94) (Linux only) |
|
||||||
| xkbcommon | | | | | [Yes](https://github.com/bitcoin/bitcoin/blob/master/depends/packages/qt.mk#L93) (Linux only) |
|
| xkbcommon | | | | | [Yes](https://github.com/bitcoin/bitcoin/blob/master/depends/packages/qt.mk#L93) (Linux only) |
|
||||||
| ZeroMQ | [4.2.3](https://github.com/zeromq/libzmq/releases) | | No | | |
|
| ZeroMQ | [4.2.3](https://github.com/zeromq/libzmq/releases) | | No | | |
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
This directory contains the BitcoinQT graphical user interface (GUI). It uses the cross-platform framework [Qt](https://www1.qt.io/developers/).
|
This directory contains the BitcoinQT graphical user interface (GUI). It uses the cross-platform framework [Qt](https://www1.qt.io/developers/).
|
||||||
|
|
||||||
The current precise version for Qt 5 is specified in [qt.mk](/depends/packages/qt.mk). Qt 4 is also supported (see [#8263](https://github.com/bitcoin/bitcoin/issues/8263)).
|
The current precise version for Qt 5 is specified in [qt.mk](/depends/packages/qt.mk).
|
||||||
|
|
||||||
## Compile and run
|
## Compile and run
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ To run:
|
||||||
|
|
||||||
### forms
|
### forms
|
||||||
|
|
||||||
Contains [Designer UI](http://doc.qt.io/qt-5.9/designer-using-a-ui-file.html) files. They are created with [Qt Creator](#using-qt-creator-as-ide), but can be edited using any text editor.
|
Contains [Designer UI](https://doc.qt.io/qt-5.9/designer-using-a-ui-file.html) files. They are created with [Qt Creator](#using-qt-creator-as-ide), but can be edited using any text editor.
|
||||||
|
|
||||||
### locale
|
### locale
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ Represents the main window of the Bitcoin UI.
|
||||||
|
|
||||||
### \*model.(h/cpp)
|
### \*model.(h/cpp)
|
||||||
|
|
||||||
The model. When it has a corresponding controller, it generally inherits from [QAbstractTableModel](http://doc.qt.io/qt-5/qabstracttablemodel.html). Models that are used by controllers as helpers inherit from other Qt classes like [QValidator](http://doc.qt.io/qt-5/qvalidator.html).
|
The model. When it has a corresponding controller, it generally inherits from [QAbstractTableModel](https://doc.qt.io/qt-5/qabstracttablemodel.html). Models that are used by controllers as helpers inherit from other Qt classes like [QValidator](https://doc.qt.io/qt-5/qvalidator.html).
|
||||||
|
|
||||||
ClientModel is used by the main application `bitcoingui` and several models like `peertablemodel`.
|
ClientModel is used by the main application `bitcoingui` and several models like `peertablemodel`.
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ A controller. `:NAMEpage.cpp` generally includes `:NAMEmodel.h` and `forms/:NAME
|
||||||
|
|
||||||
### \*dialog.(h/cpp)
|
### \*dialog.(h/cpp)
|
||||||
|
|
||||||
Various dialogs, e.g. to open a URL. Inherit from [QDialog](http://doc.qt.io/qt-4.8/qdialog.html).
|
Various dialogs, e.g. to open a URL. Inherit from [QDialog](https://doc.qt.io/qt-5/qdialog.html).
|
||||||
|
|
||||||
### paymentserver.(h/cpp)
|
### paymentserver.(h/cpp)
|
||||||
|
|
||||||
|
|
|
@ -160,13 +160,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()));
|
||||||
|
|
|
@ -52,9 +52,7 @@ public:
|
||||||
node.getBanned(banMap);
|
node.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;
|
||||||
|
|
|
@ -55,13 +55,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
|
||||||
|
@ -73,11 +66,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*)
|
||||||
|
@ -151,16 +139,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);
|
||||||
|
@ -170,7 +148,6 @@ void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, cons
|
||||||
LogPrintf("GUI: %s\n", msg.toStdString());
|
LogPrintf("GUI: %s\n", msg.toStdString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Class encapsulating Bitcoin Core startup and shutdown.
|
/** Class encapsulating Bitcoin 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.
|
||||||
|
@ -586,12 +563,6 @@ 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
|
||||||
|
|
||||||
/// 1. 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(bitcoin);
|
Q_INIT_RESOURCE(bitcoin);
|
||||||
Q_INIT_RESOURCE(bitcoin_locale);
|
Q_INIT_RESOURCE(bitcoin_locale);
|
||||||
|
|
||||||
|
@ -722,17 +693,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
|
||||||
|
@ -753,7 +719,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 (node->baseInitialize()) {
|
if (node->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();
|
||||||
|
|
|
@ -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)
|
||||||
|
@ -148,12 +142,6 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty
|
||||||
#endif
|
#endif
|
||||||
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(node, _platformStyle, 0);
|
rpcConsole = new RPCConsole(node, _platformStyle, 0);
|
||||||
helpMessageDialog = new HelpMessageDialog(node, this, false);
|
helpMessageDialog = new HelpMessageDialog(node, this, false);
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
|
@ -230,7 +218,7 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty
|
||||||
|
|
||||||
// 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")
|
||||||
{
|
{
|
||||||
|
|
|
@ -109,11 +109,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
|
||||||
|
@ -392,13 +388,11 @@ void CoinControlDialog::viewItemChanged(QTreeWidgetItem* item, int column)
|
||||||
|
|
||||||
// TODO: Remove this temporary qt5 fix after Qt5.3 and Qt5.4 are no longer used.
|
// TODO: Remove this temporary qt5 fix after Qt5.3 and Qt5.4 are no longer used.
|
||||||
// Fixed in Qt5.5 and above: https://bugreports.qt.io/browse/QTBUG-43473
|
// Fixed in Qt5.5 and above: https://bugreports.qt.io/browse/QTBUG-43473
|
||||||
#if QT_VERSION >= 0x050000
|
|
||||||
else if (column == COLUMN_CHECKBOX && item->childCount() > 0)
|
else if (column == COLUMN_CHECKBOX && item->childCount() > 0)
|
||||||
{
|
{
|
||||||
if (item->checkState(COLUMN_CHECKBOX) == Qt::PartiallyChecked && item->child(0)->checkState(COLUMN_CHECKBOX) == Qt::PartiallyChecked)
|
if (item->checkState(COLUMN_CHECKBOX) == Qt::PartiallyChecked && item->child(0)->checkState(COLUMN_CHECKBOX) == Qt::PartiallyChecked)
|
||||||
item->setCheckState(COLUMN_CHECKBOX, Qt::Checked);
|
item->setCheckState(COLUMN_CHECKBOX, Qt::Checked);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// shows count of locked unspent outputs
|
// shows count of locked unspent outputs
|
||||||
|
|
|
@ -53,13 +53,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>
|
||||||
|
@ -95,11 +91,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
|
||||||
}
|
}
|
||||||
|
@ -127,12 +119,10 @@ void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent)
|
||||||
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 Bitcoin address (e.g. %1)").arg(
|
widget->setPlaceholderText(QObject::tr("Enter a Bitcoin address (e.g. %1)").arg(
|
||||||
QString::fromStdString(DummyAddress(Params()))));
|
QString::fromStdString(DummyAddress(Params()))));
|
||||||
#endif
|
|
||||||
widget->setValidator(new BitcoinAddressEntryValidator(parent));
|
widget->setValidator(new BitcoinAddressEntryValidator(parent));
|
||||||
widget->setCheckValidator(new BitcoinAddressCheckValidator(parent));
|
widget->setCheckValidator(new BitcoinAddressCheckValidator(parent));
|
||||||
}
|
}
|
||||||
|
@ -151,12 +141,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++)
|
||||||
{
|
{
|
||||||
bool fShouldReturnFalse = false;
|
bool fShouldReturnFalse = false;
|
||||||
|
@ -242,11 +228,7 @@ bool isDust(interfaces::Node& node, const QString& address, const CAmount& amoun
|
||||||
|
|
||||||
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
|
|
||||||
if(fMultiLine)
|
if(fMultiLine)
|
||||||
{
|
{
|
||||||
escaped = escaped.replace("\n", "<br>\n");
|
escaped = escaped.replace("\n", "<br>\n");
|
||||||
|
@ -287,11 +269,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
|
||||||
{
|
{
|
||||||
|
@ -337,11 +315,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
|
||||||
{
|
{
|
||||||
|
@ -495,11 +469,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)
|
||||||
|
|
|
@ -233,7 +233,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
|
||||||
|
|
|
@ -14,10 +14,6 @@
|
||||||
#include <objc/objc.h>
|
#include <objc/objc.h>
|
||||||
#include <objc/message.h>
|
#include <objc/message.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,...) {
|
||||||
|
@ -54,9 +50,7 @@ MacDockIconHandler::MacDockIconHandler() : QObject()
|
||||||
this->m_dummyWidget = new QWidget();
|
this->m_dummyWidget = new QWidget();
|
||||||
this->m_dockMenu = new QMenu(this->m_dummyWidget);
|
this->m_dockMenu = new QMenu(this->m_dummyWidget);
|
||||||
this->setMainWindow(nullptr);
|
this->setMainWindow(nullptr);
|
||||||
#if QT_VERSION < 0x050000
|
#if QT_VERSION >= 0x050200
|
||||||
qt_mac_set_dock_menu(this->m_dockMenu);
|
|
||||||
#elif QT_VERSION >= 0x050200
|
|
||||||
this->m_dockMenu->setAsDockMenu();
|
this->m_dockMenu->setAsDockMenu();
|
||||||
#endif
|
#endif
|
||||||
[pool release];
|
[pool release];
|
||||||
|
|
|
@ -68,11 +68,7 @@ NetworkStyle::NetworkStyle(const QString &_appName, const int iconColorHueShift,
|
||||||
}
|
}
|
||||||
|
|
||||||
//convert back to QPixmap
|
//convert back to QPixmap
|
||||||
#if QT_VERSION >= 0x040700
|
|
||||||
pixmap.convertFromImage(img);
|
pixmap.convertFromImage(img);
|
||||||
#else
|
|
||||||
pixmap = QPixmap::fromImage(img);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
appIcon = QIcon(pixmap);
|
appIcon = QIcon(pixmap);
|
||||||
|
|
|
@ -15,9 +15,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("bitcoin:");
|
ui->uriEdit->setPlaceholderText("bitcoin:");
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OpenURIDialog::~OpenURIDialog()
|
OpenURIDialog::~OpenURIDialog()
|
||||||
|
|
|
@ -97,28 +97,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));
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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("bitcoin:");
|
const QString BITCOIN_IPC_PREFIX("bitcoin:");
|
||||||
|
@ -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();
|
||||||
|
|
||||||
|
@ -413,11 +402,7 @@ void PaymentServer::handleURIOrFile(const QString& s)
|
||||||
}
|
}
|
||||||
else if (s.startsWith(BITCOIN_IPC_PREFIX, Qt::CaseInsensitive)) // bitcoin: URI
|
else if (s.startsWith(BITCOIN_IPC_PREFIX, Qt::CaseInsensitive)) // bitcoin: 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;
|
||||||
|
|
|
@ -64,9 +64,7 @@ public:
|
||||||
|
|
||||||
interfaces::Node::NodesStats nodes_stats;
|
interfaces::Node::NodesStats nodes_stats;
|
||||||
node.getNodesStats(nodes_stats);
|
node.getNodesStats(nodes_stats);
|
||||||
#if QT_VERSION >= 0x040700
|
|
||||||
cachedNodeStats.reserve(nodes_stats.size());
|
cachedNodeStats.reserve(nodes_stats.size());
|
||||||
#endif
|
|
||||||
for (auto& node_stats : nodes_stats)
|
for (auto& node_stats : nodes_stats)
|
||||||
{
|
{
|
||||||
CNodeCombinedStats stats;
|
CNodeCombinedStats stats;
|
||||||
|
|
|
@ -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/bitcoin-config.h> /* for USE_QRCODE */
|
#include <config/bitcoin-config.h> /* for USE_QRCODE */
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -32,9 +32,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
|
|
||||||
|
|
||||||
// normal bitcoin address field
|
// normal bitcoin address field
|
||||||
GUIUtil::setupAddressWidget(ui->payTo, this);
|
GUIUtil::setupAddressWidget(ui->payTo, this);
|
||||||
|
|
|
@ -37,9 +37,7 @@ SignVerifyMessageDialog::SignVerifyMessageDialog(const PlatformStyle *_platformS
|
||||||
ui->verifyMessageButton_VM->setIcon(platformStyle->SingleColorIcon(":/icons/transaction_0"));
|
ui->verifyMessageButton_VM->setIcon(platformStyle->SingleColorIcon(":/icons/transaction_0"));
|
||||||
ui->clearButton_VM->setIcon(platformStyle->SingleColorIcon(":/icons/remove"));
|
ui->clearButton_VM->setIcon(platformStyle->SingleColorIcon(":/icons/remove"));
|
||||||
|
|
||||||
#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
|
|
||||||
|
|
||||||
GUIUtil::setupAddressWidget(ui->addressIn_SM, this);
|
GUIUtil::setupAddressWidget(ui->addressIn_SM, this);
|
||||||
GUIUtil::setupAddressWidget(ui->addressIn_VM, this);
|
GUIUtil::setupAddressWidget(ui->addressIn_VM, this);
|
||||||
|
|
|
@ -26,12 +26,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
|
||||||
|
@ -43,7 +37,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();
|
||||||
|
|
||||||
|
|
|
@ -87,17 +87,6 @@ QModelIndex FindTx(const QAbstractItemModel& model, const uint256& txid)
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Request context menu (call method that is public in qt5, but protected in qt4).
|
|
||||||
void RequestContextMenu(QWidget* widget)
|
|
||||||
{
|
|
||||||
class Qt4Hack : public QWidget
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
using QWidget::customContextMenuRequested;
|
|
||||||
};
|
|
||||||
static_cast<Qt4Hack*>(widget)->customContextMenuRequested({});
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Invoke bumpfee on txid and check results.
|
//! Invoke bumpfee on txid and check results.
|
||||||
void BumpFee(TransactionView& view, const uint256& txid, bool expectDisabled, std::string expectError, bool cancel)
|
void BumpFee(TransactionView& view, const uint256& txid, bool expectDisabled, std::string expectError, bool cancel)
|
||||||
{
|
{
|
||||||
|
@ -110,7 +99,7 @@ void BumpFee(TransactionView& view, const uint256& txid, bool expectDisabled, st
|
||||||
QAction* action = view.findChild<QAction*>("bumpFeeAction");
|
QAction* action = view.findChild<QAction*>("bumpFeeAction");
|
||||||
table->selectionModel()->select(index, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
|
table->selectionModel()->select(index, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
|
||||||
action->setEnabled(expectDisabled);
|
action->setEnabled(expectDisabled);
|
||||||
RequestContextMenu(table);
|
table->customContextMenuRequested({});
|
||||||
QCOMPARE(action->isEnabled(), !expectDisabled);
|
QCOMPARE(action->isEnabled(), !expectDisabled);
|
||||||
|
|
||||||
action->setEnabled(true);
|
action->setEnabled(true);
|
||||||
|
|
|
@ -95,15 +95,11 @@ 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
|
|
||||||
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(97);
|
amountWidget->setFixedWidth(97);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -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>
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue