Nevermind, I found QPaintDevice::logicalDpiX which does the trick.