musescore / musescore/MuseScore

[MU4 Issue][Plugins] A "Qt.quit()" instruction in a plugin closes the entire MS4

Open
#13,222 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P2 plugins
Dominant language
C++
Stars
15.1k
Forks
3.3k
Avg merge
2d 2h
Merged PRs (30d)
91

Description

Calling Qt.quit()in a plugin closes the entire MS4.

Although it is not longer recommended for plugin developers to use Qt.quit() to close their plugins, it can still be found in many plugins.

To be reproduced with this basic plugin:

import QtQuick 2.2
import MuseScore 3.0
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.1 // was 1.3 in MS3, but 1.1 in Temperaments
import QtQuick.Window 2.3

MuseScore {
    menuPath: "Plugins.testBasicGUI"
    description: "This plugins shows a BasicGUI "
    version: "1.0"
    requiresScore: false
    pluginType: "dialog"
    id: mainWindow
    width : 300
    height : 300
    
    ColumnLayout {
        id: container
        anchors.margins: 5
        anchors.fill: parent
        spacing: 5
        CheckBox {
            text: "I'm the default component"
            checked: true
        }

        Button {
            text: qsTranslate("QPlatformTheme", "Close")
            Layout.alignment: Qt.AlignLeft
            onClicked: {
                //mainWindow.parent.Window.window.close();
                Qt.quit(); // as found in many-many plugins --> closes MS4
            }
        }
    }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the supplied basic MuseScore plugin and trigger the button calling Qt.quit(). Trace how plugin dialogs handle Qt.quit() and application shutdown. Done means the plugin can close without closing the entire MuseScore application, while preserving the expected behavior for existing plugins.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.