def setupUi(self, re_manager): re_manager.setObjectName("re_manager") re_manager.resize(702, 722) self.centralwidget = QtWidgets.QWidget(re_manager) self.centralwidget.setEnabled(True) self.centralwidget.setObjectName("centralwidget") self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.centralwidget) self.verticalLayout_2.setObjectName("verticalLayout_2") self.animsTreeView = QtWidgets.QTreeView(self.centralwidget) self.animsTreeView.setObjectName("animsTreeView") self.verticalLayout_2.addWidget(self.animsTreeView) self.animLoadSelectedBtn = QtWidgets.QPushButton(self.centralwidget) self.animLoadSelectedBtn.setObjectName("animLoadSelectedBtn") self.verticalLayout_2.addWidget(self.animLoadSelectedBtn) self.timeEditorBtn = QtWidgets.QPushButton(self.centralwidget) self.timeEditorBtn.setObjectName("timeEditorBtn") self.verticalLayout_2.addWidget(self.timeEditorBtn) self.loadSequencerBtn = QtWidgets.QPushButton(self.centralwidget) self.loadSequencerBtn.setObjectName("loadSequencerBtn") self.verticalLayout_2.addWidget(self.loadSequencerBtn) self.groupBox = QtWidgets.QGroupBox(self.centralwidget) self.groupBox.setObjectName("groupBox") self.verticalLayout = QtWidgets.QVBoxLayout(self.groupBox) self.verticalLayout.setObjectName("verticalLayout") self.renameBonesBtn = QtWidgets.QPushButton(self.groupBox) self.renameBonesBtn.setObjectName("renameBonesBtn") self.verticalLayout.addWidget(self.renameBonesBtn) self.injectAnimBtn = QtWidgets.QPushButton(self.groupBox) self.injectAnimBtn.setObjectName("injectAnimBtn") self.verticalLayout.addWidget(self.injectAnimBtn) self.verticalLayout_2.addWidget(self.groupBox) re_manager.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(re_manager) self.menubar.setGeometry(QtCore.QRect(0, 0, 702, 21)) self.menubar.setObjectName("menubar") self.menuFile = QtWidgets.QMenu(self.menubar) self.menuFile.setObjectName("menuFile") self.menuRecent_Files = QtWidgets.QMenu(self.menuFile) self.menuRecent_Files.setObjectName("menuRecent_Files") self.menuAbout = QtWidgets.QMenu(self.menubar) self.menuAbout.setObjectName("menuAbout") re_manager.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(re_manager) self.statusbar.setObjectName("statusbar") re_manager.setStatusBar(self.statusbar) self.actionImport_motlist = QtWidgets.QAction(re_manager) self.actionImport_motlist.setCheckable(False) self.actionImport_motlist.setObjectName("actionImport_motlist") self.actionAbout = QtWidgets.QAction(re_manager) self.actionAbout.setObjectName("actionAbout") self.menuFile.addAction(self.actionImport_motlist) self.menuFile.addAction(self.menuRecent_Files.menuAction()) self.menuAbout.addAction(self.actionAbout) self.menubar.addAction(self.menuFile.menuAction()) self.menubar.addAction(self.menuAbout.menuAction()) self.retranslateUi(re_manager) QtCore.QMetaObject.connectSlotsByName(re_manager)
def expandCollapseRect(self): return QtCore.QRect(0, 0, self.width(), 20)
def dragDropRect(self): return QtCore.QRect(25, 7, 10, 6)
def showMenu(self): if QtCore.QRect(0, 0, self.width(), 20).contains(self.mapFromGlobal(QtGui.QCursor.pos())): self._accordianWidget.emitItemMenuRequested(self)
def paintEvent(self, event): painter = QtGui.QPainter() painter.begin(self) painter.setRenderHint(painter.Antialiasing) font = painter.font() font.setBold(True) painter.setFont(font) x = self.rect().x() y = self.rect().y() w = self.rect().width() - 1 h = self.rect().height() - 1 r = 8 # draw a rounded style if self._rolloutStyle == 2: # draw the text painter.drawText(x + 33, y + 3, w, 16, QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop, self.title()) # draw the triangle self.__drawTriangle(painter, x, y) # draw the borders pen = QtGui.QPen(self.palette().color(QtGui.QPalette.Light)) pen.setWidthF(0.6) painter.setPen(pen) painter.drawRoundedRect(x + 1, y + 1, w - 1, h - 1, r, r) pen.setColor(self.palette().color(QtGui.QPalette.Shadow)) painter.setPen(pen) painter.drawRoundedRect(x, y, w - 1, h - 1, r, r) # draw a square style if self._rolloutStyle == 3: # draw the text painter.drawText(x + 33, y + 3, w, 16, QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop, self.title()) self.__drawTriangle(painter, x, y) # draw the borders pen = QtGui.QPen(self.palette().color(QtGui.QPalette.Light)) pen.setWidthF(0.6) painter.setPen(pen) painter.drawRect(x + 1, y + 1, w - 1, h - 1) pen.setColor(self.palette().color(QtGui.QPalette.Shadow)) painter.setPen(pen) painter.drawRect(x, y, w - 1, h - 1) # draw a Maya style if self._rolloutStyle == 4: # draw the text painter.drawText(x + 33, y + 3, w, 16, QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop, self.title()) painter.setRenderHint(QtGui.QPainter.Antialiasing, False) self.__drawTriangle(painter, x, y) # draw the borders - top headerHeight = 20 headerRect = QtCore.QRect(x + 1, y + 1, w - 1, headerHeight) headerRectShadow = QtCore.QRect(x - 1, y - 1, w + 1, headerHeight + 2) # Highlight pen = QtGui.QPen(self.palette().color(QtGui.QPalette.Light)) pen.setWidthF(0.4) painter.setPen(pen) painter.drawRect(headerRect) painter.fillRect(headerRect, QtGui.QColor(255, 255, 255, 18)) # Shadow pen.setColor(self.palette().color(QtGui.QPalette.Dark)) painter.setPen(pen) painter.drawRect(headerRectShadow) if not self.isCollapsed(): # draw the lover border pen = QtGui.QPen(self.palette().color(QtGui.QPalette.Dark)) pen.setWidthF(0.8) painter.setPen(pen) offSet = headerHeight + 3 bodyRect = QtCore.QRect(x, y + offSet, w, h - offSet) bodyRectShadow = QtCore.QRect(x + 1, y + offSet, w + 1, h - offSet + 1) painter.drawRect(bodyRect) pen.setColor(self.palette().color(QtGui.QPalette.Light)) pen.setWidthF(0.4) painter.setPen(pen) painter.drawRect(bodyRectShadow) # draw a boxed style elif self._rolloutStyle == 1: if self.isCollapsed(): arect = QtCore.QRect(x + 1, y + 9, w - 1, 4) brect = QtCore.QRect(x, y + 8, w - 1, 4) text = '+' else: arect = QtCore.QRect(x + 1, y + 9, w - 1, h - 9) brect = QtCore.QRect(x, y + 8, w - 1, h - 9) text = '-' # draw the borders pen = QtGui.QPen(self.palette().color(QtGui.QPalette.Light)) pen.setWidthF(0.6) painter.setPen(pen) painter.drawRect(arect) pen.setColor(self.palette().color(QtGui.QPalette.Shadow)) painter.setPen(pen) painter.drawRect(brect) painter.setRenderHint(painter.Antialiasing, False) painter.setBrush(self.palette().color( QtGui.QPalette.Window).darker(120)) painter.drawRect(x + 10, y + 1, w - 20, 16) painter.drawText(x + 16, y + 1, w - 32, 16, QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter, text) painter.drawText(x + 10, y + 1, w - 20, 16, QtCore.Qt.AlignCenter, self.title()) if self.dragDropMode(): rect = self.dragDropRect() # draw the lines l = rect.left() r = rect.right() cy = rect.center().y() for y in (cy - 3, cy, cy + 3): painter.drawLine(l, y, r, y) painter.end()