Open Ryan-rsm-McKenzie opened 1 year ago
Hi Ryan, only thing that could stand out as a potential problem is the str()
around the settings.key
. Did you already try without?
Otherwise I wouldn't really know what could be the issue
QStrings are supposed to be implicitly converted to Python strings, so I guess the explicit conversion bypasses the implicit one and we've never had to deal with that before as no one's tried converting what has a convincing fake ID saying it's a string to another string.
Removing the str()
doesn't work either
The binding is defined here: https://github.com/ModOrganizer2/modorganizer-plugin_python/blob/7c54a45f636bc34ade6e687f33982581d1b0fcf9/src/runner/pythonrunner.cpp#L244
Are any of the other def_readwrite
fields of any types working?
I tested description
and default_value
and those both failed with the same error message.
I'd be curious to know if this still happens on the dev builds which are using qt6. I don't remember if the last release included moving off of boost python, which was also a somewhat recent change.
Oh, PyQt5. In that case, the lines I linked are less relevant as a bunch of stuff changed. As well as converting from PyQt5 to PyQt6 (and therefore changing SIP versions and how things are bound), we changed from boost::python
to pybind11
, so it could also have been something lost from doing that if we did it before the last release.
The problem:
When accessing the
key
attribute on an instance ofmobase.PluginSetting
an error is thrown reportingTypeError: No Python class registered for C++ class class QString
To Reproduce:
Steps to reproduce the behavior:
plugins
directory:import typing
import mobase from PyQt5.QtWidgets import QMainWindow, QMessageBox
class SamplePlugin(mobase.IPlugin): def init(self, organizer: mobase.IOrganizer) -> bool: organizer.onUserInterfaceInitialized(self.__onUserInterfaceInitialized) return True
def createPlugin() -> mobase.IPlugin: return SamplePlugin()