ChatCrawlersearch across public Telegram Open the app
Q

Qt for Python (PySide/Shiboken)

20 January 2022
2022-01-20×
20 January 2022
C
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.
R
I played on pyqt6 and it worked perfectly
I had to install this
R
I believe it's the PySide6 problem too
if it's a local image, you could use icon.source: Qt.resolvedUrl("your_icon.png")
inside your Button component, ofc
if the user needs to change it from Python, then you can connect a signal that changed the property, receiving the "your_icon.png" string, and set it as the source
I wonder why people need to install qt from the installer in linux, it comes with the package manager in most distros. I guess OP was using an old version or a super-duper stable distro?
it's like what I read in other channels, people trying to install python while being installed...of course as long you need to have maaany versions it's understandable.
C
exactly, that's a valid usage, but it seems to me (i might be wrong) that OP was only trying to install qt
M
Ссылка
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
K
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.
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
K
If you don't want to do the instantiation of them from QML, you can inject the instances into the root context of the QML engine.
M
No, 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
K
I think I need a little more information before I can recommend the right approach.
But I guess nothing stopping you from doing that...
K
Seems like it would break separation of UI and business logic
Calendar: January 2022
Archive by month
Open in Telegram Каталог площадок Искать в ChatCrawler

A snapshot of an open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · What we do not do · Remove a page · Catalog