QtCore

• Dec 19, 2023 - 09:44

I am creating a plugin for MuseScore 3.6.2. According to the handbook, the Qt framework 5.9.9 is used
https://musescore.org/de/handbook/developers-handbook/plugins-3x

Why is it then that I can not use QtCore? No matter what version I try to import it always says "module "QtCore" is not installed". I want to use QHash in my plugin.

import MuseScore 3.0
import QtCore 2.0


Comments

The Musescore main app is written in C++ and Qt framework, which supports QtCore module. To edit its code visit https://github.com/musescore/MuseScore/

It provides plugin scripting functionality to end users. Plugins use QML, it is not the C++Qt, see https://doc.qt.io/archives/qt-5.9/qmlapplications.html. QML has a "QtQML" module see https://doc.qt.io/archives/qt-5.9/qtqml-index.html . The List ListModel ListElement type may be useful, see https://doc.qt.io/archives/qt-5.9/reference-overview.html "All QML Basic Types", "All QML Modules", and "All QML Types" . See also snippet https://musescore.org/en/node/320673#s22 .

QML has JavaScript Host Environment https://doc.qt.io/archives/qt-5.9/qtqml-javascript-hostenvironment.html , ms3's support is ECMA-262 5th edition standard, the new constructors won't work:

var x=new Set()
var y=new Map()

but this works:

var x={a:123,b:456}
console.log(x.a) // 123
var thisstring='a'
console.log(x[thisstring]) // 123

edit: correct QML has "QtQML" module ; edit2 fix js missing quotation marks 'a'

Do you still have an unanswered question? Please log in first to post your question.