示例#1
0
    def __init__(self, pixmap, title="", parent=None):
        QGraphicsWidget.__init__(self, parent)

        self._title = None
        self._size = QSizeF()

        layout = QGraphicsLinearLayout(Qt.Vertical, self)
        layout.setSpacing(2)
        layout.setContentsMargins(5, 5, 5, 5)
        self.setContentsMargins(0, 0, 0, 0)

        self.pixmapWidget = GraphicsPixmapWidget(pixmap, self)
        self.labelWidget = GraphicsTextWidget(title, self)

        layout.addItem(self.pixmapWidget)
        layout.addItem(self.labelWidget)

        layout.setAlignment(self.pixmapWidget, Qt.AlignCenter)
        layout.setAlignment(self.labelWidget, Qt.AlignHCenter | Qt.AlignBottom)
        self.setLayout(layout)

        self.setSizePolicy(QSizePolicy.MinimumExpanding,
                           QSizePolicy.MinimumExpanding)

        self.setFlag(QGraphicsItem.ItemIsSelectable, True)
        self.setTitle(title)
        self.setTitleWidth(100)
示例#2
0
    def __init__(self, pixmap, title="", parent=None):
        QGraphicsWidget.__init__(self, parent)

        self._title = None
        self._size = QSizeF()

        layout = QGraphicsLinearLayout(Qt.Vertical, self)
        layout.setSpacing(2)
        layout.setContentsMargins(5, 5, 5, 5)
        self.setContentsMargins(0, 0, 0, 0)

        self.pixmapWidget = GraphicsPixmapWidget(pixmap, self)
        self.labelWidget = GraphicsTextWidget(title, self)

        layout.addItem(self.pixmapWidget)
        layout.addItem(self.labelWidget)

        layout.setAlignment(self.pixmapWidget, Qt.AlignCenter)
        layout.setAlignment(self.labelWidget, Qt.AlignHCenter | Qt.AlignBottom)
        self.setLayout(layout)

        self.setSizePolicy(QSizePolicy.MinimumExpanding,
                           QSizePolicy.MinimumExpanding)

        self.setFlag(QGraphicsItem.ItemIsSelectable, True)
        self.setTitle(title)
        self.setTitleWidth(100)
示例#3
0
 def __init__(self, pixmap, parent=None):
     QGraphicsWidget.__init__(self, parent)
     self.setCacheMode(QGraphicsItem.ItemCoordinateCache)
     self._pixmap = pixmap
     self._pixmapSize = QSizeF()
     self._keepAspect = True
     self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
示例#4
0
    def __init__(self, text, parent=None):
        QGraphicsWidget.__init__(self, parent)
        self.labelItem = QGraphicsTextItem(self)
        self.setHtml(text)

        self.labelItem.document().documentLayout().documentSizeChanged.connect(
            self.onLayoutChanged)
示例#5
0
    def __init__(self, text, parent=None):
        QGraphicsWidget.__init__(self, parent)
        self.labelItem = QGraphicsTextItem(self)
        self.setHtml(text)

        self.labelItem.document().documentLayout().documentSizeChanged.connect(
            self.onLayoutChanged
        )
示例#6
0
 def __init__(self, parent=None):
     QGraphicsWidget.__init__(self, parent)
     self.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Maximum)
     self.setContentsMargins(10, 10, 10, 10)
     layout = QGraphicsGridLayout()
     layout.setContentsMargins(0, 0, 0, 0)
     layout.setSpacing(10)
     self.setLayout(layout)
示例#7
0
 def __init__(self, parent=None):
     QGraphicsWidget.__init__(self, parent)
     self.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Maximum)
     self.setContentsMargins(10, 10, 10, 10)
     layout = QGraphicsGridLayout()
     layout.setContentsMargins(0, 0, 0, 0)
     layout.setSpacing(10)
     self.setLayout(layout)
示例#8
0
    def __init__(self,parent):
        QGraphicsWidget.__init__(self)
        self.applet = parent
        self.pa = None
        self.last_resize_running = datetime.datetime.now()
        self.last_resize_running_timer_running = False
        self.card_infos = {}
        self.ladspa_index = 1

        self.setFocusPolicy(Qt.TabFocus)
示例#9
0
 def __init__(self, labels=[], orientation=Qt.Vertical, alignment=Qt.AlignCenter, parent=None):
     QGraphicsWidget.__init__(self, parent)
     layout = QGraphicsLinearLayout(orientation)
     layout.setContentsMargins(0, 0, 0, 0)
     layout.setSpacing(0)
     self.setLayout(layout)
     self.orientation = orientation
     self.alignment = alignment
     self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
     self.label_items = []
     self.set_labels(labels)
