Skip to content

Rebase gui-qml on bitcoin/bitcoin, include qt6 and cmake #472

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

Draft
wants to merge 6,401 commits into
base: main
Choose a base branch
from

Conversation

pinheadmz
Copy link
Contributor

@pinheadmz pinheadmz commented Jun 10, 2025

No description provided.

jarolrod and others added 30 commits April 15, 2025 16:21
This encapsulates a commonly used button into a reusable component.
Represents the yellow-orange color used for the NetworkIndicator when
the app is running on the Signet network.
Signals to the user what network they are running under when not on the
main network.
Currently we included the export filled icon from the icon set, but the
design file now specifies that we use the export-outline icon as the
export icon.
Represents the 1px gray line that separates settings from one another
Extracts out the Separator from the Setting control. Adjusts relevant
pages ColumnLayout spacing values. Additionally, adds proper margin
values to header since we no longer have spacing provided by a
ColumnLayout inside of the Setting control.
There is no use case for a ValueInput that will be fed into a setting
to be multi-line in nature
This gives the focus back to the parent setting, relinquishing focus
on the ValueInput and moving it out of the edit state.
johnny9 and others added 18 commits June 10, 2025 15:49
This property will be used to set the target number of
blocks for the standard fees listed in the UI drop down
menu.
The FeeSelection component provides the standard fee options
via a drop down menu.
These are purely cosmetic adjustments:

- Make the font size of the selector the same as other send form fields
- Lighter color for the option durations
- Various spacing tweaks for a more harmonious appearance

There are still some very minor details like item height, hover state, etc that we may tweak further as make our design system consistent. But these tweaks here get us very close.
The Context is used to change the nav bar text
@davidgumberg
Copy link
Contributor

Fix for the black screen issue: davidgumberg@c26f30a

@pinheadmz
Copy link
Contributor Author

Fix for the black screen issue: davidgumberg@c26f30a

You are a prince!! Picked. 😘

@hebasto
Copy link
Member

hebasto commented Jun 12, 2025

Fix for the black screen issue: davidgumberg@c26f30a

Should this also be applied to the main branch?

@hebasto
Copy link
Member

hebasto commented Jun 12, 2025

This PR uses a straightforward approach to rebasing. While it doesn’t follow the modern method for creating QML modules, it has a key advantage for review purposes: the directory layout remains unchanged. This makes it easy to verify:

