Exemplo n.º 1
0
    def __init__(self, parent=None):
        QLabel.__init__(self, parent)
        self.headers = []
        self.position = 0
        self.viewWidth = 800
        self.viewHeight = 100
        self.hideFlag = False
        self.w = 180
        self.h = 40
        self.t = 10
        self.setMouseTracking(True)

        self.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        self.customContextMenuRequested.connect(self.createHeaderMenus)

        self.deleteAct = QAction('Hide', self)
        self.deleteAct.setStatusTip('Hide this life-line')
        self.deleteAct.triggered.connect(self.hideLifeLine)

        self.groupAct = QAction('Make a cluster', self)
        self.groupAct.setStatusTip('Make a cluster of multiple life-lines')
        self.groupAct.triggered.connect(self.showClusterDialog)

        self.scatterAct = QAction('Scatter', self)
        self.scatterAct.setStatusTip('Scatter this cluster')
        self.scatterAct.triggered.connect(self.scatterCluster)
Exemplo n.º 2
0
    def __init__(self, mainWindow):
        QLabel.__init__(self)

        self.mainWindow = mainWindow

        self.setMinimumWidth(400)
        self.setMinimumHeight(600)
Exemplo n.º 3
0
 def __init__(self, path, ops):
     QLabel.__init__(self)
     if path:
         pix = QPixmap(path)
         self.setPixmap(pix)#json_reader.buildPath(QPixmap(path).scaled(100, 100))
         self.path = path
         self.ops = ops
Exemplo n.º 4
0
    def __init__(self,parent = None):
        QLabel.__init__(self, parent)
        self.headers = []
        self.position = 0
        self.viewWidth = 800
        self.viewHeight = 100
        self.hideFlag = False
        self.w = 180
        self.h = 40
        self.t = 10
        self.setMouseTracking(True)

        self.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        self.customContextMenuRequested.connect(self.createHeaderMenus)

        self.deleteAct = QAction('Hide', self)
        self.deleteAct.setStatusTip('Hide this life-line')
        self.deleteAct.triggered.connect(self.hideLifeLine)

        self.groupAct = QAction('Make a cluster', self)
        self.groupAct.setStatusTip('Make a cluster of multiple life-lines')
        self.groupAct.triggered.connect(self.showClusterDialog)

        self.scatterAct = QAction('Scatter', self)
        self.scatterAct.setStatusTip('Scatter this cluster')
        self.scatterAct.triggered.connect(self.scatterCluster)
Exemplo n.º 5
0
 def __init__(self, text="", first=False):
     QLabel.__init__(self)
     self.setText(text)
     role = "widget_heading__first" if first else "widget_heading"
     self.setProperty("role", role)
     self.setMinimumHeight(24)
     self.setMaximumHeight(24)
Exemplo n.º 6
0
 def __init__(self, parent):
     QLabel.__init__(self, parent)
     self.setFixedWidth(500)
     self.setFixedHeight(24)
     self.setContentsMargins(5, 0, 5, 0)
     self.setStyleSheet('''
     InfoLabel { background-color : lightGrey;}
     ''')
Exemplo n.º 7
0
    def __init__(self, mainWindow):
        QLabel.__init__(self)

        self.mainWindow = mainWindow
        self.original = None
        self.currentMat = None

        self.setMinimumWidth(400)
        self.setMinimumHeight(300)
Exemplo n.º 8
0
 def __init__(self, *args, **kwargs):
     """Extend `QLabel.__init__` and call `setTextInteractionFlags`
     to allow text selection with the mouse
     """
     QLabel.__init__(self, *args, **kwargs)
     self.setTextFormat(Qt.RichText)
     self.setOpenExternalLinks(True)
     self.setTextInteractionFlags(Qt.LinksAccessibleByMouse
                                  | Qt.TextSelectableByMouse)
Exemplo n.º 9
0
 def __init__(self, parent=None):
     QLabel.__init__(self, parent)
     self.setStyleSheet(
         "QLabel { background-color : gray; color : white; }")
     align = self.alignment()
     self.setAlignment(align | Qt.AlignRight)
     font = QFont("Arial", 14, weight=QFont.Bold)
     self.setFont(font)
     h = self.height()
     self.setFixedSize(20, h)
Exemplo n.º 10
0
    def __init__(self, text, layout, clickable=False):
        """
        Custom labels for about box
        """
        QLabel.__init__(self, text)

        self.setOpenExternalLinks(clickable)
        self.setAlignment(Qt.AlignCenter)

        layout.addWidget(self)
        layout.setAlignment(self, Qt.AlignCenter)