示例#10
0
 def __init__(self, labels=[], orientation=Qt.Vertical, parent=None):
     QGraphicsWidget.__init__(self, parent)
     layout = QGraphicsLinearLayout(orientation)
     layout.setContentsMargins(0, 0, 0, 0)
     layout.setSpacing(0)
     self.setLayout(layout)
     self.orientation = orientation
     self.alignment = Qt.AlignCenter
     self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
     self.label_items = []
     self.set_labels(labels)
    def __init__(self, parent=None, root=None, orientation=Left):
        QGraphicsWidget.__init__(self, parent)
        self.orientation = orientation
        self._root = None
        self._highlighted_item = None
        #: a list of selected items
        self._selection = OrderedDict()
        #: a {node: item} mapping
        self._items = {}
        #: container for all cluster items.
        self._itemgroup = QGraphicsWidget(self)
        self._itemgroup.setGeometry(self.contentsRect())
        self._cluster_parent = {}

        self.setContentsMargins(5, 5, 5, 5)
        self.set_root(root)
    def __init__(self, show_unit_value = False, unit_symbol="%"):
        QGraphicsWidget.__init__(self)
        self.meter = None
        self.setSizePolicy(QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed,True))

        self.slider = LabelSlider(show_unit_value, unit_symbol)
        self.slider.setParent(self)
        self.slider.volumeChanged.connect(self.on_volume_changed)

        self.layout = QGraphicsLinearLayout(Qt.Vertical)
        self.layout.setContentsMargins(2,2,2,0)

        self.setLayout(self.layout)
        self.layout.addItem(self.slider)

        self.connect(self, SIGNAL("geometryChanged()"), self._resize_widgets)
示例#13
0
    def __init__(self, parent=None, root=None, orientation=Left):
        QGraphicsWidget.__init__(self, parent)
        self.orientation = orientation
        self._root = None
        self._highlighted_item = None
        #: a list of selected items
        self._selection = OrderedDict()
        #: a {node: item} mapping
        self._items = {}
        #: container for all cluster items.
        self._itemgroup = QGraphicsWidget(self)
        self._itemgroup.setGeometry(self.contentsRect())
        self._cluster_parent = {}

        self.setContentsMargins(5, 5, 5, 5)
        self.set_root(root)
示例#14
0
    def __init__(self,
                 parent=None,
                 direction=Qt.LeftToRight,
                 node=None,
                 icon=None,
                 iconSize=None,
                 **args):
        QGraphicsWidget.__init__(self, parent, **args)
        self.setAcceptedMouseButtons(Qt.NoButton)
        self.__direction = direction

        self.setLayout(QGraphicsLinearLayout(Qt.Horizontal))

        # Set the maximum size, otherwise the layout can't grow beyond its
        # sizeHint (and we need it to grow so the widget can grow and keep the
        # contents centered vertically.
        self.layout().setMaximumSize(QSizeF(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX))

        self.setSizePolicy(QSizePolicy.MinimumExpanding,
                           QSizePolicy.MinimumExpanding)

        self.__iconSize = iconSize or QSize(64, 64)
        self.__icon = icon

        self.__iconItem = QGraphicsPixmapItem(self)
        self.__iconLayoutItem = GraphicsItemLayoutItem(item=self.__iconItem)

        self.__channelLayout = QGraphicsGridLayout()
        self.__channelAnchors = []

        if self.__direction == Qt.LeftToRight:
            self.layout().addItem(self.__iconLayoutItem)
            self.layout().addItem(self.__channelLayout)
            channel_alignemnt = Qt.AlignRight

        else:
            self.layout().addItem(self.__channelLayout)
            self.layout().addItem(self.__iconLayoutItem)
            channel_alignemnt = Qt.AlignLeft

        self.layout().setAlignment(self.__iconLayoutItem, Qt.AlignCenter)
        self.layout().setAlignment(self.__channelLayout,
                                   Qt.AlignVCenter | channel_alignemnt)

        if node is not None:
            self.setSchemeNode(node)
