maya

Cannot set header data with QTableView / custom table model

时间秒杀一切 提交于 2021-01-07 01:01:54
问题 I am on Maya / PySide2 / Python 2.7 I cannot set the header data with a custom table model. I tried this: from PySide2 import QtCore, QtGui, QtWidgets from PySide2.QtCore import Qt class TableModel(QtCore.QAbstractTableModel): def __init__(self, data): super(TableModel, self).__init__() self.setHeaderData(0, Qt.Horizontal, "Driver") self.setHeaderData(1, Qt.Horizontal, "Range") self.setHeaderData(2, Qt.Horizontal, "Driven") self.setHeaderData(3, Qt.Horizontal, "Range") self._data = data def

Cannot set header data with QTableView / custom table model

|▌冷眼眸甩不掉的悲伤 提交于 2021-01-07 00:58:25
问题 I am on Maya / PySide2 / Python 2.7 I cannot set the header data with a custom table model. I tried this: from PySide2 import QtCore, QtGui, QtWidgets from PySide2.QtCore import Qt class TableModel(QtCore.QAbstractTableModel): def __init__(self, data): super(TableModel, self).__init__() self.setHeaderData(0, Qt.Horizontal, "Driver") self.setHeaderData(1, Qt.Horizontal, "Range") self.setHeaderData(2, Qt.Horizontal, "Driven") self.setHeaderData(3, Qt.Horizontal, "Range") self._data = data def

Set highlighted range in Maya's Time Slider

眉间皱痕 提交于 2021-01-01 07:28:59
问题 It is easy to get the highligted range in the time slider using: import maya.cmds as cmds import maya.mel as mel aTimeSlider = mel.eval('$tmpVar=$gPlayBackSlider') timeRange = cmds.timeControl(aTimeSlider, q=True, rangeArray=True) Likewise the Qt widget can be accessed with from maya import mel from maya import OpenMayaUI as omui try: from PySide2.QtCore import * from PySide2.QtGui import * from PySide2.QtWidgets import * from PySide2 import __version__ from shiboken2 import wrapInstance