Skip to content

Fix qmltyperegistrar "used as base type but cannot be found" warnings - #362

Merged
igorkorsukov merged 2 commits into
musescore:mainfrom
cbjeukendrup:fix-qmltyperegistrar-base-type-warnings
Oct 16, 2026
Merged

igorkorsukov merged 2 commits into
musescore:mainfrom
cbjeukendrup:fix-qmltyperegistrar-base-type-warnings

Conversation

@cbjeukendrup

@cbjeukendrup cbjeukendrup commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

The build printed warnings like:

Warning: extensionstoolbarmodel.h:30: muse::uicomponents::AbstractToolBarModel is used as base type but cannot be found.

qmltyperegistrar only knows the metatypes of the libraries a QML module links against. Listing a module under IMPORTS is not enough, so muse_extensions_qml and muse_workspace_qml now link muse_uicomponents_qml.

SelectableItemListModel::Item could never be found, because moc does not support Q_OBJECT in nested classes. It added nothing over QObject (the model only stores the items, and subclasses cast them to their own type), so the model now holds plain QObjects.

MuseScore counterpart (links the remaining modules, updates the item classes): musescore/MuseScore#35255

🤖 Generated with Claude Code

cbjeukendrup and others added 2 commits October 16, 2026 00:59
qmltyperegistrar only knows the metatypes of the libraries a QML module
links against, so modules deriving from types in muse_uicomponents_qml
must link it, not just import it.

SelectableItemListModel::Item could not be found at all, because moc does
not support Q_OBJECT in nested classes; it is now the top-level
SelectableItem.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SelectableItem added nothing over QObject: the model only stores the
items, and subclasses cast them to their own type anyway.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: musescore/muse_framework/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: b4be279a-b58f-4468-b69f-e0b381f9f9e0
📥 Commits

Reviewing files that changed from the base of the PR and between b48088d and fc873c7.

📒 Files selected for processing: 4
  • framework/extensions/qml/Muse/Extensions/CMakeLists.txt
  • framework/uicomponents/qml/Muse/UiComponents/selectableitemlistmodel.cpp
  • framework/uicomponents/qml/Muse/UiComponents/selectableitemlistmodel.h
  • framework/workspace/qml/Muse/Workspace/CMakeLists.txt

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The selectable item model now stores and exposes QObject pointers instead of pointers to its nested Item class. The model retains its row validation and insertion notifications. The Extensions and Workspace QML targets each add a private link to muse::uicomponents_qml.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to fc873

No actionable merge-blocking issue was established. The selectable-item change and QML links appear ready for normal build validation.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (2 skipped: 2 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Warning The description explains the warning, the linking changes, and the QObject refactor, but it omits the required issue reference and leaves the required checklist incomplete, including CLA, testing, cod… Add a valid Resolves: #NNNNN issue reference, complete every applicable checklist item with [x], and list the AI tool used under the AI-assistance section. Add any required testing and prior-attempt details.
Passed Passed checks: 3 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly identifies the primary change: fixing qmltyperegistrar warnings about unresolved base types.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (2 skipped: 2 unsupported.)

Full details: Description check

Explanation

The description explains the warning, the linking changes, and the QObject refactor, but it omits the required issue reference and leaves the required checklist incomplete, including CLA, testing, coding rules, unnecessary changes, and AI-assistance confirmation.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@igorkorsukov
igorkorsukov merged commit 42b0224 into musescore:main Oct 16, 2026
3 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