based on qtbase/examples/widgets/widgets/tablet