• <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;
            }
            這個請問你們設置有效果嗎  回復  更多評論
              

            囯产精品久久久久久久久蜜桃| 亚洲综合久久综合激情久久| 99久久www免费人成精品| 国内精品伊人久久久久av一坑 | 久久福利青草精品资源站| 99久久人妻无码精品系列蜜桃| 久久久久99精品成人片直播| 久久精品国产91久久麻豆自制| 久久久久久久尹人综合网亚洲| 久久精品免费网站网| 日本精品久久久久影院日本| 18岁日韩内射颜射午夜久久成人| 久久99久久99精品免视看动漫| 国产精品99久久不卡| 99久久香蕉国产线看观香| 无码AV中文字幕久久专区| 91精品无码久久久久久五月天| 色婷婷久久久SWAG精品| 热re99久久精品国99热| 国产免费久久久久久无码| 久久精品综合网| 青青青伊人色综合久久| 久久狠狠爱亚洲综合影院| 一本一道久久精品综合| 久久妇女高潮几次MBA| 91麻豆精品国产91久久久久久 | 亚洲中文字幕久久精品无码APP| 精品久久久久久久久午夜福利| 久久久久亚洲av成人无码电影| 色综合久久久久无码专区 | 久久噜噜久久久精品66| 国产精品无码久久久久久| 久久免费视频1| 精品熟女少妇aⅴ免费久久| 久久99国产精品久久99果冻传媒| 久久久无码精品亚洲日韩蜜臀浪潮 | 精品久久久久久无码专区不卡| 久久综合鬼色88久久精品综合自在自线噜噜| 久久精品国产亚洲av影院| 一本色综合网久久| 欧美日韩精品久久久免费观看|