bonjour il n'y a pas besoin doc c'est facile a tester
désolé en python
app = QApplication([])
font = QFont()
font.setPixelSize(10)
print("font:", font)
print(font.pointSize(), "pt", font.pixelSize(), "px")
font = QFont()
font.setPointSize(18)
print("font:", font)
print(font.pointSize(), "pt", font.pixelSize(), "px")
j'obtiens :
font: <PySide6.QtGui.QFont(Noto Sans,-1,10,0,400,0,0,0,0,0,0,0,0,0,0,1) at 0x7f75c5f53040>
-1 pt 10 px
font: <PySide6.QtGui.QFont(Noto Sans,18,-1,0,400,0,0,0,0,0,0,0,0,0,0,1) at 0x7f75c5f53080>
18 pt -1 px
doc (traduite):
int QFont::pixelSize() const
Returns the pixel size of the font if it was set with setPixelSize(). Returns -1 if the size was set with setPointSize() or setPointSizeF().