Exemplo n.º 11
0
 def __init__(self, parentQExampleScrollArea, parentQWidget = None):
     QLabel.__init__(self, parentQWidget)
     self.parentQExampleScrollArea = parentQExampleScrollArea
     self.scale = 1.0
     self.position = (0, 0)
     self.pressed = None
     self.anchor = None
     self.drawer = CaptainServer.CaptainServer(self)
     self.drawer.initUI()
     
     self.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
     self.customContextMenuRequested.connect(self.drawer.createMenus) 
Exemplo n.º 12
0
    def __init__(self, parentQExampleScrollArea, parentQWidget=None):
        QLabel.__init__(self, parentQWidget)
        self.parentQExampleScrollArea = parentQExampleScrollArea
        self.scale = 1.0
        self.position = (0, 0)
        self.pressed = None
        self.anchor = None
        self.drawer = CaptainServer.CaptainServer(self)
        self.drawer.initUI()

        self.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        self.customContextMenuRequested.connect(self.drawer.createMenus)
Exemplo n.º 13
0
    def __init__(self, params):
        MWB.__init__(self, params)
        QLabel.__init__(self)

        self.img_filepath = ''
        self.resize(140, 15)

        self.setStyleSheet('''
            color: #bbbbbb;
            background: transparent;
            border: none;
        ''')
Exemplo n.º 14
0
    def __init__(self):
        """
        Information point that displays a tooltip when hovered
        """
        QLabel.__init__(self, "i")
        self.setFixedSize(QSize(20, 20))
        self.setAlignment(Qt.AlignCenter)

        self.setStyleSheet(
            "font-weight: bold; border: 1px solid transparent; border-radius: 10px; "
            "background-color: orange; color: black;")

        self.setToolTip(tr("shutdown_required"))
Exemplo n.º 15
0
    def __init__(self, width, layout: QVBoxLayout):
        """
        Separator for the config dialog
        """
        QLabel.__init__(self)

        self.setFixedHeight(3)
        self.setFixedWidth(int(width))
        self.setStyleSheet(get_stylesheet("separator"))

        # Layout
        self.setAlignment(Qt.AlignCenter)
        layout.addWidget(self, alignment=Qt.AlignCenter)
Exemplo n.º 16
0
    def __init__(self, text_key: str):
        """
        Information point that displays a tooltip when hovered

        :param text_key: tooltip text
        """
        QLabel.__init__(self, "i")
        self.setFixedSize(QSize(28, 28))
        self.setAlignment(Qt.AlignCenter)

        self.setStyleSheet("font-weight: bold; border: 1px solid transparent; border-radius: 14px; "
                           "background-color: lightblue; color: black;")

        self.setToolTip(tr(text_key))
Exemplo n.º 17
0
    def __init__(self, parent, x, y, name=None):
        QLabel.__init__(self, parent)
        self.pixX = x
        self.pixY = y

        self.name = name
        self.overwrite_name = True

        if self.name is None:
            self.setText("???")
        else:
            self.setText(self.name)

        self.setStyleSheet(self.SELECTED_SS)
        self.show()
Exemplo n.º 18
0
    def __init__(self, width, box: QVBoxLayout):
        """
        Separator for the about box
        """
        QLabel.__init__(self)

        self.setFixedHeight(3)
        self.setFixedWidth(int(width))
        self.setStyleSheet(get_stylesheet("separator"))

        # Layout
        self.setAlignment(Qt.AlignCenter)
        box.addSpacing(SPACING_SIZE)
        box.addWidget(self, alignment=Qt.AlignCenter)
        box.addSpacing(SPACING_SIZE)
Exemplo n.º 19
0
    def __init__(self, label, rectangle, zone, parent=None):
        """Initialization fo the ResultLabel.

        Args:
            label (str): Text to display on the label.
            rectangle (QGraphicsItem): The rectangle that is within the canvas.
            zone (Zone): The zone data.
            parent (QWidget): Parent widget.
        """
        QLabel.__init__(self, label, parent)
        self.setAlignment(Qt.AlignCenter)
        self.setCursor(Qt.PointingHandCursor)
        self.setMinimumHeight(20)
        self.rectangle = rectangle
        self.zone = zone
        self.hover_pen = QPen(QColor(120, 220, 120))
        self.base_pen = Qt.NoPen
Exemplo n.º 20
0
    def __init__(self, parent):
        QLabel.__init__(self, parent)

        self.statusBarWidget = parent

        self.setBackgroundRole(QPalette.Highlight)
        self.setForegroundRole(QPalette.WindowText)
        self.setText(" Formats ▾ ")

        # see api/ui/menus.h
        self.contextMenuManager = ContextMenuManager(self)

        self.menu = Menu()
        self.actionHandler = UIActionHandler()
        self.registerActions()
        self.addActions()
        self.bindActions()
