-
Notifications
You must be signed in to change notification settings - Fork 36.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Qt: add QML based mobile GUI #16883
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
Awesome, sorry could not make it home yesterday, fires still spreading! But iwill try tomorrow. |
👀 |
Are you saying we wouldn't merge any QML UI into the repository, or that we wouldn't merge this change in its current draft form with ifdefs and the like? IIUC, one nice thing that QML enables in addition to a mobile UI, is a remotely accessible web UI: https://www.qt.io/blog/2018/11/23/qt-quick-webgl-release-512 |
AFAIK considering the current QML state of the art it wouldn't be accepted in core - because JS engine etc. In Qt6, according to Lars Knoll in https://www.qt.io/blog/2019/08/07/technical-vision-qt-6:
IMHO it's still too early to consider QML since that there are some issues regarding long operations blocking the Qt event loop. Prototype ACK |
@promag Is there an actual JS interpreter used at runtime? Some quick googling tells me that with "Qt Quick" the JS is compiled to C++, which seems much less worrisome. Issues around blocking UI are orthogonal, as they equally apply to the current UI. This sounds really cool actually. Assuming it's feature complete, I wouldn't object to merging it in as an optional UI module in the repo. |
When I build with |
What I meant was do we actually want to add another GUI to this repository? If we do, what are the plans / objectives for it? Would it just exist as a bare-minimum, "here's an example of how you might build a QML based/mobile GUI"? Or would it get built out to add features similar to those mentioned in the PR description, and one day we'd be releasing a Bitcoin Core Android package? If it's the later, is this repository where we want to be doing all that development / having those discussions?
What should we consider feature complete here, basic send/receive functionality? I'm concerned that if it's optional, it wont get built / tested 99% of the time and will likely just break / rot. |
Regardless of the below, General Concept ACK. I think it would be best as a separate frontend/repo, though. No need to embed into the main repo just to be split out later...
We're headed in the opposite direction (it's getting harder, not easier, since technology can't keep pace with the block size).
We already have that?
Can this be done via gitian? |
Great work! I would not be opposed to merge something like this as an experimental feature – if the risks of breaking the current GUI is at minimum. A web based JS/CSS frontend, as most desktop and some mobile apps use it today, is something a lot of contributors to this project dislike. But AFAIK QML/JS compiles to native code... I think we should follow this. |
My idea is to eventually have 90% of the features available to the QtWidgets GUI user, but hidden away behind a prompt of some kind so a normal user doesn't need to know or touch anything. I believe most of the users (especially on mobile) just want idiot-proof send/receive so don't want to overwhelm them. Perhaps this PR is the 'dumb' rather than 'mobile' GUI.
Correct me if I'm mistaken but doesn't RPC have loads of dangerous calls (wallet stuff, etc...)? Can one connect to Core RPC with just a subset for chain monitoring? I was thinking about a 'hardened RPC' for local apps, perhaps even permissioned.
If you have |
@icota see #16916 for the promised PR that contains my working android build. My command is :- make HOST=i686-linux-android ANDROID_API_LEVEL=24 ANDROID_TARGET_ARCH=x86 ANDROID_TOOLCHAIN_BIN=/opt/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/bin ANDROID_SDK=/opt/android-sdk-linux ANDROID_NDK=/opt/android_ndk -j 4 |
@sipa which Qt, etc? |
RPC whitelisting is a thing now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could start by writing basic developer notes for qml code - component recommendation, how to name properties/vars, order , etc, where to write JS (inlined?), what is acceptable in QML, translations, etc.
In this PR I'd drop all unnecessary stuff, for instance everything related to multimedia.
Also go the depends system to behave, if anyone wants the mods to make it build via depends, let me know. |
I'll try to do weekly updates like this.
Probably best to adopt the coding conventions off Qt's website? I've added a link to developer notes.
Multimedia is neccessary for camera QR code scanning, this is a placeholder right now but will be enabled as soon as I find out the least painful way to add an image processing dependency like qzxing. I'm also using bits of multimedia to invert the icons colour for dark mode. |
Concept ACK. |
|
If a switch to QML is likely going to occur (which I think is the way to go going forward for reasons outlined above) in the future I think it would be good to start working on first principles, ground up, fresh UI designs for the GUI instead of bolting on changes to the current very restrictive widgets. Continuing to do this will just incur technical and design debt that we can't afford to take on. To save resources I'd like to propose a design freeze of sorts on the current GUI widgets implementation and just focus on adding new protocol changes in a very low fidelity way whilst a complete new design is worked on and ready by the time a technical implementation of QML happens. Design foundations (such as clarity around branding and a design system) would also be established in parallel to designing this fresh new GUI. We could start by creating a project to track these designs and have an issue posted and pinned to the GUI repo for "WIP: GUI re-designs" that can have a link to active Figma design work being conducted by community members such as myself. Any comments / suggestions / discussions should be posted on that issue, and not on Figma, to keep the discussions here and prevent any designer / developer divide. Would this PR also not be more relevant in the GUI repo? |
Build system changes belong to the main repo. |
@Bosch-0 I agree that this is the way forward. However, current widgets design freeze might not be wise because we don't know when the QML implementation will be production ready. I'd like to propose the new design be adaptive to both mobile and desktop. But both of these discussion are for the GUI repo issue. |
@sipa I think "compiled to C++" needs clarification, there's still runtime execution, see https://stackoverflow.com/a/41287809/1978589. But in Qt 6, from https://www.qt.io/blog/2019/08/07/technical-vision-qt-6:
|
To compile QML source code into the final binaries the Qt Quick Compiler could be used. |
I was already assuming qtquickcompiler would be enabled, but there's still the JVM. See https://stackoverflow.com/a/62393490/1978589. |
Has anyone built this using depends for windows and succeeded ? I Am running into an issue :-
This is only on windows so far. Any ideas? |
@BlockMechanic Unless I missed something, depends doesn't include QtQuick (yet) so I don't think it matters which OS you're building on. |
I am using a modified depends based on the PR I made. |
CPPFLAGS="$QT_INCLUDES $CPPFLAGS" | ||
fi | ||
]) | ||
|
||
BITCOIN_QT_CHECK([AC_CHECK_HEADER([QtPlugin],,BITCOIN_QT_FAIL(QtCore headers missing))]) | ||
BITCOIN_QT_CHECK([AC_CHECK_HEADER([QApplication],, BITCOIN_QT_FAIL(QtGui headers missing))]) | ||
BITCOIN_QT_CHECK([AC_CHECK_HEADER([QLocalSocket],, BITCOIN_QT_FAIL(QtNetwork headers missing))]) | ||
BITCOIN_QT_CHECK([AC_CHECK_HEADER([QQmlApplicationEngine],, BITCOIN_QT_FAIL(QtQml headers missing))]) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some missing parts to this file that enable static linking. If you compile the depends statically, there is an additional folder 'qml' which contains libs required for statically linking, such as libqtquick2plugin.a .
246774e depends: fix Qt precompiled headers bug (Igor Cota) 8e7ad41 depends: disable Qt Vulkan support on Android (Igor Cota) ba46ada CI: add Android APK build to cirrus (Igor Cota) 7563720 CI: add Android APK build script (Igor Cota) ebfb10c Qt: add Android packaging support (Igor Cota) Pull request description: ![bitcoin-qt](https://user-images.githubusercontent.com/762502/67396157-62f3d000-f5a7-11e9-8a6f-9425823fcd6c.gif) This PR is the third and final piece of the basic Android support puzzle - it depends on bitcoin/bitcoin#16110 and is related to bitcoin/bitcoin#16883. It introduces an `android` directory under `qt` and a simple way to build an Android package of `bitcoin-qt`: 1. Build depends for Android as described in the [README](https://github.com/bitcoin/bitcoin/blob/master/depends/README.md) 2. Configure with one of the resulting prefixes 3. Run `make && make apk` in `src/qt` The resulting APK files will be in `android/build/outputs/apk`. You can install them manually or with [adb](https://developer.android.com/studio/command-line/adb). One can also open the `android` directory in Android Studio for that integrated development and debugging experience. `BitcoinQtActivity` is your starting point. Under the hood makefile `apk` target: 1. Renames the `bitcoin-qt` binary to `libbitcoin-qt.so` and copies it over to a folder under `android/libs` depending on which prefix and corresponding [ABI](https://developer.android.com/ndk/guides/abis.html#sa) `bitcoin-qt` was built for 2. Takes `libc++_shared.so` from the Android NDK and puts in the same place. It [must be included](https://developer.android.com/ndk/guides/cpp-support) in the APK 3. Extracts Qt for Android Java support files from the `qtbase` archive in `depends/sources` to `android/src` There is also just a tiny bit of `ifdef`'d code to make the Qt Widgets menus usable. It's not pretty but it works and is a stepping stone towards bitcoin/bitcoin#16883. ACKs for top commit: MarcoFalke: cr ACK 246774e laanwj: Code review ACK 246774e Tree-SHA512: ba30a746576a167545223c35a51ae60bb0838818779fc152c210f5af1413961b2a6ab6af520ff92cbc8dcd5dcb663e81ca960f021218430c1f76397ed4cead6c
All devs who are interested in the next-gen QML-based GUI for Bitcoin Core, please consider joining the dedicated https://github.com/bitcoin-core/gui-qml repo. |
e2104f8 qml: Add stub window (Hennadii Stepanov) cc7f254 qml: Add bitcoin module (Hennadii Stepanov) 8efd330 refactor: Move qwidget and qml common code into the main() function (Hennadii Stepanov) Pull request description: Added basic support for QML to Qt resource system. Suggested the following file directory layout: - `src/qml/` - `src/qml/*.{h|cpp}` - `src/qml/pages/*.qml` - `src/qml/<other resource directories>` ACKs for top commit: promag: ACK e2104f8. Comparing to bitcoin/bitcoin#16883 I prefer this approach especially because we can change the startup without affecting the existing bitcoin-qt. Tree-SHA512: 60d0a519f76f66736c7a6665a0fc39488a2929f934ead6f704577de1337668dfb0931f176462258aad9b41498295cf9bb367d5ed83d4cf4623a563f2314a8989
1155978 build, qt: Do not install *.prl files (Hennadii Stepanov) 763793b build, qt: Fix wrong cross-compiling detection on macOS (Hennadii Stepanov) 3098272 build, qt: Force bootstrap while building linguist tools (Hennadii Stepanov) 689320e build, qt: Drop translations.pro hack (Hennadii Stepanov) 6a1f98f build, qt: Drop lrelease dependency patch (Hennadii Stepanov) 39e561e build, qt: Add linguist_tools list (Hennadii Stepanov) 27d3def build: Use Qt top-level build facilities (Hennadii Stepanov) Pull request description: This PR: - uses Qt top-level build facilities without the need to download all-in-one archive - is based on **BlockMechanic**'s [idea](bitcoin/bitcoin#20600), and is an alternative to #20600 - makes it easy to integrate [new modules](bitcoin/bitcoin#16883) into static builds - has the minimal diff - makes the qt package build process streamlined by dropping some patches and hacks (an alternative to #21420 and #20642) Fixes #18536 (a non-intrusive alternative to #21589 and #19785). Fixes #14648. Fixes #21588 (a non-intrusive alternative to #21591). Required for adding [Wayland support](bitcoin/bitcoin#19950) on Linux. --- **Note for reviewers**: With 9046de8a4cbc3899fed9eae084115f423e7ac5bd from #21995 it is easy to verify that there are no changes in the resulted `qt` package archive on the per commit basis. For example, for `HOST=i686-pc-linux-gnu` no commit in this PR introduces any changes. ACKs for top commit: fanquake: ACK 1155978 Tree-SHA512: 667b06b72cb7ff26d68b9b88e8dddb51084783ca9e3d80b3392710794c1dc7fd77bbcc3ccf4ccece9919d33b9bf8fce13c5059502bd228021dc7c93fdb87ca7a
1155978 build, qt: Do not install *.prl files (Hennadii Stepanov) 763793b build, qt: Fix wrong cross-compiling detection on macOS (Hennadii Stepanov) 3098272 build, qt: Force bootstrap while building linguist tools (Hennadii Stepanov) 689320e build, qt: Drop translations.pro hack (Hennadii Stepanov) 6a1f98f build, qt: Drop lrelease dependency patch (Hennadii Stepanov) 39e561e build, qt: Add linguist_tools list (Hennadii Stepanov) 27d3def build: Use Qt top-level build facilities (Hennadii Stepanov) Pull request description: This PR: - uses Qt top-level build facilities without the need to download all-in-one archive - is based on **BlockMechanic**'s [idea](bitcoin#20600), and is an alternative to bitcoin#20600 - makes it easy to integrate [new modules](bitcoin#16883) into static builds - has the minimal diff - makes the qt package build process streamlined by dropping some patches and hacks (an alternative to bitcoin#21420 and bitcoin#20642) Fixes bitcoin#18536 (a non-intrusive alternative to bitcoin#21589 and bitcoin#19785). Fixes bitcoin#14648. Fixes bitcoin#21588 (a non-intrusive alternative to bitcoin#21591). Required for adding [Wayland support](bitcoin#19950) on Linux. --- **Note for reviewers**: With 9046de8 from bitcoin#21995 it is easy to verify that there are no changes in the resulted `qt` package archive on the per commit basis. For example, for `HOST=i686-pc-linux-gnu` no commit in this PR introduces any changes. ACKs for top commit: fanquake: ACK 1155978 Tree-SHA512: 667b06b72cb7ff26d68b9b88e8dddb51084783ca9e3d80b3392710794c1dc7fd77bbcc3ccf4ccece9919d33b9bf8fce13c5059502bd228021dc7c93fdb87ca7a
There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
I guess this is now superseded by https://github.com/bitcoin-core/gui-qml? |
Yeap 🐅 |
Ok, closing for now. |
… to all `$(package)_*_cmds` affbf58 build: Move environment variables into `$(package)_config_env` (Hennadii Stepanov) d44fcd3 build: Make $(package)_*_env available to all $(package)_*_cmds (Hennadii Stepanov) Pull request description: On master (1e7564e) the depends build system, which is based on pure GNU Make, works, but it lacks robustness, and in some corner cases it fails. For example, see bitcoin/bitcoin#22552. Another [bug](bitcoin/bitcoin#22719) in the depends build system has already become a problem at least two times in the past (bitcoin/bitcoin#16883 (comment) and bitcoin/bitcoin#24134). Each time the problem was solved with other means. The initial [solution](bitcoin/bitcoin#19882) had some discussion. Also it was discussed on the IRC meeting in #bitcoin-core-builds channel. This PR, actually, is a resurrection of it, as the bug silently struck pretty [recently](bitcoin/bitcoin#24134). The bug is well described in bitcoin/bitcoin#22719. Here is another, a bit simpler description, which requires only basic shell (bash, dash etc) experience. After creating targets by this code:https://github.com/bitcoin/bitcoin/blob/1e7564eca8a688f39c75540877ec3bdfdde766b1/depends/funcs.mk#L280 a "draft" line of recipe like `$($(1)_config_env) $(call $(1)_config_cmds, $(1))` becomes a shell command sequence `VAR1=foo VAR2=bar command1 && command2` which is supposed to be executed in a [new sub-shell](https://www.gnu.org/software/make/manual/html_node/Execution.html#Execution). Please note that `VAR1=foo VAR2=bar` part is visible for the first `command1` only (for details see shell docs). Example: ```sh $ VAR1="foo" VAR2="bar" echo "begin" && printenv VAR1 && printenv VAR2 && echo "end" begin $ echo $? 1 ``` Using the `export` command is a trivial solution: ```sh $ export VAR1="foo" VAR2="bar"; echo "begin" && printenv VAR1 && printenv VAR2 && echo "end" begin foo bar end $ echo $? 0 ``` As a [new sub-shell](https://www.gnu.org/software/make/manual/html_node/Execution.html#Execution) is invoked for each line of the recipe, there are no side effects of using `export`. It means this solution should not be considered invasive. Fixes bitcoin/bitcoin#22719. --- Also this PR removes no longer needed crutch from `qt.mk`. ACKs for top commit: fanquake: ACK affbf58 Tree-SHA512: 0ce2cf82870a7774bdf1592fac50857126ae47da902e349f1092d50109223be9d6a8efd5e92ec08c2ca775b17516482aabaf232378950ade36484a883acc177b
…`$(package)_*_cmds` affbf58 build: Move environment variables into `$(package)_config_env` (Hennadii Stepanov) d44fcd3 build: Make $(package)_*_env available to all $(package)_*_cmds (Hennadii Stepanov) Pull request description: On master (1e7564e) the depends build system, which is based on pure GNU Make, works, but it lacks robustness, and in some corner cases it fails. For example, see bitcoin#22552. Another [bug](bitcoin#22719) in the depends build system has already become a problem at least two times in the past (bitcoin#16883 (comment) and bitcoin#24134). Each time the problem was solved with other means. The initial [solution](bitcoin#19882) had some discussion. Also it was discussed on the IRC meeting in #bitcoin-core-builds channel. This PR, actually, is a resurrection of it, as the bug silently struck pretty [recently](bitcoin#24134). The bug is well described in bitcoin#22719. Here is another, a bit simpler description, which requires only basic shell (bash, dash etc) experience. After creating targets by this code:https://github.com/bitcoin/bitcoin/blob/1e7564eca8a688f39c75540877ec3bdfdde766b1/depends/funcs.mk#L280 a "draft" line of recipe like `$($(1)_config_env) $(call $(1)_config_cmds, $(1))` becomes a shell command sequence `VAR1=foo VAR2=bar command1 && command2` which is supposed to be executed in a [new sub-shell](https://www.gnu.org/software/make/manual/html_node/Execution.html#Execution). Please note that `VAR1=foo VAR2=bar` part is visible for the first `command1` only (for details see shell docs). Example: ```sh $ VAR1="foo" VAR2="bar" echo "begin" && printenv VAR1 && printenv VAR2 && echo "end" begin $ echo $? 1 ``` Using the `export` command is a trivial solution: ```sh $ export VAR1="foo" VAR2="bar"; echo "begin" && printenv VAR1 && printenv VAR2 && echo "end" begin foo bar end $ echo $? 0 ``` As a [new sub-shell](https://www.gnu.org/software/make/manual/html_node/Execution.html#Execution) is invoked for each line of the recipe, there are no side effects of using `export`. It means this solution should not be considered invasive. Fixes bitcoin#22719. --- Also this PR removes no longer needed crutch from `qt.mk`. ACKs for top commit: fanquake: ACK affbf58 Tree-SHA512: 0ce2cf82870a7774bdf1592fac50857126ae47da902e349f1092d50109223be9d6a8efd5e92ec08c2ca775b17516482aabaf232378950ade36484a883acc177b
This adds a Qt Quick Controls 2 based UI meant for mobile devices. This is work-in-progress meant to gauge interest, related to but not dependent on #16110, i.e. one can run the "mobile" GUI on desktop as well. You should install
qtdeclarative5-dev
andqtquickcontrols2-5-dev
in addition to usual Qt dependencies and configure with--enable-mobile-gui
.As a proof-of-concept this PR aims to be light, about 400 lines of C++ code that is meant to be a drop-in replacement for
bitcoingui
with mostly the same public functions and a couple of #ifdefs inbitcoin.cpp
. There is also an addition ofroleNames
to thetransactiontablemodel
to make it compatible with QML stuff.Replacement class
bitcoinmobilegui
hooks up to the exact same signals, models and controllers asbitcoingui
. At the moment the mobile GUI presented to the user is dead simple (no multi-wallet, no advanced options) but it has been tested to allow the user to send and receive.My rationale for making this is the fact that in a couple years phones will be powerful enough to run Core without much hassle. If we add some platform code for
and release an official Android package I believe that this has the potential to put a full node in the pockets of millions - empowering users and improving the network.