男女做那個網(wǎng)站動態(tài)圖片優(yōu)化設計七年級上冊語文答案
對QCombox在ui編輯器中進行美化,發(fā)現(xiàn)外表美化有效果,但下拉框的高度美化的沒效果,查看樣式表也沒有沒問題,樣式表中內容如下。
QComboBox#curve_comboBox {min-width: 150px;min-height:40;max-width: 150px;max-height:40;border:1px solid gray ; /*設置邊框*/border-radius: 3px ; /*設置圓角*/padding : 1px 2px 1px 2px ; /*針對于組合框中的文本內容*/font: 18px ;
}/*下面設置針對下拉框下拉標識(箭頭)*/
QComboBox::drop-down {subcontrol-origin: padding; /*針對標識圖標的位置設置*/subcontrol- position : top right ;width : 20px ;border-left-width : 1px ; /*針對標識圖標四周屬性*/border-left-color : darkgray;border-left-style : solid ; /* just a single line */border-top-right-radius: 3px ; /* same radius as the QComboBox */border-bottom-right-radius: 3px ;
}/*下面設置針對下拉框下拉標識圖片設置*/
QComboBox::down-arrow {width: 15px;image: url(:/res/image/arrow-drop.png);
}/* 下拉后,整個下拉窗體每項的樣式 */
QComboBox QAbstractItemView::item {
min-height: 40px;
max-height: 40px;
}/******** combobox 滾動條 *********/
QScrollBar:vertical {border: 0px solid grey;width: 40px;
}
/*滑塊樣式*/
QScrollBar::handle:vertical
{background:rgba(205,232,255);
}
解決辦法: 在cpp構造函數(shù)處:添加setview就可以了。
//樣式表中QCombox不起作用的,要設置如下ui->curv_comboBox->setView(new QListView());