示例#15
0
    def __init__(self, parent=None, direction=Qt.LeftToRight,
                 node=None, icon=None, iconSize=None, **args):
        QGraphicsWidget.__init__(self, parent, **args)
        self.setAcceptedMouseButtons(Qt.NoButton)
        self.__direction = direction

        self.setLayout(QGraphicsLinearLayout(Qt.Horizontal))

        # Set the maximum size, otherwise the layout can't grow beyond its
        # sizeHint (and we need it to grow so the widget can grow and keep the
        # contents centered vertically.
        self.layout().setMaximumSize(QSizeF(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX))

        self.setSizePolicy(QSizePolicy.MinimumExpanding,
                           QSizePolicy.MinimumExpanding)

        self.__iconSize = iconSize or QSize(64, 64)
        self.__icon = icon

        self.__iconItem = QGraphicsPixmapItem(self)
        self.__iconLayoutItem = GraphicsItemLayoutItem(item=self.__iconItem)

        self.__channelLayout = QGraphicsGridLayout()
        self.__channelAnchors = []

        if self.__direction == Qt.LeftToRight:
            self.layout().addItem(self.__iconLayoutItem)
            self.layout().addItem(self.__channelLayout)
            channel_alignemnt = Qt.AlignRight

        else:
            self.layout().addItem(self.__channelLayout)
            self.layout().addItem(self.__iconLayoutItem)
            channel_alignemnt = Qt.AlignLeft

        self.layout().setAlignment(self.__iconLayoutItem, Qt.AlignCenter)
        self.layout().setAlignment(self.__channelLayout,
                                   Qt.AlignVCenter | channel_alignemnt)

        if node is not None:
            self.setSchemeNode(node)
示例#16
0
    def __init__(self , parent):
        QGraphicsWidget.__init__(self)
        self.veromix = parent
        self.index = -1
        self.pa = parent.getPulseAudio()
        self.set_name("")
        self.deleted = True
        self.pa_sink = None
        self.extended_panel_shown = False
        self.extended_panel= None
        self.show_meter = True
        self.expander = None
        self.popup_menu = None
        self.card_settings = None
        self.menus = None
        self.port_actions = None

        self.double_click_filter = ChannelEventFilter(self)
        self.installEventFilter(self.double_click_filter)

        self.init()
        self.setSizePolicy(QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed,True))
示例#17
0
    def __init__(self, *args, **kwargs):
        QGraphicsWidget.__init__(self, *args, **kwargs)
        self.setAcceptedMouseButtons(Qt.LeftButton | Qt.RightButton)

        self.source = None
        self.sink = None

        # QGraphicsWidget/Items in the scene.
        self.sourceNodeWidget = None
        self.sourceNodeTitle = None
        self.sinkNodeWidget = None
        self.sinkNodeTitle = None

        self.__links = []

        self.__textItems = []
        self.__iconItems = []
        self.__tmpLine = None
        self.__dragStartItem = None

        self.setLayout(QGraphicsLinearLayout(Qt.Vertical))
        self.layout().setContentsMargins(0, 0, 0, 0)
示例#18
0
    def __init__(self, *args, **kwargs):
        QGraphicsWidget.__init__(self, *args, **kwargs)
        self.setAcceptedMouseButtons(Qt.LeftButton | Qt.RightButton)

        self.source = None
        self.sink = None

        # QGraphicsWidget/Items in the scene.
        self.sourceNodeWidget = None
        self.sourceNodeTitle = None
        self.sinkNodeWidget = None
        self.sinkNodeTitle = None

        self.__links = []

        self.__textItems = []
        self.__iconItems = []
        self.__tmpLine = None
        self.__dragStartItem = None

        self.setLayout(QGraphicsLinearLayout(Qt.Vertical))
        self.layout().setContentsMargins(0, 0, 0, 0)
示例#19
0
 def __init__(self, parent=None, rug=None):
     QGraphicsWidget.__init__(self, parent)
     self.rug_items = []
     self.set_rug(rug)
     self.setMaximumHeight(30)
     self.setMinimumHeight(30)
示例#20
0
 def __init__(self, parent):
     """Init class."""
     QGraphicsWidget.__init__(self)
     self.applet = parent
示例#21
0
 def __init__(self, pixmap, parent=None):
     QGraphicsWidget.__init__(self, parent)
     self.setCacheMode(QGraphicsItem.ItemCoordinateCache)
     self._pixmap = pixmap
     self._pixmapSize = QSizeF()
     self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
示例#22
0
 def __init__(self, parent=None, rug=None):
     QGraphicsWidget.__init__(self, parent)
     self.rug_items = []
     self.set_rug(rug)
     self.setMaximumHeight(30)
     self.setMinimumHeight(30)
示例#23
0
 def __init__(self, parent=None, **kwargs):
     QGraphicsWidget.__init__(self, parent, **kwargs)
示例#24
0
 def __init__(self, parent=None, **kwargs):
     QGraphicsWidget.__init__(self, parent, **kwargs)
 def __init__(self,parent):
     QGraphicsWidget.__init__(self)
     self.applet = parent