• <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://m.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://m.shnenglu.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);


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

            具體的style sheet代碼,這里面的CSS代碼還可以寫得更優雅一些,反正是起作用了,沒太大興趣再去繼續弄
            /*
             垂直滾動條
            */
            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 相關
             *************************************************************************
            */
            .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 逛奔的蝸牛 閱讀(6225) 評論(3)  編輯 收藏 引用 所屬分類: Qt

            評論

            # re: Qt:header view與scrollbar的style sheet 2011-11-10 16:28 風聲邊界
            樓主你貼圖界面左側的工具欄用啥實現的listWidget?
            效果不錯,有機會借鑒一下啊  回復  更多評論
              

            # re: Qt:header view與scrollbar的style sheet[未登錄] 2013-10-29 15:28 小米
            相當不錯,學習了很多。。請問樓主還有沒有相關的這樣的文件?  回復  更多評論
              

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

            久久不射电影网| 精品熟女少妇av免费久久| 色综合久久久久综合体桃花网| 亚洲精品午夜国产VA久久成人| 少妇内射兰兰久久| 国产精品免费久久| 激情伊人五月天久久综合| 久久久久免费精品国产| 久久香蕉国产线看观看精品yw| 一本一本久久a久久精品综合麻豆| 欧美亚洲国产精品久久蜜芽| 久久精品无码一区二区三区| 无码人妻久久一区二区三区蜜桃| 国产91色综合久久免费分享| 久久综合亚洲鲁鲁五月天| 思思久久99热免费精品6| 人妻少妇久久中文字幕一区二区| 国产精品99久久精品爆乳| 亚洲AV乱码久久精品蜜桃| 久久福利片| 亚洲综合久久夜AV | 色综合色天天久久婷婷基地 | 亚洲AV日韩精品久久久久久久| 亚洲综合婷婷久久| 久久久久国产精品| 97精品国产97久久久久久免费| 久久精品免费一区二区| 一本色道久久88精品综合 | 99久久国产亚洲高清观看2024| 亚洲精品乱码久久久久久按摩 | 欧洲成人午夜精品无码区久久| 看全色黄大色大片免费久久久| 久久精品国产亚洲Aⅴ蜜臀色欲| 国内精品久久久久久中文字幕| 国产三级久久久精品麻豆三级 | 久久―日本道色综合久久| 少妇内射兰兰久久| 久久婷婷五月综合97色一本一本| 无夜精品久久久久久| 久久久久久精品免费看SSS| 欧美国产成人久久精品|