Qt and high dpi screens

前端 未结 1 1298
甜味超标
甜味超标 2021-01-13 11:50

I\'ve read several articles on this. So I have a Dell XPS 13 and changed the size of text, apps and other items to 200%

But I guess my question is the foll

1条回答
  •  说谎
    说谎 (楼主)
    2021-01-13 12:16

    For certain widget classes you can try to provide size measures relative to its font size with the stylesheet:

    pMyWidget->setStyleSheet(
       "MyWidget {"            // What type is it? 
           "min-width: 80em;"  // If the dimension
           "min-height: 40em;" // attribute is
           "width: 160em;"     // applicable
           "height: 80em;"     // to this type.
           // margin:          // See the list
           // padding:         // of related
           // spacing:         // attributes
    "}");
    

    That "em" refers to capital "M" font size AFAIR. The tricky part here is what actual MyWidget type is and if you can apply a stylesheet like that. You can probably omit the widget type in style MyWidget {} but leave the contents yet it supposed to modify all the widgets that that one is parenting.

    0 讨论(0)
提交回复
热议问题