ChatCrawlersearch across public Telegram Open the app
Q

Qt for Python (PySide/Shiboken)

snapshot for October 2024
‹ October 2024 ›×
21 October 2024
A
I have a question on the UIC compiler. When I'm using a resource file in a project, I must put the generated .py file on the project root, as the UIC compiler will generate a simple import statement such as import icons_rc. Is there a way to tell the UIC compiler to generate the import statement using a path? An example would be from from Icons import icons_rc.
M.A Mousavitext not yet in the index
was this working in pyside6 in versions lower than 6.8.0 ? because there was a massive re-write of the global receiver, that is the signal/slot handling. (make sure to have your slots with the @Slot decorator)
C
Austin RhodesI have a question on the UIC compiler. When I'm using a resource file in a project, I must put the generated .py file on the project root, as the UIC compiler will generate a simple import statement such as import icons_rc. Is there a way to tell the UIC compiler to generate the import statement usi
Check pyside6-uic -h and you will see two options that might help you: --from-imports Python: generate imports relative to '.' --absolute-imports Python: generate absolute imports --rc-prefix Python: Generate "rc_file" instead of "file_rc" import --star-imports Python: Use * imports --python-paths <pathlist> Python paths for --absolute-imports. Maybe some of those solve your issue?
I was using qthread in a separate file and was controlling the thread from main python file. Then by more searching through the net i found that the better approach is to use worker and movetothread command to run it. The problem fixed. And I don't know if it was related or not. Now i have another problem. Whenever the worker class that substrates from qobject crashes or its connected signal receiver inside main python file crashes though i cash the error using try except method but the whole app crashes i should admit that when i was changing the thread to worker i removed the part if name = main: ... From worker file. And i also added a super constructor inside def init of worker class
M
First i dont know if changing the way i use threading is infact more efficient or not. Second I dont know how the problem has been fixed by these changes, third o dont know why my app had no crash on threads crash before changing method but now it has. Next i have no idea that what is the best way to handle threads crash from main code to continue where its left of.
22 October 2024
C
A
OK so let's say you have a folder in your project called Icons. This is where you put all your application Icons. You then create a resource file called icons.qrc, and use those icons inside a QMainWindow. For instance you add an icon to the two buttons on that form. When you use the resource compiler you have it create a icons_rc.py file inside the Icons folder. Then you use the UIC compiler to to transform your UI file to Python, and the UIC compiler generates a import icons_rc statement. What I'm asking is if I can get it to generate from Icons import icons_rc instead. I don't want to have the icons_rc.py file on the root of my project.
23 October 2024
I
Hello community 😊, I am currently working on improving the Qt for Python/PySide6 documentation and would greatly appreciate your feedback on what is lacking. We are also developing some new tutorials. Some among them focusing on the interoperability of PySide6 with other popular Python packages, and using Squish GUI testing with PySide6. Are there any other tutorials you would like to see? Thanks and appreciate the answers 👍🏽
24 October 2024
A
Mmmm I probably should. However since I’ve asked this question a few times over the years, and have gotten little response, I may just hold onto the solution like I’m guarding the Arkenstone.
25 October 2024
A
Is it possible to introduce into PySide6 Python-only features, such as __enter__ and __exit__ functions? It would be sweet to replace settings.beginGroup("sectionName") and settings.endGroup() with a single with settings.section("sectionName"): ..., for example. Presently, I make a class based on QSettings to provide such a syntax.
C
Hello everyone, After the previous release, we noticed a couple of issues on the meta information of the new wheels, so we took the opportunity to gather other set of issues reported by you, and release 6.8.0.2 The changes were * Fixing a couple of yocto build issues related to reproducible builds. * Amend the pyi stubs in order to be more compatible with mypy * Improve the Lazy Subtypes in star imports * Fix condition to allow 3.13 for wheel installation * Fix error handling in non-slot connection receivers We didn't want to make you wait until 6.8.1 which is expected for the end of November, so we hope these changes can unblock your work, and you can enjoy 6.8! Cheers!
A
BTW, why do I need a buffer of a QBuffer to be a variable? byteArray = QByteArray(b"abc") buffer = QBuffer(byteArray) buffer.seek(3) works, but with buffer = QBuffer(QByteArray(b"abc")), it crashes.
T
Hmm. Just tested the one-liner, and it works in the REPL.
T
This variant of the one-liner should work everywhere (Python 3.10+): buffer = QBuffer(_ := QByteArray(b"abc"))
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