Split qml file into 2 broken in musescore 3

• Dec 13, 2019 - 05:55

It looks like separating a qml file into multiple is not working anymore.
Does anyone know why.
Here's what I tried:

// MyRectangle.qml
import QtQuick 2.0
 
Rectangle {
      anchors.fill: parent
      color: blue
      }

and the main file:

import QtQuick 2.0
import MuseScore 3.0
 
MuseScore {
      menuPath: "Plugins.pluginName"
      description: "Description goes here"
      version: "1.0"
      MyRectangle {id: mycomponent}
      }

This outputs: Creating component failed line 8: MyRectangle is not a type
I also tried adding the line import "MyRectangle.qml" at the beginning of main.qml.
Doesn't work: same issue.

I was looking for some plugins that used splitting into multiple files, like mentionned in this thread
However, I found out that both plugins had been rewritten to fit in a single file.

I know javascript imports work fine, but has anyone managed these?


Comments

In reply to by ecstrema

Could these lines:

#ifdef Q_OS_WIN
      QStringList importPaths;
      QDir dir(QCoreApplication::applicationDirPath() + QString("/../qml"));
      importPaths.append(dir.absolutePath());
      setImportPathList(importPaths);
#endif
#ifdef Q_OS_MAC
      QStringList importPaths;
      QDir dir(mscoreGlobalShare + QString("/qml"));
      importPaths.append(dir.absolutePath());
      setImportPathList(importPaths);
#endif

be replaced by

#ifdef Q_OS_WIN
      addImportPath(QDir(QCoreApplication::applicationDirPath() + QString("/../qml")));
#endif
#ifdef Q_OS_MAC
      addImportPath(QDir(mscoreGlobalShare + QString("/qml")));
#endif

Unfortunately, i cant install Qt at my school computer, so i can't build MuseScore myself.
Could anyone try that for me?

might be worth an issue, though...

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