ChatCrawlersearch across public Telegram Open the app
Q

Qt for Python (PySide/Shiboken)

23 August 2022
2022-08-23×
23 August 2022
K
@boris_ yes, QScreen can tell you the devicePixelRatio - that is reported by the OS, and is this scaling you're referring to. It is reported and settable on a per-screen basis, so if you have multiple displays, you can set the scaling differently on each display, and Qt apps can fetch that and use it how they wish.
A
Text scaling and UI scaling (devicePixelRatio) are two different settings, which of the two has the user set?
if orientation.name == "Horizontal": is weird - why not check the actual value? Also, your rowCount and columnCount are incorrect, because they claim that there is data for children elements as well, so this would be an (endless) tree and not a table now
also if your data is fixed, consider using a QStandardItemModel instead, it'll be much easier to use
Items can have children, a model is a tree. If you ignore parent and always return 5, it means that every item also has 5 child items.
not sure if QAbstractTableModel prevents this from happening somehow (over QAbstractItemModel), check the model tester and see what it complains about
oh also your data ignores the role, which means you override all kinds of different properties (font, color, probably also sizes?) with a string, which makes no sense
just return None except for Qt.ItemDataRole.DisplayRole
as for the orientation, compare it to Qt.Orientation.Horizontal instead - I *think* checking the string should work, but I don't even know if it'll be the same between PyQt6 and PySide6
K
Replymessage unavailable
@boris_ with Qt5 you had a number of environment variables and Application Attributes you could pass and tweak. Qt6 eliminated a lot of those, but I think you can still entirely turn off Qt's HiDPI support. I can't remember which env vars and/or application attributes are still present. Have a search through the Qt docs for HiDPI or High DPI - there's a page on it.
hi, any idea why my ApplicationWindow is showing on a corner and not centered on screen? If I use minimumWidth 700 and minimumHeight 520 (or values that are lower) it centers the window, however, using higher values just move the window to the bottom left corner (2nd monitor) or top right corner (only 1 monitor enabled). I'm using PySide 6.3.1, and QtQuick
S
Testing in a vm seems like "working" more or less as intended, I guess is a problem with my desktop environment
S
ok, I'll try to identify the problem checking that, thank you
K
I've come up with a few odd cases that I've reported bugs for or found someone else has reported a bug for and have fleshed out exactly when it happens, and had R&D provide a fix. Most of that was ~Qt 5.15, and have been fixed.
I
I am a beginner and I had previously written a piece of code with pyqt5 and now I want to upgrade the source to pyqt6. I don't know what to write instead of the code below spacer_item = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy..Minimum, QtWidgets.QSizePolicy.Maximum) I read the document and I think it should be QtWidgets.QSizePolicy.setHorizontalPolicy() I should use it and pass a policy object to it. But I don't know how to create the policy object pls help me guys

Calendar: August 2022
MoTuWeThFrSaSu1223445406786941029111812131415161718191201212212322243251262732829193025313
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