git diff main f5be211f59751927fc4eae18931b56a9b0430da9 -- \
  src/qml/components/* \
  src/qml/controls/* \
  src/qml/pages/* \
  src/qml/res/*

I would expect this to produce no differences, but it is not. Some of these changes could be PR'ed to the main branch. The rest should be explained in this PR.

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing f5be211 on Ubuntu 25.04 + Qt 6.8.3:

qrc:/qml/controls/Theme.qml:13:5: QML Settings: The Settings type from Qt.labs.settings is deprecated and will be removed in a future release. Please use the one from QtCore instead.
qrc:/qml/components/BlockClock.qml:38:5: QML Settings: The Settings type from Qt.labs.settings is deprecated and will be removed in a future release. Please use the one from QtCore instead.
qrc:/qml/pages/wallet/Send.qml:33:9: QML Settings: The Settings type from Qt.labs.settings is deprecated and will be removed in a future release. Please use the one from QtCore instead.
expression for onCompleted@qrc:/qml/components/BlockClock.qml:120
Too many arguments, ignoring 1
Running initialization in thread
qrc:/qml/pages/main.qml:24:5: QML Settings: The Settings type from Qt.labs.settings is deprecated and will be removed in a future release. Please use the one from QtCore instead.

@hebasto
Copy link
Member

hebasto commented Jun 12, 2025

Testing f5be211 on Ubuntu 25.04 + Qt 6.8.3:

qrc:/qml/controls/Theme.qml:13:5: QML Settings: The Settings type from Qt.labs.settings is deprecated and will be removed in a future release. Please use the one from QtCore instead.
qrc:/qml/components/BlockClock.qml:38:5: QML Settings: The Settings type from Qt.labs.settings is deprecated and will be removed in a future release. Please use the one from QtCore instead.
qrc:/qml/pages/wallet/Send.qml:33:9: QML Settings: The Settings type from Qt.labs.settings is deprecated and will be removed in a future release. Please use the one from QtCore instead.
expression for onCompleted@qrc:/qml/components/BlockClock.qml:120
Too many arguments, ignoring 1
Running initialization in thread
qrc:/qml/pages/main.qml:24:5: QML Settings: The Settings type from Qt.labs.settings is deprecated and will be removed in a future release. Please use the one from QtCore instead.

I believe we can ignore those messages for now.

@pinheadmz
Copy link
Contributor Author

QML diff explanations:

Commenting on:

git diff main f5be211f59751927fc4eae18931b56a9b0430da9 -- \
  src/qml/components/* \
  src/qml/controls/* \
  src/qml/pages/* \
  src/qml/res/*

diff --git a/src/qml/components/BlockClock.qml b/src/qml/components/BlockClock.qml
index 51b02afe51..fa309766c6 100644
--- a/src/qml/components/BlockClock.qml
+++ b/src/qml/components/BlockClock.qml
@@ -22,7 +22,6 @@ Item {
     height: dial.height + networkIndicator.height + networkIndicator.anchors.topMargin
 
     property alias header: mainText.text
-    property alias headerSize: mainText.font.pixelSize
     property alias subText: subText.text
     property int headerSize: 32
     property bool connected: nodeModel.numOutboundPeers > 

https://doc.qt.io/qt-6/qmllint-warnings-and-errors-duplicated-name.html
Qt5 silently allowed this by overwriting the headerSize property with the second value


diff --git a/src/qml/components/StorageLocations.qml b/src/qml/components/StorageLocations.qml
index acaa69b40a..52cd39850b 100644
--- a/src/qml/components/StorageLocations.qml
+++ b/src/qml/components/StorageLocations.qml
@@ -5,7 +5,7 @@
 import QtQuick 2.15
 import QtQuick.Controls 2.15
 import QtQuick.Layouts 1.15
-import QtQuick.Dialogs 1.3
+import QtQuick.Dialogs
 
 import org.bitcoincore.qt 1.0
 
@@ -41,8 +41,7 @@ ColumnLayout {
     }
     FileDialog {
         id: fileDialog
-        selectFolder: true
-        folder: shortcuts.home
+        currentFolder: shortcuts.home
         onAccepted: {
             optionsModel.setCustomDataDirString(fileDialog.fileUrls[0].toString())
             var customDataDir = fileDialog.fileUrl.toString();

Qt 6 docs:

In Qt 6, both the major and minor versions match, and version numbers may be omitted from imports in QML. If the version is omitted, the latest version will be used.

The old version number for this module in particular resulted in not-installed error

Qt 6 FileDialog has slightly different properties than earlier version.


diff --git a/src/qml/components/blockclockdial.cpp b/src/qml/components/blockclockdial.cpp
index a6842702ea..f39658b5f5 100644
--- a/src/qml/components/blockclockdial.cpp
+++ b/src/qml/components/blockclockdial.cpp
@@ -20,9 +20,9 @@ BlockClockDial::BlockClockDial(QQuickItem *parent)
     m_delay_timer.setSingleShot(true);
     m_delay_timer.setInterval(5000);
     connect(&m_delay_timer, &QTimer::timeout,
-            this, [=]() { this->m_animation_timer.start(); });
+            this, [this]() { this->m_animation_timer.start(); });
     connect(&m_animation_timer, &QTimer::timeout,
-            this, [=]() {
+            this, [=, this]() {
                 if (m_is_connected
                     && getTargetAnimationAngle() - m_animating_max_angle < 1) {
                     m_animation_timer.stop();

As far as I can tell in C++11 [=] never implicitly captured this so I don't know why this was ever allowed before, unless older compiler versions were just not as strict, or more likely the new cmake build sytem enforce stricter rules with certain flags than the autotools build did?


diff --git a/src/qml/controls/linegraph.cpp b/src/qml/controls/linegraph.cpp
index 1ba1a0f5a5..6c59d0d919 100644
--- a/src/qml/controls/linegraph.cpp
+++ b/src/qml/controls/linegraph.cpp
@@ -94,7 +94,7 @@ void LineGraph::paintMarkerLines(QPainter * painter)
 
 void LineGraph::paintPath(QPainterPath * painter_path)
 {
-    int item_count = std::min(m_max_samples, m_value_list.size());
+    int item_count = std::min(m_max_samples, static_cast<int>(m_value_list.size()));
     qreal h = height();
     qreal w = width();

QQueue inherits from QList. In Qt5 size() returned an int but in Qt6 size() returns a qtsizetype


diff --git a/src/qml/pages/wallet/CreateName.qml b/src/qml/pages/wallet/CreateName.qml
index a780f23f76..e216801162 100644
--- a/src/qml/pages/wallet/CreateName.qml
+++ b/src/qml/pages/wallet/CreateName.qml
@@ -49,7 +49,7 @@ Page {
             Layout.leftMargin: 20
             Layout.rightMargin: 20
             placeholderText: qsTr("Eg. My bitcoin wallet...")
-            validator: RegExpValidator { regExp: /^[a-zA-Z0-9_]{1,20}$/ }
+            validator: RegularExpressionValidator { regularExpression: /^[a-zA-Z0-9_]{1,20}$/ }
             onTextChanged: {
                 continueButton.enabled = walletNameInput.text.length > 0
             }

Changed in Qt6


diff --git a/src/qml/pages/wallet/Send.qml b/src/qml/pages/wallet/Send.qml
index 69d843b337..e3c4366bff 100644
--- a/src/qml/pages/wallet/Send.qml
+++ b/src/qml/pages/wallet/Send.qml
@@ -161,7 +161,7 @@ PageStack {
                             anchors.right: parent.right
                             anchors.verticalCenter: parent.verticalCenter
                             source: "image://images/flip-vertical"
-                            icon.color: unitLabel.enabled ? Theme.color.neutral8 : Theme.color.neutral4
+                            color: unitLabel.enabled ? Theme.color.neutral8 : Theme.color.neutral4
                             size: 30
                         }
                     }

This is setting a property in an Icon which is defined by us in Icon.qml as a Button with required property color color and icon.color: root.color. In Qt6, only declared public properties are accessible from outside the component. Qt5 was more lenient about this.


diff --git a/src/qml/pages/wallet/SendResult.qml b/src/qml/pages/wallet/SendResult.qml
index 10f5c0449b..3b119aa7c4 100644
--- a/src/qml/pages/wallet/SendResult.qml
+++ b/src/qml/pages/wallet/SendResult.qml
@@ -5,7 +5,7 @@
 import QtQuick 2.15
 import QtQuick.Controls 2.15
 import QtQuick.Layouts 1.15
-import QtQuick.Dialogs 1.2
+import QtQuick.Dialogs
 import org.bitcoincore.qt 1.0
 
 import "../../controls"

See above, Qt 6 doesn't require specific version numbers and is backwarsd compatible for some modules but not the re-implemented Dialogs

@hebasto
Copy link
Member

hebasto commented Jun 12, 2025

diff --git a/src/qml/pages/wallet/SendResult.qml b/src/qml/pages/wallet/SendResult.qml
index 10f5c0449b..3b119aa7c4 100644
--- a/src/qml/pages/wallet/SendResult.qml
+++ b/src/qml/pages/wallet/SendResult.qml
@@ -5,7 +5,7 @@
 import QtQuick 2.15
 import QtQuick.Controls 2.15
 import QtQuick.Layouts 1.15
-import QtQuick.Dialogs 1.2
+import QtQuick.Dialogs
 import org.bitcoincore.qt 1.0
 
 import "../../controls"

See above, Qt 6 doesn't require specific version numbers and is backwarsd compatible for some modules but not the re-implemented Dialogs

Sure. But it is not consistent neither with the resulting code nor with other changes in this PR.

What is the problem with import QtQuick.Dialogs 1.2?

UPD. Oh , I see. It is a completely different module now.

@pinheadmz
Copy link
Contributor Author

import QtQuick.Dialogs 1.2 results in a "module not installed" error like this: https://stackoverflow.com/questions/73256760/qtquick-dialogs-version-1-3-is-not-installed-is-it-obsolete-on-6-3-1

QQmlApplicationEngine failed to load component
qrc:/qml/pages/main.qml:68:9: Type OnboardingWizard unavailable
qrc:/qml/pages/onboarding/OnboardingWizard.qml:38:9: Type OnboardingStorageLocation unavailable
qrc:/qml/pages/onboarding/OnboardingStorageLocation.qml:26:17: Type StorageLocations unavailable
qrc:/qml/components/StorageLocations.qml:8:1: module "QtQuick.Dialogs" version 1.2 is not installed
~InitExecutor : Stopping thread
~InitExecutor : Stopped thread

I have qt 6.9 installed and changed this line to import QtQuick.Dialogs 6.9 which worked. The docs sort of imply that version numbers arent needed any more and will by default match the current qt version.

I could add a commit that removes all version numbers from qt import statements?

@hebasto
Copy link
Member

hebasto commented Jun 12, 2025

I could add a commit that removes all version numbers from qt import statements?

This can be done after rebasing.

@pinheadmz
Copy link
Contributor Author

pinheadmz commented Jun 12, 2025

also: https://doc.qt.io/qt-6/qtquickcontrols-index.html#versions

Qt Quick Controls 2.0 was introduced in Qt 5.7. Subsequent minor Qt releases increment the import version of the Qt Quick Controls modules by one, until Qt 5.12, where the import versions match Qt's minor version.
In Qt 6, both the major and minor versions match, and version numbers may be omitted from imports in QML. If the version is omitted, the latest version will be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.