Using Qt Quick in MuseScore plugin
-
Hello.
MuseScore uses qml for writing plugins.
In program folder I found C:/Programs/MuseScore 2/qml/Qt/WebSockets/declarative_qmlwebsockets.dll
But when I'm trying write plugin with WebSockets, I'm getting error:First, I declare:
import Qt.WebSockets 1.0
After that, when I trying to run code, I get:
creating component failed
line 9: plugin cannot be loaded for module "Qt.WebSockets": Cannot load library C:/Programs/MuseScore 2/qml/Qt/WebSockets/declarative_qmlwebsockets.dll: Не найден указанный модуль. (Module not found)--
I'm download Qt5WebSockets.dll and put in C:\Programs\MuseScore 2\bin
And error changedcreating component failed
line 9: plugin cannot be loaded for module "Qt.WebSockets": Cannot load library C:/Programs/MuseScore 2/qml/Qt/WebSockets/declarative_qmlwebsockets.dll: Не найдена указанная процедура. (Procedure not found)how to get the WebSockets work?
-
@TwentySix said:
line 9: plugin cannot be loaded for module "Qt.WebSockets": Cannot load library C:/Programs/MuseScore 2/qml/Qt/WebSockets/declarative_qmlwebsockets.dll: Не найдена указанная процедура. (Procedure not found)
Usually, that means you are using the wrong version of the DLL.
Make sure your DLLs are all built with the same compiler and the same Qt version.
-
@JKSH
I found right dll file, and now code compiling without errors.
But when I add this:WebSocket { id: socket }
Program crash and I'm getting messagebox with:
Microsoft Visual C++ Runtime Library
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
ОКAPPCRASH
MuseScore.exe
Qt5Core.dll -
@TwentySix said:
I found right dll file
- Where did you get this DLL from?
- What version of Qt was used to build MuseScore itself?
- What compiler was used to build MuseScore itself?
EDIT: I found out that MuseScore 2.0.2 was compiled using Qt 5.4.2 and MinGW 4.9.1. You must get the DLLs from that version of Qt. You must also Qt 5.4.2 and MinGW 4.9.1 to build your plugin. Visual Studio is not compatible.
-
@JKSH said:
- Where did you get this DLL from?
- What version of Qt was used to build MuseScore itself?
- What compiler was used to build MuseScore itself?
EDIT: I found out that MuseScore 2.0.2 was compiled using Qt 5.4.2 and MinGW 4.9.1. You must get the DLLs from that version of Qt. You must also Qt 5.4.2 and MinGW 4.9.1 to build your plugin. Visual Studio is not compatible.
I downloaded DLL from here > http://rpm.pbone.net/index.php3/stat/4/idpl/30656663/dir/fedora_20/com/mingw32-qt5-qtwebsockets-5.4.1-1.fc20.noarch.rpm.html
MuseScore don't need compile plugins in a DLL.
Plugins created directly in program and stored as qml files.
If you have installed MuseScore, you can create or open existing plugins from menu - Plugins > Plugin Creator -
@TwentySix said:
I downloaded DLL from here > http://rpm.pbone.net/index.php3/stat/4/idpl/30656663/dir/fedora_20/com/mingw32-qt5-qtwebsockets-5.4.1-1.fc20.noarch.rpm.html
That is not an official Qt package.
Try the official one: http://download.qt.io/archive/qt/5.4/5.4.2/qt-opensource-windows-x86-mingw491_opengl-5.4.2.exe
@TwentySix said:
@JKSH said:
- Where did you get this DLL from?
- What version of Qt was used to build MuseScore itself?
- What compiler was used to build MuseScore itself?
MuseScore don't need compile plugins in a DLL.
But your Qt WebSockets DLLs need to be compatible with MuseScore's other DLLs. That's why I asked about your version and compiler.
Your program probably crashed because you downloaded incompatible DLLs.