问题描述
- python简化代码,在线等!
-
def tab1(self,x):
#tab=QtGui.QTableWidgetItem()
#tab.setSelected(1)
for i in self.visi.sizeTab.colorbuck.selectedItems():
if i.row()==0:
s=QtGui.QImage(r'listimageab (1).jpg')
self._tools.label_16.setPixmap(QtGui.QPixmap.fromImage(s))
if i.column()==1:
s0=QtGui.QImage(r'listimagec.png')
self._tools.label_16.setPixmap(QtGui.QPixmap.fromImage(s0))
if i.row()==1:
s1=QtGui.QImage(r'listimageab (2).jpg')
self._tools.label_16.setPixmap(QtGui.QPixmap.fromImage(s1))
if i.column()==1 and i.row()==1:
s1=QtGui.QImage(r'listimageab (3).jpg')
self._tools.label_16.setPixmap(QtGui.QPixmap.fromImage(s1))
if i.row()==2:
s1=QtGui.QImage(r'listimageab (4).jpg')
self._tools.label_16.setPixmap(QtGui.QPixmap.fromImage(s1))
if i.column()==1 and i.row()==2:
s1=QtGui.QImage(r'listimageab (5).jpg')
self._tools.label_16.setPixmap(QtGui.QPixmap.fromImage(s1))
if i.row()==3:
s1=QtGui.QImage(r'listimageab (6).jpg')
self._tools.label_16.setPixmap(QtGui.QPixmap.fromImage(s1))
if i.column()==1 and i.row()==3:
s1=QtGui.QImage(r'listimageab (7).jpg')
self._tools.label_16.setPixmap(QtGui.QPixmap.fromImage(s1))
那位大神帮我简化下代码!
解决方案
你能不能把缩进写好呢?都看不清楚你的代码
时间: 2024-12-03 08:31:10