Suggestion: clean separation between QML and JS

未关闭
#417 8 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
cpp, javascript

调研方向

Start by reading how MuseScore extensions connect their QML forms and composites to JavaScript actions; the issue points to the courtesy accidentals extension as an example. Determine whether the framework already supports calling shared JavaScript from QML, then define how that separation should work for future extensions. Done means the issue's proposed capability or existing approach is clearly established.

由索引模型根据 Issue 内容生成。

描述

I apologize in advance if this is already possible and I just don't understand understand how it works...

I like the separation of extensions into macros, forms, and composite, and I especially like how this works for macros - the actual code is cleanly separated from the manifest. It would be nice if the QML for the forms and composites were also cleanly separated from the code.

For example, consider the courtesy accidentals extension for MuseScore. The "add" action is associated with a JS file that contains the code to add accidentals - great. But the "configure" action is associated with a QML file that displays the dialog and also reproduces most of the code from the JS file. It would be fantastic to have the JS file contain all the code and allow the QML file to simply call over to it. That would simplify maintenance greatly.

I'm not particularly concerned with this particular extension but with future ones contributed by the community (e.g., me :-) ). Pretty much any composite extension is likely to have a similar issue - the main code common to the form and macro version. But even for an extension that is just a form, it still seems like it would be good practice to separate out the QML for the dialog from the JS for the code. Any given programmer might be more comfortable in one area than the other, and might want to rely on AI tools to help. This sort of separation would facilitate that as well.

Or maybe it's possible already and the courtesy accidentals extension just needs to be refactored to take advantage of this?

主要语言
C++
星标
14
派生
79
平均合并
1 天 14 小时
30 天内合并 PR
43

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

musescore/muse_framework 的其他 Issue

查看 musescore/muse_framework 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。