百度,谷歌之后都说用setHintSize(self,QCore.QSize(width,height)),然并卵,后来用qss修改就可以了,具体用法如下
# emaillist是我给QListWidget取得变量名,“#emaillist”后面加两个冒号表示选择器,即“#emaillist::Item”表示选择所有的itemself.emaillist.setStyleSheet(_fromUtf8("#emaillist{background-color: rgb(242,242,242);}\n"
"#emaillist::Item{\n"
"width:260px;\n"
"height:50px;\n"
"}\n"
"#emaillist::Item:hover{\n"
"background-color: rgb(41, 189, 139);\n"
"}"))