IDE Configuration

Atjaunināts pirms 2 years

    This is a work-in-progress page that attempts to describe how to set up MuseScore development with different IDEs. Do you use an IDE that doesn't have any info here? Please, help others out and add the info for your IDE!

    Qt Creator (Windows, Linux)

    Qt Creator is the official IDE for Qt projects. It has many Qt-specific features that other IDEs don't have, or don't have as soon as Qt Creator has them.

    The only reason not to use Qt Creator would be if you already have a strong preference for a different IDE.

    Advantages

    • Detailed example projects. These allow you to test Qt features outside of MuseScore's huge codebase.
    • Visual Design mode for editing Qt's .ui (user iterface) files, such as MuseScore's playpanel.ui.
    • Qt language-aware. Proper syntax highlighting and debugger support for Qt-specific extensions to the C++ and JavaScript programming languages, such as signals and slots, QML, etc.
    • Cross-platform. Edit in the same environment on Windows, Mac and Linux.
    • Included with Qt by default. If you have Qt then you have Qt Creator!

    Coding style

    Download the file qt2-musescore.xml and import into Qt Creator via Projects > Code Style > Import... to have MuseScore's coding rules enforced automatically by the IDE.

    Keyboard Shortcuts

    A choice selection:

    • F2 - Follow symbol under cursor.
      • Click on a variable/function/class name and press this to be taken to its declaration. Useful if you don't know what something is or what it does.
    • Ctrl+Shift+U - Find references to symbol under cursor.
      • Show places where this variable/function/class is used anywhere in the project (i.e. not just in the current file).
    • Ctrl+Shift+R - Rename symbol under cursor.
      • Changes the name of a variable/function/class here and everywhere else it occurs, kind of like a "smart" find-and-replace.
    • F4 - Switch between header (file.h) and source (file.cpp) files.
    • Shift+F2 - Switch between function declaration and definition.

    See the full list of keyboard shortcuts and how to define your own.

    VSCode (Linux)

    There should be some config files already in .vscode.

    A popup will appear asking if you want to install the 'recommended extensions'. Install all the extensions that are recommended. For reference, these are:

    • Microsoft C/C++ tools (ms-vscode.cpptools)
    • CMake tools (ms-vscode.cmake-tools)
    • CMake (twxs.cmake)

    You may need to restart your editor at this point. If CMake tools complains about not being able to access files, try chowning the entire directory - you may have accidentally run a command as su. If you still get errors, try running the command CMake: configure or restarting your editor again.

    IntelliSense and other features (jump to definition, syntax highlighting, error checking) should now work. If you're encountering problems, message @jthistle on Telegram via the development chat.

    Advantages

    • A massive extensions database, allowing you to customize the editor to fit your needs perfectly
    • IntelliSense support (advance syntax highlighting, pre-compile error checking etc.)
    • Jump to definition/find usages support
    • Built-in intelligent debugging via gdb

    One disadvantage is that editing UI files is not easy with just VSCode. You may want to consider simultaneously installing QtCreator in order to make changes to the UI.

    Debugging with VSCode

    You can debug MuseScore through VSCode. You do first need to build manually however, so run make installdebug or similar to create a debug build. The default debug configuration runs from a debug build, so if you only build release, debugging will not work.

    Microsoft Visual Studio (Windows)

    XCode (Mac)

    If you have a Mac, XCode is the recommended IDE