Widget alignment in cell pyqt

坚强是说给别人听的谎言 提交于 2019-12-05 20:34:27

I solved this problem in quite simply way. First of all I changed margin of layout to 0px (later I changed that to 3px to have padding) and this made my alignment exactly to top, left corner. Next step was set minimum size for each row and that I made by following line:

self.verticalHeader().setMinimumSectionSize(30)

added in constructor.

After that I received exactly what I want:

  1. widget with some pading from top and bottom
  2. not fixed size of rows so multiline text in item is allowed as well
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!