@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.
23 August 2022
the pytest-qt model tester will find such issues for you: https://pytest-qt.readthedocs.io/en/latest/modeltester.html
Ссылка
click to show
click to show
also your self._data will not do what you think it does, btw: https://nedbatchelder.com/blog/201308/names_and_values_making_a_game_board.html
I usually read the C++ docs - https://doc.qt.io/qt-6/qt.html#ItemDataRole-enum tells you the roles there are, you usually only care about DisplayRole, both for data and headerData
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
Sr. STesting in a vm seems like "working" more or less as intended, I guess is a problem with my desktop environment
I'm guessing it is some oddity of HiDPI support. See if you can characterize it a bit more, figure out when exactly it happens (look at your scale factor for the monitor it's on, and see if when it behaves badly is at a point that relates to the scale factor). If you can characterize it well enough, write up a bug at https://bugreports.qt.io
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
id 439545522I 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
spacer_item = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.policy.Minimum, QtWidgets.QSizePolicy.policy.Maximum)
use policy method and then M... attribute