Is there a way to enable word wrapping of text on some simple widgets like QPushButton?

前端 未结 5 1984
没有蜡笔的小新
没有蜡笔的小新 2020-12-10 05:52

I\'d like to make QPushButton word wrap and expand it\'s height instead of expanding width. How can I do that?

5条回答
  •  天命终不由人
    2020-12-10 06:21

    A straightforward solution is to insert a line break when writing the text inside the QPushButton just like

    This button has \n a long text
    

    If you are digning in QtDesigner, you can simply right-click the button and then "Insert line break"

提交回复
热议问题