我想消除TextureIConChartQlistWidget中QListWidget项之间的间隙。它由设置了pixmap图标的项目填充。我正在使用QListWidget设置为QHBoxLayout,它设置为QVBoxLayout。你知道吗
import maya.cmds as cmds
import os
import maya.OpenMayaUI as mui
from PySide2 import QtWidgets,QtCore,QtGui
import shiboken2
class texture_replacer():
def texture_linker_UI(self):
windowName = "name"
if cmds.window(windowName,exists = True):
cmds.deleteUI(windowName, wnd = True)
pointer = mui.MQtUtil.mainWindow()
parent = shiboken2.wrapInstance(long(pointer),QtWidgets.QWidget)
window = QtWidgets.QMainWindow(parent)
window.setObjectName(windowName)
window.setWindowTitle(windowName)
window.setMinimumSize(450,650)
window.setMaximumSize(600,400)
mainWidget = QtWidgets.QWidget()
window.setCentralWidget(mainWidget)
verticalLayout = QtWidgets.QVBoxLayout(mainWidget)
self.textureIconChartLayout = QtWidgets.QVBoxLayout()
textureIconsLayout = QtWidgets.QHBoxLayout()
self.textureIconChartLayout.addLayout(textureIconsLayout)
verticalLayout.addLayout(self.textureIconChartLayout)
self.textureIconChart = QtWidgets.QListWidget()
self.textureIconChart.setViewMode(QtWidgets.QListWidget.IconMode)
self.textureIconChart.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
self.textureIconChart.setDragEnabled(0)
self.textureIconChart.setMaximumWidth(290)
self.populateListWidget()
textureIconsLayout.addWidget(self.textureIconChart)
textureIconsLayout.setSpacing(0)
textureIconsLayout.setContentsMargins(0,0,0,0)
tr = texture_replacer()
tr.texture_linker_UI()
目前没有回答
相关问题 更多 >
编程相关推荐