machinekoder / python-qt-live-coding

Live coding environment for Python, Qt and QML.
MIT License
40 stars 7 forks source link

can"t make it run #8

Open jgirardet opened 4 years ago

jgirardet commented 4 years ago

Hi, from clean virtualenv with only pyside2 and python-qt-live-coding :

^C(.venv) jimmy@cacahuete:~/tras/python-qt-live-coding$ python_qt_live_coding examples
Error importing standalone/module: No module named 'standalone/module'
QQmlApplicationEngine failed to load component
file:///home/jimmy/tras/.venv/lib/python3.7/site-packages/livecoding/live.qml:31 Type LiveCodingPanel unavailable
file:///home/jimmy/tras/.venv/lib/python3.7/site-packages/livecoding/LiveCodingPanel.qml:220 Cannot assign to non-existent property "extensions"

^C(.venv) jimmy@cacahuete:~/tras/python-qt-live-coding$ python_qt_live_coding examples/standalone
QQmlApplicationEngine failed to load component
file:///home/jimmy/tras/.venv/lib/python3.7/site-packages/livecoding/live.qml:31 Type LiveCodingPanel unavailable
file:///home/jimmy/tras/.venv/lib/python3.7/site-packages/livecoding/LiveCodingPanel.qml:220 Cannot assign to non-existent property "extensions"

Have nive day Jimmy

asaladino commented 4 years ago

I have the same error and fixed it by adding property var in front of the extensions property. But even after that fix, I could get live coding to work. I made a change in a qml file and expected the app to update (similar to BrowserSync) but it did not. I must be missing something.

SrMordred commented 4 years ago

I´m stuck here too.

I´m just starting with Pyside+Qt+Qml so maybe there is an obvious solution but i just dont know.

So, what i notice so far: Start with the same error as above: QQmlApplicationEngine failed to load component file:///D:/programming/chest/live.qml:32:3: Type LiveCodingPanel unavailable file:///C:/Users/patri/AppData/Local/Programs/Python/Python38-32/lib/site-packages/livecoding/LiveCodingPanel.qml:220:5: Cannot assign to non-existent property "extensions" in LiveCodingPanel.qml:220:5: u found this:

  ProjectBrowser {
    id: browser
    projectPath: userProjectPath
    extensions: ['qml', 'ui.qml']
  }

ProjectBrowser is a custom Component made on python side that are founded here: projectbrowser.py The property that are failing are there:

    @Property('QStringList', notify=extensionsChanged)
    def extensions(self):
        return self._extensions

    @extensions.setter
    def extensions(self, value):
        if self._extensions == value:
            return
        self._extensions = value
        self.extensionsChanged.emit()

After messing around i noticed that none of this custom component properties are working. If u comment the property settings on the qml file u start to having error in other custom component properties. So maybe is Pyside that are not binding correctly the properties to the Qt/Qml side.

Not sure if this repo is still being maintained, and i´m still new on this stack so this is the further that i could go by now.

asaladino commented 4 years ago

I gave up on this project. However, as it turns out, you can do this in Qt Creator. There is a project template called "Qt for Python - Qt Quick Application - Empty" that creates a pyslide2 qml application.

qtcreator

For live coding, use Build -> QML Preview.

qmlpreview