學(xué)做餅干網(wǎng)站全球網(wǎng)站流量排名100
Qt樣式表可以在幫助文檔中搜索? "Qt? ?Style? ?Sheets" ?在幫助文檔中可更詳細(xì)的查閱相關(guān)資料。
通常情況下我們需要知道樣式表中的各個(gè)樣式,需要我們查閱官方文檔的相關(guān)資料;
可以在幫助文檔中搜索 "Qt? Style? Sheets? Reference"(樣式參考表);
該樣式參考表內(nèi)容包括:
? ? ? ? ? ? ? ?樣式小部件列表;(LIst? of? Stylable? Widgets)
? ? ? ? ? ? ? ?屬性列表;? ? ? ? ? ? ?(List? of? Properties)
? ? ? ? ? ? ? ?圖標(biāo)列表;? ? ? ? ? ? ?(List? of? Icons)
? ? ? ? ? ? ? ?屬性類型列表;? ? ? (List? of? Property? Types)
? ? ? ? ? ? ? ?偽狀態(tài)列表;? ? ? ? ?(List? of? Pseudo-States)
? ? ? ? ? ? ? ?子控件列表;。? ? ?(List? of? Sub-Controls)
常用屬性列表? ?List? of? Properties
? 背景相關(guān)(background):
? background-color(背景顏色)? :? ?小部件使用的背景顏色。
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?【例】:QLabel{background-color:yellow}? ? ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?QLineEdit{background-color:rgb(255,0,0)}
?background-image(背景圖像) : 小部件背景圖像
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 【例】:QFrame{background-image:url(:/images/hydro.png)}
background-repeat(背景位置)
background-attachment(背景附件)
background-origin()
框式和邊框?qū)挾?#xff0c;指定端層顏色(border)
border-top? :? 設(shè)置小部件的頂部邊界縮寫符號(hào),相當(dāng)于指定端級(jí),端式或邊緣寬度
? ? ? ? ? ? ? ? ? ? ?border-top-color ,? border-top-style , border-top-width 。
border-right : 同上,?border-right-color ,? border-right-style , border-right-width 。
border-bottom(底板) : 同上。border-left:同上。
border-color : 所有邊界的邊緣的顏色。
? ? ? ? ? ? ? ? ? ? ? 【例】:QLineEdit{
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? border-width: 1px;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? border-style : solid;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? border-color : blue;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?}
?border-radius(邊框圓角半徑,):用來設(shè)置圓角
? ? ? ? ? ? ? ? ? ? ? ? ? 【例】:QLineEdit{
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? border-width: 2px;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? border-style : solid;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? border-radius: 4px;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
border-style(邊框樣式)? ?;? 常用的樣式有,solid ,? none , dot-dot-dash。
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?【例】:QLabel{ border-style:solid };
button-layout : 按鈕本身布局,常用的幾種按鈕布局,
? ? ? ? ? ? ? ? ? ? ? ? 0(WinLayout),1 (MacLayout),? 2 (KdeLayout),? 3 (GnomeLayout)??
? ? ? ? ? ? ? ? ? ? ? ? 5 (AndroidLayout)。
? ? ? ? ? ? ? ? ? ? ? ? ?【例】: *{button-layout: 2}
? ? ? ? ? ?