中文字幕 另类精品,亚洲欧美一区二区蜜桃,日本在线精品视频免费,孩交精品乱子片免费

<sup id="3hn2b"></sup>

    1. <sub id="3hn2b"><ol id="3hn2b"></ol></sub><legend id="3hn2b"></legend>

      1. <xmp id="3hn2b"></xmp>

      2. 新聞中心

        EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > Qt 類型編輯實例-指定QPushButton 菜單指示器的子控制

        Qt 類型編輯實例-指定QPushButton 菜單指示器的子控制

        作者: 時間:2012-07-31 來源:網(wǎng)絡(luò) 收藏

        子控提供了訪問子子元素的功能, 例如通常的時候一個按鈕將會管理一個,

        本文引用地址:http://www.antipu.com.cn/article/148687.htm

        QPushButtON#evilButton::menu-indicator {

        image: url(myindicator.png);

        }

        同時如果美化一個按鈕的話, 那么將可以通過定位符來確定美化按鈕的路徑, 通??梢允且粋€圖片。

        ::menu-indicator {

        image: url(myindicator.png);

        subcontrol-position: right center;

        subcontrol-origin: padding;

        left: -2px;

        }

        經(jīng)過以上的設(shè)置那么 將會在方格的中心顯示一個myindicator.png 的圖片。

        復(fù)雜的選擇區(qū)域的例子:

        當(dāng)應(yīng)對于一個用戶可可可輸入的部件的時候, 將需要設(shè)計到用戶選擇區(qū)域的顏色設(shè)置, 與設(shè)置, 下面將通過使用QLineEdit 部件來進(jìn)行演示:

        QLineEdit { color: red }

        QLineEdit{color:red}

        QLineEdit[readOnly=true]{color:gray}

        在團隊開發(fā)的時候, 需要設(shè)計到不同顏色的設(shè)置, 或者說不同的設(shè)置, 那么就需要在樣式當(dāng)中有多種選擇, 將不需要的那部分, 注釋掉:

        QLineEdit { color: red }

        QLineEdit[readOnly=true] { color: gray }

        #regiSTrationDialog QLineEdit { color: brown }

        自定義制定的部件

        這個部分提供了一些自定義特殊部件的某種樣式

        定制QAbstractScrollArea

        比如說一些QAbstractScrollArea 類, 例如 QTextEdit 與QTextBrowser . 同時可以使用后臺的屬性來進(jìn)行設(shè)置。 例如來設(shè)置一個 背景圖片。

        QTextEdit, QListView {

        background-color: white;

        background-image: url(draft.png);

        background-attachment: scroll;

        }

        下面的代碼是讓背景圖片與可瀏覽的區(qū)域大小相同:

        QTextEdit, QListView {

        background-color: white;

        background-image: url(draft.png);

        background-attachment: fixed;

        }

        給QCheckBox 做樣式

        QCheckBox 與QRadioButton 具有想色的屬性, 他們之間的不同時QCheckBox是返回當(dāng)前的狀態(tài):

        QCheckBox {

        spacing: 5px;

        }

        QCheckBox::indicator {

        width: 13px;

        height: 13px;

        }

        QCheckBox::indicator:unchecked {

        image: url(:/images/checkbox_unchecked.png);

        }

        QCheckBox::indicator:unchecked:hover {

        image: url(:/images/checkbox_unchecked_hover.png);

        }

        QCheckBox::indicator:unchecked:pressed {

        image: url(:/images/checkbox_unchecked_pressed.png);

        }

        QCheckBox::indicator:checked {

        image: url(:/images/checkbox_checked.png);

        }

        QCheckBox::indicator:checked:hover {

        image: url(:/images/checkbox_checked_hover.png);

        }

        QCheckBox::indicator:checked:pressed {

        image: url(:/images/checkbox_checked_pressed.png);

        }

        QCheckBox::indicator:indeterminate:hover {

        image: url(:/images/checkbox_indeterminate_hover.png);

        }

        QCheckBox::indicator:indeterminate:pressed {

        image: url(:/images/checkbox_indeterminate_pressed.png);

        }



        評論


        相關(guān)推薦

        技術(shù)專區(qū)

        關(guān)閉