• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            逛奔的蝸牛

            我不聰明,但我會很努力

               ::  :: 新隨筆 ::  ::  :: 管理 ::
            @import url(http://www.shnenglu.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css); 如圖所示,QTableView使用的QHeaderView與scrollbar的style sheet.@import url(http://www.shnenglu.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);


            scrollbar使用到下面兩張背景圖,放到工程目錄下的images文件夾里:
             

            具體的style sheet代碼,這里面的CSS代碼還可以寫得更優(yōu)雅一些,反正是起作用了,沒太大興趣再去繼續(xù)弄
            /*
             垂直滾動條
            */
            QScrollBar:vertical 
            {
                background
            : url(images/scrollbar-vertical-bg.png);
                width
            : 9px;
                margin
            : 0px 0 0px 0;
            }
            QScrollBar::handle:vertical 
            {
                background
            : rgb(195, 195, 195);
                min-height
            : 20px;
                margin
            : 0 1px 0 2px;
                border-radius
            : 3px;
                border
            : none;
                
            /*background: qlineargradient(spread:reflect, 
                    x1:0, y1:0, x2:1, y2:0, 
                    stop:0 rgba(164, 164, 164, 255), 
                    stop:0.5 rgba(120, 120, 120, 255),
                    stop:1 rgba(164, 164, 164, 255));
            */
                
            /*border-image: url(images/scrollbar-vertical-thumb.png) 8px 0 8px 0 fixed;*/
            }

            QScrollBar::add-line:vertical 
            {
                background
            : url(images/scrollbar-vertical-bg.png);
                height
            : 0px;
                subcontrol-position
            : bottom;
                subcontrol-origin
            : margin;
            }

            QScrollBar::sub-line:vertical 
            {
                background
            : url(images/scrollbar-vertical-bg.png);
                height
            : 0px;
                subcontrol-position
            : top;
                subcontrol-origin
            : margin;
            }

            QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical 
            {
                border
            : 1px solid grey;
                width
            : 3px;
                height
            : 3px;
                background
            : white;
            }

            QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical 
            {
                background
            : none;
            }

            /*
             水平滾動條
            */
            QScrollBar:horizontal 
            {
                background
            : url(images/scrollbar-horizontal-bg.png);
                height
            : 9px;
                margin
            : 0px 0 0px 0;
            }
            QScrollBar::handle:horizontal 
            {
                background
            : rgb(195, 195, 195);
                min-width
            : 20px;
                margin
            : 2px 0px 1px 0px;
                border-radius
            : 3px;
                border
            : none;
            }
            QScrollBar::add-line:horizontal 
            {
                border
            : 0px solid grey;
                background
            : #32CC99;
                width
            : 0px;
                subcontrol-position
            : right;
                subcontrol-origin
            : margin;
            }

            QScrollBar::sub-line:horizontal 
            {
                border
            : 0px solid grey;
                background
            : #32CC99;
                width
            : 0px;
                subcontrol-position
            : left;
                subcontrol-origin
            : margin;
            }

            QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal 
            {
                background
            : none;
            }

            QTableView {
                color
            : black;
                background
            : white;
                selection-background-color
            : qlineargradient(
                    x1: 0, y1: 0, x2: 0, y2: 1,
                    stop: 0 #FAFBFE, stop: 1 #DCDEF1)
            ;
            }

            QTableView::item:alternate 
            {
                 background
            : red;
             
            }

            QTableView::item:selected 
            { /*被選中的index*/
                color
            : black;
                background
            : qlineargradient(
                    x1: 0, y1: 0, x2: 0, y2: 1,
                    stop: 0 #FAFBFE, 
                    stop: 1 #DCDEF1)
            ;
                
            }

            QHeaderView 
            {
                background
            : white;
            }

            QHeaderView::section, QTableCornerButton::section 
            {
                padding
            : 1px;
                border
            : none;
                border-bottom
            : 1px solid rgb(160, 160, 160);
                border-right
            : 1px solid rgb(160, 160, 160);
                border-bottom
            : 1px solid gray;
                background-color
            : qlineargradient(spread:reflect, 
                    x1:0, y1:0, x2:0, y2:1, 
                    stop:0 rgba(255, 255, 255, 255), 
                    stop:1 rgba(164, 164, 164, 255))
            ;
            }

            QHeaderView::section:vertical 
            {
                background
            : url(:/resources/images/bg.jpg);
            }

            /***************************************************************************
             * QFrame 相關(guān)
             *************************************************************************
            */
            .QFrame, .QTableView, .QListWidget 
            {
                border
            : 1px solid  rgb(182, 182, 182);
                border-top
            : 1px solid rgb(142, 142, 142);
            }
            posted on 2011-10-25 20:01 逛奔的蝸牛 閱讀(6213) 評論(3)  編輯 收藏 引用 所屬分類: Qt

            評論

            # re: Qt:header view與scrollbar的style sheet 2011-11-10 16:28 風(fēng)聲邊界
            樓主你貼圖界面左側(cè)的工具欄用啥實(shí)現(xiàn)的listWidget?
            效果不錯(cuò),有機(jī)會借鑒一下啊  回復(fù)  更多評論
              

            # re: Qt:header view與scrollbar的style sheet[未登錄] 2013-10-29 15:28 小米
            相當(dāng)不錯(cuò),學(xué)習(xí)了很多。。請問樓主還有沒有相關(guān)的這樣的文件?  回復(fù)  更多評論
              

            # re: Qt:header view與scrollbar的style sheet 2014-03-19 10:50 welliam
            QHeaderView::section:checked {
            background:red;
            }
            這個(gè)請問你們設(shè)置有效果嗎  回復(fù)  更多評論
              

            久久精品国产影库免费看| 国产亚州精品女人久久久久久| 91精品国产高清久久久久久91 | 93精91精品国产综合久久香蕉| 99精品久久久久中文字幕| 97精品伊人久久久大香线蕉| 国产精品欧美久久久久天天影视 | 久久久久久国产精品无码超碰| 国产成年无码久久久久毛片| 久久线看观看精品香蕉国产| 久久精品18| 国产成人久久精品一区二区三区 | 久久综合精品国产二区无码| 久久精品免费观看| 一97日本道伊人久久综合影院| 国产欧美久久一区二区| 亚洲综合久久夜AV | 亚洲国产二区三区久久| 久久久久久久综合狠狠综合| 日本福利片国产午夜久久| 精品国产乱码久久久久久呢| 狠狠色噜噜狠狠狠狠狠色综合久久| 久久久久这里只有精品| 久久精品国产第一区二区三区| 久久综合精品国产一区二区三区| 久久精品人人做人人爽电影蜜月 | 国产精品久久久久…| 天堂无码久久综合东京热| 国产成人久久精品一区二区三区| 久久精品免费全国观看国产| 99久久亚洲综合精品成人| 日本人妻丰满熟妇久久久久久| 99久久香蕉国产线看观香| 狠狠人妻久久久久久综合蜜桃| 俺来也俺去啦久久综合网| 中文字幕日本人妻久久久免费| 久久精品一区二区影院 | 99久久久精品免费观看国产 | 久久精品成人免费观看97| 九九99精品久久久久久| 久久久久亚洲精品无码蜜桃 |