20 January 2022
Rafaeltext not yet in the index
I guess you mean pypi binaries, since pip is just the installer. Did you check other projects that use pyside and flatpak?
Ссылка
click to show
click to show
For example here there is a user with an issue with PyQt and PySide https://github.com/flatpak/flatpak-builder-tools/issues/239
Keep in mind flatpak has nothing to do with Qt, neither pyside, so it's completely expected that different tools will have different behavior, and the same way you find problems with one python module, there might be others as well. The same story with others freezing tools, some of them will not work properly. It's a join effort of people filing bug reports in the right place and providing all the details to reproduce and hopefully even a patch to solve the issue.
Cristián 🥑I guess you mean pypi binaries, since pip is just the installer. Did you check other projects that use pyside and flatpak?
there are few and I found one with pyside6 and it was the solution I got. But the webengine didn't work
Cristián 🥑Then you have the solution in your hands, you need to use pyqt6
I didn't want to because the project is ready and tested. I've only seen in the port that there are some incompatible things
In case I was not expressing myself well :
Please file a bug report with the steps to reproduce, system information, details of your interpreter, so people is aware of the problem. Otherwise nobody will ever fix it.
https://wiki.qt.io/Qt_for_Python/Reporting_Bugs
Welcome @huglewu 🎉 🎊
Remember to check the documentation page https://doc.qt.io/qtforpython/ and the wiki https://pyside.org if you have some questions.
Ссылка
click to show
click to show
Hey,
I want to visualise some data, which I get over network with a byte-wise protocol. So I handle this communication via Python itself.
I want to update and create QML objects, where each QML object has its own Python(PySide6) object.
So I am wondering, what is possible/best practice to do this?
I read in the internet and following sites/articles:
Using Slots/Signals
https://stackoverflow.com/questions/39398730/qt-create-object-in-c-and-expose-to-qml
This seems not very straight forward for me, it feels like more work and I have no glue, if or how I expose every single PySide6 object, maybe with the new QML_Element decorator?
The other option is to create the objects from the backend
https://doc.qt.io/qt-5/qtqml-cppintegration-interactqmlfromcpp.html
I have the feeling, it is not very QML style and I will maybe loose control in QML?
Can you give me some advises? Is there somewhere an example? What is best practice with PySide6?
Thanks
Markus BauerHey,
I want to visualise some data, which I get over network with a byte-wise protocol. So I handle this communication via Python itself.
I want to update and create QML objects, where each QML object has its own Python(PySide6) object.
So I am wondering, what is possible/best practice to do this?
Are these python objects in some sort of list or dictionary?
If you have a list or dictionary, you could expose them to QML using a QAbstractListModel - then you define a ListView in QML, and you can provide a delegate to render it however you like - as complex or as simple as you'd like.
Keith KyzivatAre these python objects in some sort of list or dictionary?
If you have a list or dictionary, you could expose them to QML using a QAbstractListModel - then you define a ListView in QML, and you can provide a delegate to render it however you like - as complex or as simple as you'd like.
Can I use a ListView delegate to draw the components by x,y,width, height etc in an item?
Markus BauerCan I use a ListView delegate to draw the components by x,y,width, height etc in an item?
Not sure what you mean. If you use a ListView, you don't want to/need to specify an absolute X,Y pos for each of the items.
If you just have a fixed number of items you want to show, then I'd create a QML interface with those fixed items, and just have one or more Python objects that are registered with QML via @QmlElement (or is it @Qml_Element - I think the latter).
You can then actually do the instantiation of the Python objects from the QML
Markus BauerNo, i have a variable number of rectangles, where I have to dynamically add/remove items, change properties like x,y, width, height
I place the rectangles by x and y because they cover parts of an image
Create a model, use it in a Repeater in QML, position your rectangles whatever you like
Keith KyzivatI think I need a little more information before I can recommend the right approach.
I want to add dynamically add/remove/change rectangles via network and show them with specific properties(color, position, size) inside an Container, the container holds a background picture
So I need to create new objects via Python and also be able to change existing objects via Python
Don't know how or what I should explain more in detail
Serhii OlendarenkoCreate a model, use it in a Repeater in QML, position your rectangles whatever you like
Thanks for this advise
I haven't found, does the repeater consume data changed signals?
Serhii OlendarenkoCreate a model, use it in a Repeater in QML, position your rectangles whatever you like
Oh good point... Though positioning where you want is weird to me with a repeater.
Keith KyzivatSeems like it would break separation of UI and business logic
True, but the position and size is all the logic
It's just a viewer more or less, which displays data from network
Serhii OlendarenkoCreate a model, use it in a Repeater in QML, position your rectangles whatever you like
Looks very promising, thanks a lot
I will try it :-)