Skip to content

[Notation] Made the notation input and the view logic independent of Qt. Step 2 - #35842

Open
Eism wants to merge 10 commits into
musescore:mainfrom
Eism:notation_no_qt_step2
Open

Eism wants to merge 10 commits into
musescore:mainfrom
Eism:notation_no_qt_step2

Conversation

@Eism

@Eism Eism commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator

The public interfaces of notation (INotation, IExcerptNotation, IMasterNotation, INotationParts, INotationElements, INotationInteraction, INotationContextConfiguration, INotationConfiguration, INotationPainting) used QString, QColor, QPixmap, QList and qreal, so a host without Qt could not implement or call them. This PR replaces them with muse::String, muse::draw::Color, std::vector and double. The conversion to the Qt types is done by the callers in the Qt layer (notationscene, preferences, playback, project, instrumentsscene, converter, print, importexport).

The wallpapers are the only place where it is not just a type replacement. INotationConfiguration loaded them as QPixmap, but they are only used to paint the screen (the printing fills the page with white). So the loading is moved to the view: AbstractNotationPaintView loads and caches them, and passes the page wallpaper to INotationPainting::paintView and ContinuousPanel as std::shared_ptr<const muse::draw::Pixmap>. The pixmap is shared, so it stays valid for the one who is painting even if the path is changed meanwhile, and it is not copied on every paint. INotationConfiguration only returns the paths now.

Not in this PR: the implementations inside notation still use Qt (Val of QColor, SearchCommandsParser, the cursor flash timer, NotationMidiInput), and the models of the Qt layer still use QString and QColor.

Changes

  • notation: double instead of qreal in INotationInteraction::addStretch and INotationContextConfiguration
  • notation: String instead of QString for the instrument names in INotationParts, for the names in INotation, IExcerptNotation, IMasterNotation::createEmptyExcerpt and for INotationElements::search
  • notation: String instead of QString in formatInstrumentTitle and staffTypeToString; the translations use mtrc instead of qtrc
  • notation: Color instead of QColor and std::vector<int> instead of QList<int> in INotationConfiguration
  • notation: INotationPainting::paintView takes ViewOptions (frameRect, isPrinting, isAutomation, pageWallpaper) instead of the separate parameters
  • notationscene: AbstractNotationPaintView loads and caches the wallpapers (QtWallpaperCache); backgroundWallpaper() and foregroundWallpaper() are removed from INotationConfiguration
  • notationscene, preferences, playback, project, instrumentsscene, converter, print, importexport: convert to the Qt types where the values are passed to Qt

@Eism
Eism requested a review from igorkorsukov November 30, 2026 14:41
@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Notation name, instrument, configuration, and painting APIs now use Muse string, drawing, and standard-library types in place of several Qt types. Wallpaper pixmaps are cached by path and passed through the notation painting flow. Export, UI, playback, and project call sites add conversions where Qt types are still required.

Merge Risk: Minimal · up to c6cf0

This refactor swaps Qt types for Muse and standard-library types in the notation interfaces and adds conversions where Qt is still needed. No concrete regression was found; the remaining uncertainty is that no build or test results were reported.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title '[Notation] Made the notation input and the view logic independent of Qt. Step 2' matches the main change: notation public interfaces now use muse::String, muse::draw::Color, std::vector and…
Description check Passed The description covers the purpose and motivation: hosts without Qt cannot implement or call the notation interfaces. It lists the type replacements, explains the wallpaper change (loading moved to th…
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.
Full details: Title check

Explanation

The title '[Notation] Made the notation input and the view logic independent of Qt. Step 2' matches the main change: notation public interfaces now use muse::String, muse::draw::Color, std::vector and double instead of Qt types, with the wallpaper loading moved to the view. The title is a single sentence, specific, and accurately describes the primary change. It is 79 characters and 14 words, which is a little long but still readable.

Full details: Description check

Explanation

The description covers the purpose and motivation: hosts without Qt cannot implement or call the notation interfaces. It lists the type replacements, explains the wallpaper change (loading moved to the view, shared pointer rationale), notes what is excluded from the PR, and gives a per-module change list. It does not fill the template's required 'Resolves: #NNNNN' issue reference or the checklist, and it does not state whether tests were added or manually verified. Those gaps are minor relative to the substantive content.

Resolution

Consider adding the issue reference in the 'Resolves:' line, ticking the checklist items that apply (CLA, title, guidelines, no unnecessary changes, compile and manual test), and stating whether a unit test was added. The objectives also note that no test results are reported.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Linked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were analyzed; skipped musescore/muse_framework.git.

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 0aaadca and c6cf0e4.

Files selected for processing: 2

  • src/notation/internal/notationpainting.h
  • src/notationscene/internal/qt/qtwallpapercache.h

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

@Eism
Eism force-pushed the notation_no_qt_step2 branch from 03a1002 to 0aaadca Compare November 30, 2026 14:50
…ContinuousPanel, remove the wallpapers from INotationConfiguration
@Eism
Eism force-pushed the notation_no_qt_step2 branch from 0aaadca to c6cf0e4 Compare November 30, 2026 14:56

This branch has not been deployed

No deployments
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.

1 participant