• <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代碼還可以寫得更優雅一些,反正是起作用了,沒太大興趣再去繼續弄
            /*
             垂直滾動條
            */
            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 逛奔的蝸牛 閱讀(6233) 評論(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无码1区2区久久| 18岁日韩内射颜射午夜久久成人| 久久WWW免费人成—看片| 精品国产乱码久久久久久人妻| 亚洲精品无码久久久影院相关影片| www.久久热| 国产成人精品综合久久久久| 欧美777精品久久久久网| 国产精品久久久久久久久久影院| 久久精品国产亚洲麻豆| 亚洲日韩中文无码久久| 精品久久久久一区二区三区| 无码人妻少妇久久中文字幕蜜桃| 国产亚洲美女精品久久久| 亚洲国产另类久久久精品黑人| 精品久久久久久无码人妻蜜桃| 亚洲欧美成人综合久久久 | 精品久久久久中文字幕一区| 一本久久a久久精品vr综合| 久久久WWW免费人成精品| 国产午夜久久影院| 久久99亚洲网美利坚合众国| 久久人做人爽一区二区三区| 亚洲欧洲精品成人久久奇米网| 中文字幕亚洲综合久久| 久久精品无码一区二区无码| 一本一道久久综合狠狠老| 狠狠色丁香婷婷久久综合| 精品乱码久久久久久夜夜嗨| 久久91精品国产91久久户| 国产成人精品久久免费动漫| 久久青青草原精品国产| 久久久久亚洲AV无码永不| 人妻少妇久久中文字幕| 国产精品一区二区久久不卡| 国产精品久久久天天影视|