刪除多餘的空間,我試圖用樣式表各地QLabel
padding:0px,
text-ident:0px;
margin:0px;
border: none;
並通過代碼,改變大小政策擴大。
其中有標籤的部件內部的佈局有
QHBoxLayout* lyt = new QHBoxLayout();
setLayout(lyt);
lyt->setContentsMargins(0,0,0,0);
和設置內容父控件邊距設置爲0了。
我把它做得更小的唯一方法是將固定尺寸設置爲更小的尺寸。但是文字有wrap屬性,所以它可以更大,我無法控制。
我該怎麼辦?
setMargin沒有工作,setSpacing和setContentsMargins到最近設置的佈局通常有效,但令人驚訝的是不在這裏。標籤繼續在其周圍留有餘地。在和不在。 – darkgaze