musescore / musescore/MuseScore

EditStaff dialog assertion failure on startup

Open Beginner friendly
#32,749 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

regression nightly UX/interaction
Dominant language
C++
Stars
15.1k
Forks
3.3k
Avg merge
2d 2h
Merged PRs (30d)
91

Description

Issue type

UX/Interaction bug (incorrect behaviour)

Description with steps to reproduce
Description

The EditStaff dialog (Staff Properties) triggers assertion failures in UiConfiguration::screen() when opened. The dialog still opens but logs errors because its IoC context is null. The "Instrument" fields are empty. And "Replace Instrument" button would not give any dialog.

Error Log
21:32:01.487 | INFO  | main_thread     | ActionsDispatcher::doDispatch | try call action: staff-properties
21:32:01.510 | ERROR | main_thread     | UiConfiguration::screen | ASSERT FAILED:    ctx    /home/runner/work/MuseScore/MuseScore/src/framework/ui/internal/uiconfiguration.cpp:663
21:32:01.515 | ERROR | main_thread     | UiConfiguration::screen | ASSERT FAILED:    ctx    /home/runner/work/MuseScore/MuseScore/src/framework/ui/internal/uiconfiguration.cpp:663
21:32:03.521 | ERROR | main_thread     | Interactive::openWidgetDialog | Dialog is not opened: "65654_3" , ignoring this hide event
Root Cause

The iocCtxForQWidget() function in src/framework/global/modularity/ioccontext.cpp is unimplemented and always returns a null context pointer. This affects all QWidget-based dialogs that inherit from muse::Contextable.

Solution

Implement iocCtxForQWidget() to return the global IoC context instead of null.

File changed:

  • src/framework/global/modularity/ioccontext.cpp (lines 66-69)
Supporting files, videos and screenshots

Unable to test due to #32720

In which versions of MuseScore Studio is this issue present?

Nightly

Regression

Yes, this works in the latest released version and is broken in the nightly builds

Operating system

/

Additional context

Will be tested after #32743 is merged.

Checklist
  • This report follows the guidelines for reporting bugs and issues
  • I have verified that this issue has not been logged before, by searching the issue tracker for similar issues
  • I have attached all requested files and information to this report
  • I have attempted to identify the root problem as concisely as possible, and have used minimal reproducible examples where possible

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/framework/global/modularity/ioccontext.cpp at lines 66-69 and inspect how the global IoC context is obtained. After the dependency in #32720 and the related #32743 work are available, open the EditStaff dialog and verify that the assertion logs, empty Instrument fields, and Replace Instrument behavior are resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.