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.
21 October 2024
id 7677254289text not yet in the index
Ссылка
click to show
click to show
You can see all the available examples in: https://doc.qt.io/qtforpython-6/examples/index.html which is a gallery for https://code.qt.io/cgit/pyside/pyside-setup.git/tree/examples if something you need is only available in C++ like https://doc.qt.io/qt-6/qtgui-rhiwindow-example.html , please open a Suggestion on https://bugreports.qt.io
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)
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
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.
Cristián 🥑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
One would think so, but nothing I’ve attempted so far has changed UICs behavior
22 October 2024
Austin RhodesOne would think so, but nothing I’ve attempted so far has changed UICs behavior
keep in mind that pyside6-uic is a wrapper around the C++ tool uic so any change that we want to introduce to pyside6-uic needs to be contributed to uic first.
Could you please create a Suggestion on JIRA with your use case?
M.A MousaviI 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 p
I read your message a couple of times, but I'm struggling understanding the problem. Could you maybe try to provide a minimal example that can raise the problem so we could take a look at it?
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
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
25 October 2024
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.
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!
To the question on the PySide6 docs and examples. Is there a list of what differs between Qt6 and PySide6? I.e., additional functions (QDateTime.toPython, etc.), unimplemented ones (https://wiki.qt.io/Qt_for_Python/Considerations is merely structured and should be merged with https://doc.qt.io/qtforpython-6/considerations.html), changed return types (like QIODevice.readAll vs QIODevice.read in PyQt5 and PyQt6).
Anton YablokovBTW, 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.
The QByteArray Python wrapper object in the second version goes out of scope when passed to the QBuffer constructor. The Python GC then collects it.
The first keeps the instance around.