QLabel自適應內容大小

QLabel能夠識別正常文本以及富文本的格式。spa void adjustSize() 方法能夠自動識別文本內容的大小。code 代碼表示以下:源碼 QLabel lab; lab.setText("這是一個文本!"); lab.adjustSize(); int width = lab.width(); int height = lab.height(); 若是想知道內部的實現,能夠查看源碼
相關文章
相關標籤/搜索