Exemplo n.º 21
0
    def __init__(self, projector_setup="VisitechLRSWQ"):
        QLabel.__init__(self)
        base_path = Path(__file__).parent
        if projector_setup == 'VisitechLRSWQ':
            self.projector_instance = visitechDLP9000.VisitechDLP9000()
        elif projector_setup == 'VisitechLRS4KA':
            self.projector_instance = visitechLRS4KA.VisitechLRS4KA()
            if self.projector_instance is None:
                self.print_text_signal.emit(
                    "Visitech LRS4KA not supported: selected Visitech DLP9000")
                self.projector_instance = visitechDLP9000.VisitechDLP9000()
        else:
            print("Error: an invalid projector was selected!")
            sys.exit(1)

        self.connected = False
        self.projector_instance.print_text_signal.connect(
            self.print_to_console)
        self.projector_instance.connection_status_signal.connect(
            self.set_connection_status)
        self.calibration_pattern = str(
            (base_path / "../resources/projection_pattern.png").resolve())
        self.img = None
        self.horizontal_mirror = True
        self.vertical_mirror = False
        self.project_pattern_on = False
        self.setStyleSheet("QLabel { background-color : black}")
        self.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.show()
        self.desktops = QDesktopWidget()
        for d in range(self.desktops.screenCount()):
            print(self.desktops.screenGeometry(d))
        if self.desktops.screenCount() > 1:
            self.projector_width = self.desktops.screenGeometry(1).width()
            self.projector_height = self.desktops.screenGeometry(1).height()
            self.move(
                self.desktops.screenGeometry(1).center() -
                self.rect().center())
            self.showFullScreen()
        else:
            self.projector_width = 600
            self.projector_height = 600
            self.setFixedSize(self.projector_width, self.projector_height)
        self.threadpool = QThreadPool()
Exemplo n.º 22
0
    def __init__(self, node, mainWindow):
        # Init superclass
        QLabel.__init__(self)

        self.mainWindow = mainWindow
        self.node = node
        node.setCell(self)

        # -- Getting expected GUI behavior --
        self.setAutoFillBackground(True)  # Allows for automatic color updating
        self.setSizePolicy(
            QSizePolicy.Ignored,
            QSizePolicy.Ignored)  # Allows cells to adapt to window size
        self.setScaledContents(True)  # Makes images scale to cell size
        self.setAttribute(Qt.WA_Hover,
                          True)  # Allows the enterEvent definition to work

        # Animation variables
        self.effect = None
        self.paAnimation = None

        # Initialize as empty cell
        self.draw(Cell.EMPTY)
Exemplo n.º 23
0
    def __init__(self, sig_status, window_width, digirule_model, config):
        """
        Canvas in witch is drawn the Digirule as well as its buttons

        :param parent_frame: Main application frame (the execution frame)
        :type parent_frame: ExecutionFrame
        :param sig_status: signal that is connected to the statusbar
        :type sig_status: Signal
        :param digirule_model: Default digirule model
        :type digirule_model: str
        :param window_width: application window width, to use as width for this label as well
        :type window_width: int
        """
        QLabel.__init__(self)

        self.config = config
        self.sig_status = sig_status
        self.sig_PIN_in = None

        self.setFixedSize(window_width, 204)  # 1/4 of the original size
        self.setScaledContents(True)

        self.digirule_changed(digirule_model)
Exemplo n.º 24
0
 def __init__(self, text, ops):
     QLabel.__init__(self, str(text))
     self.text = str(text)
     self.ops = ops
Exemplo n.º 25
0
 def __init__(self, *args, **kwargs):
     QLabel.__init__(self, *args, **kwargs)
     self.pressedDown = False
     self.setPixmap("resize-grip.png")
     self.resize(32, 32)
Exemplo n.º 26
0
 def __init__(self, parent = None):
     QLabel.__init__(self, parent)
Exemplo n.º 27
0
 def __init__(self, parent, category):
     QLabel.__init__(self, category['label'])
     self.parent = parent
     self.category = category
     self.setAlignment(Qt.AlignCenter)
     self.mouseReleaseEvent = self.click_handler
Exemplo n.º 28
0
 def __init__(self, text):
     QLabel.__init__(self, text)
     self.text = text
 def __init__(self, aServiceInfo):
     QLabel.__init__(self)
     self.service_info = aServiceInfo
Exemplo n.º 30
0
    def __init__(self, params):
        MWB.__init__(self, params)
        QLabel.__init__(self)

        self.resize(200, 200)
Exemplo n.º 31
0
 def __init__(self, *args, **kwargs):
     QLabel.__init__(self, *args, **kwargs)
     self.animation = QVariantAnimation()
     self.animation.valueChanged.connect(self.changeColor)
Exemplo n.º 32
0
 def __init__(self):
     QLabel.__init__(self)