How to check if tablet mode is active?

I’m guessing sizeCategory is determined from things like

QT_QPA_EGLFS_PHYSICAL_WIDTH=140
QT_QPA_EGLFS_PHYSICAL_HEIGHT=220

?

e.g.