示例#1
0
 def __init__(self, parent=None):
     self.__dragLogicalIdx = None
     super(TopHeaderView, self).__init__(QtCore.Qt.Horizontal, parent)
     self.__dragTimer = QtCore.QTimer()
     self.__dragTimer.setSingleShot(True)
     # use a slightly smaller font than the default and decrease margins
     self.setStyleSheet(
         "QHeaderView::section { margin: 4px 1px 4px 1px; } QHeaderView { font: 9pt; } "
     )
     # self.sectionClicked.connect( self._columnClicked )
     self.setMovable(True)
示例#2
0
 def __init__(self, parent=None):
     """
     """
     QtGui.QTreeView.__init__(self, parent)
     AbstractView.__init__(self)
     self.addMenuHandler(TreeMenuHandler(self, parent=self))
     self.addMenuHandler(StandardMenuHandler(self, parent=self))
     # use custom delegate
     self.setItemDelegate(TreeDelegate(self))
     # properties
     self.__refreshOnNextCtrlRelease = False
     self.__showGrid = False
     # timer for auto-expanding branches on drag/drop
     self.__openTimer = QtCore.QTimer(self)
     self.__openTimer.timeout.connect(self.__doAutoExpand)
     # set default values for properties
     self.setAutoExpandDelay(self.AUTO_EXPAND_DELAY)
     # persistent expansion state using model's uniqueId
     self.__expandOnLoad = 0
     self.__expandAllIsExpanded = False
     # cache of the number of things in model, -1 means we haven't
     # set this yet, see setModel
     self.modelrows = -1