QSettings not bound under Linux

• Mar 4, 2010 - 23:55
S4 - Minor

The Qt QSettings class is not bound under Linux, while it is usable under Windows. Tested with rev. 2825.

STR: run the attached test plugin both under Windows and under Linux: in the first case a testQSettings.ini file is created in the same folder of the plugin; in the second case, an error is issued.

This may apply to other Qt classes as well, but of course I did not test each of them!
My Linux: Ubuntu 9.04 with Qt SDK 2010.01. Source has been compiled from Qt Creator using its CMake interface.

Attachment Size
testQSettings.zip 973 bytes


It does not work (or even give an error) on Windows 7 if MuseScore is installed to a protected location (such as Program Files). It works as expected on Windows 7 if I run MuseScore from an unprotected location such as My Documents.

What does the error say for Linux?

(Tested using r. 2834, self-built).

The error message under Ubuntu is:

"Reference Error: Can't find variable 'QSettings'"

So, it is definitely related with coding, while your issue with Windows 7 is related with authorizations at OS level: QSettings is found and an instance created and called, but when it tries to create the INI file in a protected location the OS blocks it (presumably the g_settings.setValue() statement in the plugin code returns false, but I didn't bother to check it).

While checking other plugins, I found that NO Qt class is accessible; as it seems I am the only one to experience such a big problem, it has to be related to the way I compiled the code, opening the CMakeLists.txt file with Qt Creator to create a project out of it (the procedure which is suggested for Windows). Presumably, Ubuntu does not like it.

I'll wait a little for any suggestion and then I'll close the issue.


The Qt binding is part of MuseScore code. You can found it in the scriptgen directory.
During your compilation, check that the file in this directory are compiled.