Skip to content

Commit c9ed992

Browse files
committed
Merge bitcoin/bitcoin#24132: build: Bump minimum Qt version to 5.11.3
956f732 build: Bump minimum Qt version to 5.11.3 (Hennadii Stepanov) e22d10b ci: Switch from bionic to buster (Hennadii Stepanov) Pull request description: The current minimum Qt version is 5.9.5 which has been set in bitcoin/bitcoin#21286. Distro support: - centos 7 -- unsupported since bitcoin/bitcoin#23511 - centos 8 -- [5.15.2](http://mirror.centos.org/centos/8/AppStream/x86_64/os/Packages/qt5-qtbase-5.15.2-3.el8.x86_64.rpm) - buster -- [5.11.3](https://packages.debian.org/buster/libqt5core5a) - bullseye -- [5.15.2](https://packages.debian.org/bullseye/libqt5core5a) - _bionic_ -- [5.9.5](https://packages.ubuntu.com/bionic/libqt5core5a) - focal -- [5.12.8](https://packages.ubuntu.com/focal/libqt5core5a) As another Ubuntu LTS is coming soon, it seems unreasonable to stick to Qt 5.9 which support [ended](https://www.qt.io/blog/2017/06/07/renewed-qt-support-services) on 2020-05-31. Anyway, it's still possible to build Bitcoin Core GUI with depends on bionic system. Bumping the minimum Qt version allows to make code safer and more reliable, e.g.: - functor-parameter overload of [`QMetaObject::invokeMethod`](https://doc.qt.io/qt-5/qmetaobject.html#invokeMethod-4) - fixed https://bugreports.qt.io/browse/QTBUG-10907 An example of the patch using the functor-overload of `QMetaObject::invokeMethod`: ```diff --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -349,7 +349,7 @@ bool WalletModel::changePassphrase(const SecureString &oldPass, const SecureStri static void NotifyUnload(WalletModel* walletModel) { qDebug() << "NotifyUnload"; - bool invoked = QMetaObject::invokeMethod(walletModel, "unload"); + bool invoked = QMetaObject::invokeMethod(walletModel, &WalletModel::unload); assert(invoked); } ``` It uses the same new syntax as signal-slot connection with compile-time check. Also see bitcoin/bitcoin#16348. This PR is intended to be merged early [after](bitcoin/bitcoin#22969) branching `23.x` off. ACKs for top commit: MarcoFalke: cr ACK 956f732 fanquake: ACK 956f732 Tree-SHA512: 3d652bcdcd990ce785ad412ed70234d4f27743895e535a53ed44b35d4afc3052e066c4c84f417e30bc53d0a3dd9ebed62444c57b7c765cb1e9aa687fbf866877
2 parents bda692d + 956f732 commit c9ed992

File tree

5 files changed

+4
-8
lines changed

5 files changed

+4
-8
lines changed

.cirrus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ task:
195195
FILE_ENV: "./ci/test/00_setup_env_i686_centos.sh"
196196

197197
task:
198-
name: '[previous releases, uses qt5 dev package and some depends packages, DEBUG] [unsigned char] [bionic]'
198+
name: '[previous releases, uses qt5 dev package and some depends packages, DEBUG] [unsigned char] [buster]'
199199
previous_releases_cache:
200200
folder: "releases"
201201
<< : *GLOBAL_TASK_TEMPLATE

ci/test/00_setup_env_native_qt5.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
export LC_ALL=C.UTF-8
88

99
export CONTAINER_NAME=ci_native_qt5
10-
export DOCKER_NAME_TAG=ubuntu:18.04 # Check that bionic gcc-8 can compile our C++17 and run our functional tests in python3, see doc/dependencies.md
10+
export DOCKER_NAME_TAG=debian:buster # Check that buster gcc-8 can compile our C++17 and run our functional tests in python3, see doc/dependencies.md
1111
export PACKAGES="gcc-8 g++-8 python3-zmq qtbase5-dev qttools5-dev-tools libdbus-1-dev libharfbuzz-dev"
1212
export DEP_OPTS="NO_QT=1 NO_UPNP=1 NO_NATPMP=1 DEBUG=1 ALLOW_HOST_PACKAGES=1 CC=gcc-8 CXX=g++-8"
1313
export TEST_RUNNER_EXTRA="--previous-releases --coverage --extended --exclude feature_dbcrash" # Run extended tests so that coverage does not fail, but exclude the very slow dbcrash

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1309,7 +1309,7 @@ else
13091309
BITCOIN_QT_INIT
13101310

13111311
dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus
1312-
BITCOIN_QT_CONFIGURE([5.9.5])
1312+
BITCOIN_QT_CONFIGURE([5.11.3])
13131313

13141314
dnl Keep a copy of the original $QT_INCLUDES and use it when invoking qt's moc
13151315
QT_INCLUDES_UNSUPPRESSED=$QT_INCLUDES

doc/dependencies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ These are the dependencies currently used by Bitcoin Core. You can find instruct
2020
| PCRE | | | | | [Yes](https://github.com/bitcoin/bitcoin/blob/master/depends/packages/qt.mk) |
2121
| Python (tests) | | [3.6](https://www.python.org/downloads) | | | |
2222
| qrencode | [3.4.4](https://fukuchi.org/works/qrencode) | | No | | |
23-
| Qt | [5.15.2](https://download.qt.io/official_releases/qt/) | [5.9.5](https://github.com/bitcoin/bitcoin/issues/20104) | No | | |
23+
| Qt | [5.15.2](https://download.qt.io/official_releases/qt/) | [5.11.3](https://github.com/bitcoin/bitcoin/pull/24132) | No | | |
2424
| SQLite | [3.32.1](https://sqlite.org/download.html) | [3.7.17](https://github.com/bitcoin/bitcoin/pull/19077) | | | |
2525
| XCB | | | | | [Yes](https://github.com/bitcoin/bitcoin/blob/master/depends/packages/qt.mk) (Linux only) |
2626
| systemtap ([tracing](tracing.md))| [4.5](https://sourceware.org/systemtap/ftp/releases/) | | | | |

src/qt/guiutil.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -883,11 +883,7 @@ void PolishProgressDialog(QProgressDialog* dialog)
883883

884884
int TextWidth(const QFontMetrics& fm, const QString& text)
885885
{
886-
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
887886
return fm.horizontalAdvance(text);
888-
#else
889-
return fm.width(text);
890-
#endif
891887
}
892888

893889
void LogQtInfo()

0 commit comments

Comments
 (0)