• <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 逛奔的蝸牛 閱讀(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人片不卡无码久久| 久久男人Av资源网站无码软件| 精品人妻伦九区久久AAA片69| 久久强奷乱码老熟女网站| 免费精品99久久国产综合精品| 亚洲国产成人久久综合碰| 久久天天躁狠狠躁夜夜躁2O2O| 一本久久a久久精品综合香蕉 | 久久久国产精品亚洲一区| 亚洲综合伊人久久综合| 久久有码中文字幕| 久久久久亚洲精品中文字幕| 久久精品国产只有精品2020| 99久久婷婷国产综合亚洲| 久久综合给合久久国产免费 | 97精品国产97久久久久久免费| 亚洲国产精品无码久久SM| 久久久久亚洲av成人网人人软件| 国产69精品久久久久观看软件| 青青青青久久精品国产h久久精品五福影院1421 | 久久线看观看精品香蕉国产| 久久99精品国产99久久6男男| 国产精品gz久久久| 久久综合九色综合网站| 99久久免费国产特黄| 久久精品免费大片国产大片| 女同久久| 久久电影网| 久久国产精品国语对白| 久久精品人人做人人爽电影蜜月 | 日韩精品久久无码中文字幕| 久久精品国产亚洲一区二区| 久久本道久久综合伊人| av午夜福利一片免费看久久| 久久人做人爽一区二区三区 | 久久AV高清无码| 久久91精品国产91| 久久婷婷色香五月综合激情|