def __init__(self, name=None, view=None, parent=None, designMode=False): if name is None: name = "Base toolbar" self._viewWidget = view or parent QtGui.QToolBar.__init__(self, name, parent) self.setIconSize(QtCore.QSize(16, 16)) self.setFloatable(False) self.setMovable(False)
def setTitleHeight(self, height): """Sets this widget's title height :param height: the new widget title height :type height: int""" s = QtCore.QSize(height, height) self.titleButton().setIconSize(s) self.collapseButton().setIconSize(s)
def headerData(self, section, orientation, role=QtCore.Qt.DisplayRole): ret = None if orientation == QtCore.Qt.Horizontal: if role == QtCore.Qt.TextAlignmentRole: ret = int(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter) elif role == QtCore.Qt.DisplayRole: ret = self.ColumnNames[section] elif role == QtCore.Qt.SizeHintRole: ret = QtCore.QSize(self.columnSize(section)) ret.setHeight(24) elif role == QtCore.Qt.ToolTipRole: ret = self.columnToolTip(section) elif role == QtCore.Qt.DecorationRole: ret = self.columnIcon(section) return ret
def roleSize(self, taurus_role): return QtCore.QSize(300, 70)
def minimumSizeHint(self): """Overwrite the default minimum size hint (0,0) to be (8, 8) :return: the minimum size hint 8, 8 :rtype: QSize""" return QtCore.QSize(8, 8)
def sizeHint(self): return QtCore.QSize(800, 600)
def minimumSizeHint(self): h = get_minimum_height_hint() return QtCore.QSize(h, h)
def sizeHint(self): h = get_height_hint() return QtCore.QSize(h, h)
def __init__(self, axis, icon=None, parent=None): super(IconButton, self).__init__(parent) self.axis = axis if icon is not None: self.setIcon(icon) self.setIconSize(QtCore.QSize(16, 16))
def minimumSizeHint(self): size = super(StepSize, self).minimumSizeHint() size = QtCore.QSize(size.width(), get_minimum_height_hint()) return size