Skip to content

Commit e56a055

Browse files
committed
Convert inspector stub module to proper QML module
1 parent b28189f commit e56a055

File tree

8 files changed

+83
-52
lines changed

8 files changed

+83
-52
lines changed

src/stubs/inspector/CMakeLists.txt

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,12 @@
1717
#
1818
# You should have received a copy of the GNU General Public License
1919
# along with this program. If not, see <https://www.gnu.org/licenses/>.
20-
declare_module(inspector)
2120

22-
set(MODULE_QRC ${CMAKE_CURRENT_LIST_DIR}/view/inspector_resources.qrc)
21+
muse_create_module(inspector STUB)
2322

24-
set(MODULE_QML_IMPORT ${CMAKE_CURRENT_LIST_DIR}/view/qml)
23+
target_sources(inspector PRIVATE
24+
inspectorstubmodule.cpp
25+
inspectorstubmodule.h
26+
)
2527

26-
set(MODULE_SRC
27-
${CMAKE_CURRENT_LIST_DIR}/inspectorstubmodule.cpp
28-
${CMAKE_CURRENT_LIST_DIR}/inspectorstubmodule.h
29-
)
30-
31-
set(MODULE_IS_STUB ON)
32-
setup_module()
28+
add_subdirectory(qml/MuseScore/Inspector)

src/stubs/inspector/inspectorstubmodule.cpp

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,35 +21,9 @@
2121
*/
2222
#include "inspectorstubmodule.h"
2323

24-
#include "modularity/ioc.h"
25-
#include "ui/iuiengine.h"
26-
2724
using namespace mu::inspector;
28-
using namespace muse::modularity;
29-
30-
static void inspector_init_qrc()
31-
{
32-
Q_INIT_RESOURCE(inspector_resources);
33-
}
3425

3526
std::string InspectorModule::moduleName() const
3627
{
3728
return "inspector";
3829
}
39-
40-
void InspectorModule::registerExports()
41-
{
42-
}
43-
44-
void InspectorModule::registerResources()
45-
{
46-
inspector_init_qrc();
47-
}
48-
49-
void InspectorModule::registerUiTypes()
50-
{
51-
std::shared_ptr<muse::ui::IUiEngine> ui = ioc()->resolve<muse::ui::IUiEngine>(moduleName());
52-
if (ui) {
53-
ui->addSourceImportPath(inspector_QML_IMPORT);
54-
}
55-
}

src/stubs/inspector/inspectorstubmodule.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
* You should have received a copy of the GNU General Public License
2020
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
*/
22-
#ifndef MU_INSPECTOR_INSPECTORSTUBMODULE_H
23-
#define MU_INSPECTOR_INSPECTORSTUBMODULE_H
22+
23+
#pragma once
2424

2525
#include "modularity/imodulesetup.h"
2626

@@ -31,10 +31,5 @@ class InspectorModule : public muse::modularity::IModuleSetup
3131
InspectorModule() = default;
3232

3333
std::string moduleName() const override;
34-
void registerExports() override;
35-
void registerResources() override;
36-
void registerUiTypes() override;
3734
};
3835
}
39-
40-
#endif // MU_INSPECTOR_INSPECTORSTUBMODULE_H
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# SPDX-License-Identifier: GPL-3.0-only
2+
# MuseScore-Studio-CLA-applies
3+
#
4+
# MuseScore Studio
5+
# Music Composition & Notation
6+
#
7+
# Copyright (C) 2025 MuseScore Limited
8+
#
9+
# This program is free software: you can redistribute it and/or modify
10+
# it under the terms of the GNU General Public License version 3 as
11+
# published by the Free Software Foundation.
12+
#
13+
# This program is distributed in the hope that it will be useful,
14+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
# GNU General Public License for more details.
17+
#
18+
# You should have received a copy of the GNU General Public License
19+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
21+
muse_create_qml_module(inspector_qml FOR inspector STUB)
22+
23+
qt_add_qml_module(inspector_qml
24+
URI MuseScore.Inspector
25+
VERSION 1.0
26+
QML_FILES
27+
InspectorForm.qml
28+
TextStylePopup.qml
29+
IMPORTS
30+
TARGET muse_uicomponents_qml
31+
)

src/stubs/inspector/view/qml/MuseScore/Inspector/InspectorForm.qml renamed to src/stubs/inspector/qml/MuseScore/Inspector/InspectorForm.qml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ import QtQuick 2.15
2424
import Muse.UiComponents
2525

2626
Rectangle {
27-
property var model: null
27+
property var model
28+
property var navigationSection
29+
property int navigationOrderStart
30+
property var notationView
2831

2932
color: ui.theme.backgroundPrimaryColor
3033

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* SPDX-License-Identifier: GPL-3.0-only
3+
* MuseScore-Studio-CLA-applies
4+
*
5+
* MuseScore Studio
6+
* Music Composition & Notation
7+
*
8+
* Copyright (C) 2025 MuseScore Limited
9+
*
10+
* This program is free software: you can redistribute it and/or modify
11+
* it under the terms of the GNU General Public License version 3 as
12+
* published by the Free Software Foundation.
13+
*
14+
* This program is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU General Public License
20+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
21+
*/
22+
import QtQuick
23+
24+
import Muse.UiComponents
25+
import MuseScore.NotationScene
26+
27+
AbstractElementPopup {
28+
id: root
29+
30+
model: null
31+
32+
property var notationViewNavigationSection
33+
property int navigationOrderStart
34+
readonly property int navigationOrderEnd: 0
35+
36+
StyledTextLabel {
37+
anchors.centerIn: parent
38+
text: "Text Style Popup Stub"
39+
}
40+
}

src/stubs/inspector/view/inspector_resources.qrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/stubs/inspector/view/qml/MuseScore/Inspector/qmldir

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)