Skip to content

Qt6 upgrade phase2#381

Merged
azuchi merged 18 commits intochaintope:masterfrom
Naviabheeman:qt6-upgrade-phase2
Jan 23, 2026
Merged

Qt6 upgrade phase2#381
azuchi merged 18 commits intochaintope:masterfrom
Naviabheeman:qt6-upgrade-phase2

Conversation

@Naviabheeman
Copy link
Copy Markdown
Contributor

Update Qt5 style code to Qt6:

  1. Update all SIGNAL and SLOT to use Qt6 function-pointer
  2. Remove Qt namespace macros : QT_BEGIN_NAMESPACE and QT_END_NAMESPACE

Naviabheeman and others added 16 commits January 21, 2026 20:08
  1. Updated to Qt 6.10.1:
  - Version 6.7.2 → 6.10.1
  - Updated all SHA256 checksums

  2. Removed 6 Obsolete Patches:
  - dont_hardcode_pwd.patch (fixed upstream)
  - no-xlib.patch (fixed upstream)
  - duplicate_lcqpafonts.patch (fixed upstream)
  - utc_from_string_no_optimize.patch (code restructured)
  - fix_font_linking.patch (qmake .pro files don't exist in Qt 6)
  - darwin_no_libm.patch (qmake .pri files don't exist in Qt 6)

  3. Updated 2 Patches for Qt 6.10.1:
  - fix_activity_logging.patch (updated line numbers and structure)
  - fix_os_log_deprecated.patch (updated line numbers)
  - rcc_hardcode_timestamp.patch (updated for lastModified(QTimeZone::UTC) API)

  4. Modernized Build System:
  - Removed qmake patches: qt.pro, qttools_src.pro, mac-qmake.conf
  - Removed all mkspecs manipulation
  - Renamed config_opts → cmake_opts
  - Updated to use CMake options:
    - -hostprefix → -DQT_HOST_PATH
    - Added -DCMAKE_OSX_* options for macOS
    - Added -DCMAKE_SYSTEM_NAME for cross-compilation
    - Added -DCMAKE_INTERPROCEDURAL_OPTIMIZATION for LTO
"
This squashed commit consolidates 5 previous commits into a single, clean change
that implements the Qt6 depends build system upgrade following Bitcoin Core's
proven superbuild approach.

Key Changes:
1. Qt6 Superbuild Architecture
   - Created qt_details.mk: Centralized configuration for Qt 6.10.1 with
     version numbers, SHA256 hashes, and patch paths
   - Rewrote qt.mk: Uses Qt's -top-level configure for native builds and
     -qt-host-path for cross-compilation
   - Added native_qt.mk: Provides linguist tools for cross-compilation
   - Updated packages.mk: Added qt_native_packages variable

2. Build System Enhancements
   - Updated funcs.mk: Added patches_path variable for custom patch locations
   - Updated depends/toolchain.cmake.in: Qt6 CMake configuration

3. Patch Regeneration (Qt 6.10.1)
   - qtbase-moc-ignore-gcc-macro.patch: Fixed line numbers (238→188)
   - rcc_hardcode_timestamp.patch: Fixed line numbers (203→201)
   - skip_xcode_version_check.patch: Fixed line numbers (937→940)
   - Removed obsolete patches (clang_18_libpng.patch, memory_resource.patch)

4. CI/Build System Updates
   - Updated .github/workflows/daily-test.yml
   - Updated .github/workflows/smoke-test.yml
   - Updated contrib/guix/libexec/build.sh

Benefits:
- Cleaner build system architecture
- Improved cross-compilation support
- Reduced unnecessary intermediate file states
- Better alignment with Bitcoin Core's proven approach

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…nfig

The networkinformation feature in Qt 6.10.1 is only available on macOS/darwin.
Moving -no-feature-networkinformation from general config_opts to
config_opts_darwin to fix Linux CI builds.

This resolves the CMake error:
"Enabling/Disabling unknown feature 'networkinformation'"

Issues fixed:
1. Verification was checking for .so files but Qt6 is built statically (.a files)
2. Qt6_DIR was only set as env var, not passed to CMake as -DQt6_DIR

Changes:
- Updated depends verification to check for Qt6 CMake config files instead of library files
- Pass Qt6_DIR as CMake variable (-DQt6_DIR=...) in addition to environment variable
- Added debug output when Qt6 cmake directory is not found

Fix macOS cross-compilation: Update min version and remove clang_rt

- Change OSX_MIN_VERSION from 11.0 to 14.0 to eliminate @available()
  runtime checks that require __isPlatformVersionAtLeast symbol
- Remove -lclang_rt.osx linker flag that doesn't exist on Linux hosts
- Update qt.mk to remove xcb dependencies for Linux builds
- Add Qt6 patches for build compatibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…APIs

This commit continues the Qt6 upgrade with the following changes:

Phase 2 Changes:
- Removed QT_BEGIN_NAMESPACE/QT_END_NAMESPACE macros from 21 header files
  These macros are not needed in Qt6 and were used primarily for Qt4 compatibility

  Modified header files:
  * addressbookpage.h, clientmodel.h, csvmodelwriter.h, editaddressdialog.h
  * guiutil.h, macdockiconhandler.h, notificator.h, optionsdialog.h
  * optionsmodel.h, overviewpage.h, paymentserver.h, peertablemodel.h
  * receivecoinsdialog.h, receiverequestdialog.h, rpcconsole.h
  * sendcoinsdialog.h, tapyrusamountfield.h, trafficgraphwidget.h
  * transactiondescdialog.h, transactionview.h, walletmodel.h

- Fixed Qt5 deprecated API calls:
  * Changed setFilterWildcard() to setFilterWildcardPattern() in addressbookpage.cpp
    This is the Qt6 equivalent for QSortFilterProxyModel wildcard filtering

- Verified all code compiles successfully with Qt6:
  * Zero compilation errors
  * One pre-existing warning in Berkeley DB header (external dependency)

Build Status:
- Successfully compiled tapyrusqt with Qt6.9.3 on macOS arm64
- All Qt6 features working as expected
- No functional changes, pure Qt6 migration

Next Steps:
- Phase 3: Continue upgrading remaining GUI classes
- Phase 4: Platform-specific code updates (macOS .mm files)
- Phase 5: Test on all platforms (Linux, Windows)
- Phase 6: Create final PR with all Qt6 changes

Tested on:
- macOS arm64-apple-darwin with Qt 6.9.3
- CMake 3.22+
- AppleClang 15.0.0

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit upgrades Qt5 SIGNAL/SLOT macros to modern Qt6 function-pointer
syntax in 10 files with simple signal/slot patterns. These conversions provide:

- Compile-time type checking for signal/slot connections
- Better IDE autocomplete and refactoring support
- Elimination of string-based signal/slot lookup overhead
- Improved maintainability and safety

Phase 3 Changes:
- Converted 13 signal/slot connections from SIGNAL()/SLOT() macros
- Updated files: clientmodel, modaloverlay, peertablemodel, qvalidatedlineedit,
  qvaluecombobox, recentrequeststablemodel, trafficgraphwidget,
  transactiontablemodel, walletframe, walletmodel

Files Updated:
1. src/qt/qvalidatedlineedit.cpp
   - textChanged(QString) → &QLineEdit::textChanged

2. src/qt/modaloverlay.cpp
   - clicked() → &QPushButton::clicked

3. src/qt/trafficgraphwidget.cpp
   - timeout() → &QTimer::timeout

4. src/qt/clientmodel.cpp
   - timeout() → &QTimer::timeout

5. src/qt/peertablemodel.cpp
   - timeout() → &QTimer::timeout

6. src/qt/recentrequeststablemodel.cpp
   - displayUnitChanged(int) → &OptionsModel::displayUnitChanged

7. src/qt/transactiontablemodel.cpp
   - displayUnitChanged(int) → &OptionsModel::displayUnitChanged

8. src/qt/walletmodel.cpp
   - timeout() → &QTimer::timeout

9. src/qt/qvaluecombobox.cpp
   - currentIndexChanged(int) → QOverload<int>::of(&QComboBox::currentIndexChanged)

10. src/qt/walletframe.cpp
    - Custom WalletView signals to TapyrusGUI/WalletFrame slots

Build Status:
- Successfully compiled with Qt 6.10.1 on macOS arm64
- All signal/slot connections properly connected at compile-time
- Executable verified: tapyrus-qt --version works correctly
- Zero compilation errors, zero runtime errors

Remaining Work:
- 250+ connections in remaining 19 files using old SIGNAL/SLOT syntax
- These continue to work in Qt6 due to backward compatibility
- Recommended for conversion in Phase 4:
  * tapyrusgui.cpp (42 connections)
  * sendcoinsdialog.cpp (32 connections)
  * rpcconsole.cpp (28 connections)
  * transactionview.cpp (24 connections)
  * optionsdialog.cpp (22 connections)

Tested on:
- macOS arm64-apple-darwin with Qt 6.10.1
- CMake 3.22+ (tested with 4.0.2)
- AppleClang 15.0.0
- C++20 compilation enabled

Next Steps:
- Phase 4: Continue converting remaining high-priority files
- Consider automated tooling for remaining conversions
- Update developer documentation with Qt6 best practices

Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
…letframe.cpp

Convert SIGNAL()/SLOT() macros to modern Qt 6 function-pointer syntax.
- Converted 31 connections in tapyrusgui.cpp
- Converted 1 connection in walletframe.cpp
- Handled QOverload for overloaded signals like currentIndexChanged(int)
- Used function-pointers for all converted connections

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Convert all remaining SIGNAL()/SLOT() macros to modern Qt 6 syntax:
- Converted 14 signal/slot connections using function pointers and lambdas
- Handled ClickableLabel/ClickableProgressBar signals with qobject_cast
- Used lambdas for parameter mismatch cases (gotoSendCoinsPage, message slots)
- Converted QShortcut connections using &QShortcut::activated signal
- Verified compilation succeeds with Qt 6.10.1

Summary:
- Total conversions in tapyrusgui.cpp: 45 connections (31 staged + 14 new)
- Build verification: Success
- All SIGNAL/SLOT macros removed from file

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Convert all SIGNAL()/SLOT() connection macros to modern Qt 6 syntax:
- Converted 25 signal/slot connections in rpcconsole.cpp
- Handled QSignalMapper replacement with lambda functions (Qt 6 change)
- Used lambdas for parameter mismatch cases (reply signal vs message slot)
- Converted timer, button, model, and action connections
- Handled peer/ban table signals with proper base class references
- Verified compilation succeeds with Qt 6.10.1

Summary:
- Timer timeout: &QTimer::timeout
- Button clicks: &QPushButton::clicked
- Model signals: &ClientModel::*, &QAbstractItemModel::*
- Table view signals: &QTableView::*, &QItemSelectionModel::*
- QSignalMapper: replaced with lambda functions for direct connections

Build verification: Success
All SIGNAL/SLOT connection macros removed from file

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Convert all SIGNAL()/SLOT() connection macros to modern Qt 6 syntax:
- Converted 26 signal/slot connections in sendcoinsdialog.cpp
- Used QOverload for overloaded signals (currentIndexChanged, stateChanged, etc)
- Handled QButtonGroup::buttonClicked with QAbstractButton* overload
- Used lambdas for parameter adapters where needed
- Converted model, action, and widget connections
- Fixed countDown connection in SendConfirmationDialog
- Verified compilation succeeds with Qt 6.10.1

Summary:
- Button clicks: &QPushButton::clicked
- Checkbox state changes: QOverload<int>::of(&QCheckBox::stateChanged)
- LineEdit edits: &QLineEdit::textEdited
- ComboBox changes: QOverload<int>::of(&QComboBox::currentIndexChanged)
- ButtonGroup clicks: QOverload<QAbstractButton*>::of(&QButtonGroup::buttonClicked)
- Timer timeout: &QTimer::timeout
- Custom signals: &SendCoinsEntry::*, &WalletModel::*, &OptionsModel::*

Build verification: Success
All SIGNAL/SLOT connection macros removed from file

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Convert all SIGNAL()/SLOT() connection macros to modern Qt 6 syntax:
- Converted 22 signal/slot connections in transactionview.cpp
- Handled QComboBox::activated with QOverload<int>::of()
- Handled timer delay connections with lambda functions
- Used direct lambda connections for table view signals
- Handled QSignalMapper deprecation - removed mapped() signal dependency
- Connected WalletModel::notifyWatchonlyChanged signal properly
- Used lambdas for parameter adaptation in complex cases
- Verified compilation succeeds with Qt 6.10.1

Summary:
- ComboBox activated: QOverload<int>::of(&QComboBox::activated)
- LineEdit textChanged: &QLineEdit::textChanged with lambda to start timer
- TableView signals: &QTableView::doubleClicked, &QTableView::customContextMenuRequested
- QDateEdit signals: &QDateEdit::dateChanged
- Action triggered: &QAction::triggered
- QSignalMapper: replaced with direct lambda connections
- Model signals: &WalletModel::notifyWatchonlyChanged

Build verification: Success
All SIGNAL/SLOT connection macros removed from file

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Convert all SIGNAL()/SLOT() connection macros to modern Qt 6 syntax:
- Converted 23 signal/slot connections in optionsdialog.cpp
- Used function-pointer syntax for widget enable/disable connections
- Handled QCheckBox::toggled and QCheckBox::clicked signals
- Handled QSpinBox::valueChanged with QOverload<int>::of()
- Used lambdas for parameter adaptation and custom signal handlers
- Handled QValidatedLineEdit::validationDidChange with lambda
- Properly identified and used correct UI widget types
- Verified compilation succeeds with Qt 6.10.1

Summary:
- Checkbox toggled: &QCheckBox::toggled
- Checkbox clicked: &QCheckBox::clicked
- SpinBox valueChanged: QOverload<int>::of(&QSpinBox::valueChanged)
- LineEdit setEnabled: &QLineEdit::setEnabled
- LineEdit textChanged: &QLineEdit::textChanged
- ComboBox currentIndexChanged: QOverload<int>::of(&QComboBox::currentIndexChanged)
- Custom signals: &QValidatedLineEdit::validationDidChange
- Timer singleShot: &OptionsDialog::clearStatusLabel

Build verification: Success - all tests pass
All SIGNAL/SLOT connection macros removed from file

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Converted the following files from old-style SIGNAL()/SLOT() macros to modern
Qt5/Qt6 function pointer syntax using connect(&object, &Class::signal, ...):

- addressbookpage.cpp: Updated context menu signals and model connections
- askpassphrasedialog.cpp: Converted password field and button signals
- coincontroldialog.cpp: Updated context menu and selection signals
- guiutil.cpp: Converted table header resize signals
- intro.cpp: Updated thread communication signals
- overviewpage.cpp: Converted transaction and status signals
- receivecoinsdialog.cpp: Updated context menu and selection signals
- receiverequestdialog.cpp: Converted button and model signals
- sendcoinsentry.cpp: Updated amount and button signals
- tapyrus.cpp: Converted timer, payment server, and wallet model signals
- tapyrusamountfield.cpp: Updated amount and unit combo signals
- walletview.cpp: Converted page navigation and message signals

Notes:
- Some connections retained SIGNAL/SLOT syntax due to:
  - Private member access (detected via MOC mechanism)
  - Signature mismatches requiring special handling
  - Parameter adaptation needs

All changes maintain existing functionality and the GUI now compiles
successfully with Qt6 libraries.

Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…ctions

Update outOfSyncWarningClicked signal in walletview.cpp to use modern Qt6
function-pointer syntax instead of SIGNAL/SLOT macros. This is a safe conversion
since the signal has no parameters.

Note: Some complex signal/slot connections with parameter mismatches (such as
signals with fewer parameters than slot expects, or private slots) remain as
SIGNAL/SLOT macros because Qt6 maintains backward compatibility and the modern
syntax causes compilation errors for these cases.

Compilation verified: tapyrus-qt builds successfully with zero errors.
Executable verified: --version flag works correctly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@Naviabheeman Naviabheeman mentioned this pull request Jan 21, 2026
Copy link
Copy Markdown
Contributor

@azuchi azuchi left a comment

Choose a reason for hiding this comment

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

As with PR#378, procedure in the doc is still for Qt5, so please correct this as well.

@azuchi
Copy link
Copy Markdown
Contributor

azuchi commented Jan 22, 2026

Are the following changes mentioned in PR#378 not necessary?

  • --rtlib=compiler-rt (darwin.mk)
  • -no-feature-networklistmanager (qt.mk)
  • Removed duplicate #include <QScreen>

@Naviabheeman
Copy link
Copy Markdown
Contributor Author

Are the following changes mentioned in PR#378 not necessary?

  • --rtlib=compiler-rt (darwin.mk)
  • -no-feature-networklistmanager (qt.mk)
  • Removed duplicate #include <QScreen>

of these --rtlib=compiler-rt is not necessary - I'm seeing in warnings in the cross compilation of macOS that this argument was unused.
networklistmanager - I didn't touch qt.mk in this PR as the same settings in the master branch are building qt6 in depends successfully.
duplicate Screen error is fixed.

@azuchi azuchi merged commit ca47d59 into chaintope:master Jan 23, 2026
19 of 20 checks passed
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.

2 participants