Пример #1
0
    def changeMouseStyle(self, point):
        if not self._resizable:
            self.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
            self._mouseStyle = 0
            return

        iPosX = point.x()
        iPosY = point.y()

        iWidth = self.width()
        iHeight = self.height()
        if (iPosX >= iWidth - self._marginWidth and iPosX <= iWidth):
            self.setCursor(QtGui.QCursor(QtCore.Qt.SizeHorCursor))#右
            if (iPosY >= iHeight - self._marginWidth and iPosY <= iHeight):
                self.setCursor(QtGui.QCursor(QtCore.Qt.SizeFDiagCursor))#右下
                self._mouseStyle = 5
                return
            self._mouseStyle = 4
            return

        if (iPosY >= iHeight - self._marginWidth and iPosY <= iHeight):
            self.setCursor(QtGui.QCursor(QtCore.Qt.SizeVerCursor))#下
            self._mouseStyle = 6
            return

        self.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))#正常样式
        self._mouseStyle = 0;
        return
Пример #2
0
 def setAnning(self, isAnning=True):
     if isAnning:
         self.setAcceptHoverEvents(False)
         self.last_focse = self.polygon_hovering
         self.polygon_hovering = False
         self.anning = True
         self.setBrush(QtGui.QBrush(QtCore.Qt.NoBrush))
         self.setFlag(QtWidgets.QGraphicsItem.ItemIsSelectable, False)
         # self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable, False)
         self.setFlag(QtWidgets.QGraphicsItem.ItemSendsGeometryChanges,
                      False)
         self.setFlag(QtWidgets.QGraphicsItem.ItemIsFocusable, False)
         self.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
     else:
         self.setAcceptHoverEvents(True)
         self.anning = False
         if self.last_focse:
             self.polygon_hovering = True
             self.setBrush(self.insideColor)
         else:
             self.setBrush(self.halfInsideColor)
         self.setFlag(QtWidgets.QGraphicsItem.ItemIsSelectable, True)
         # self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable, True)
         self.setFlag(QtWidgets.QGraphicsItem.ItemSendsGeometryChanges,
                      True)
         self.setFlag(QtWidgets.QGraphicsItem.ItemIsFocusable, True)
         self.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
Пример #3
0
    def __init__(self, orientation, space=5):
        super().__init__()
        self._orientation = orientation

        if orientation == Qt.Vertical:
            self.setCursor(QtGui.QCursor(QtCore.Qt.SplitVCursor))
            self.setFixedHeight(space)

        elif orientation == Qt.Horizontal:
            self.setCursor(QtGui.QCursor(QtCore.Qt.SplitHCursor))
            self.setFixedWidth(space)
    def __init__(self, parent, item, pixmap=None):
        """
		desc:
			Constructor.

		arguments:
			parent:
				desc:	The parent.
				type:	QWidget
			item:
				desc:	An item.
				type:	qtitem
			pixmap:
				desc:	A pixmap for the icon.
				type:	QPixmap
		"""

        super(toolbar_items_item, self).__init__(parent)
        self.setup(parent)
        self.item = item
        if pixmap is None:
            self.pixmap = self.theme.qpixmap(item)
        else:
            self.pixmap = pixmap
        # self.setMargin(6)
        self.setToolTip(_("Drag this <b>%s</b> item to the intended location in the overview area or into the item list of a sequence tab") \
         % self.item)
        self.setCursor(QtGui.QCursor(QtCore.Qt.OpenHandCursor))
        self.setPixmap(self.pixmap)
Пример #5
0
def center_on_screen(widget):
    """Move widget to the center of the default screen"""
    desktop = QtWidgets.QApplication.instance().desktop()
    rect = desktop.screenGeometry(QtGui.QCursor().pos())
    cy = rect.height()//2
    cx = rect.width()//2
    widget.move(cx - widget.width()//2, cy - widget.height()//2)
Пример #6
0
    def collectTools(self):
        '''
        Get a Tool button or a parameter within the tools menu
        and add it to the active script
        '''
        # TOGGLE BETWEEN NORMAL- AND PointingHandCursor
        self._collect = not self._collect
        if self._collect:
            QtWidgets.QApplication.setOverrideCursor(
                QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        else:
            QtWidgets.QApplication.restoreOverrideCursor()
        # TOGGLE BUTTON
        self.btn_collect.setChecked(self._collect)

        # add chosen widget to active script:
        def fn(tool):
            return self.tabs.currentWidget().addTool(tool)

        for tool in self.display.widget.tools.values():
            # TOOLS:
            tool.returnToolOnClick(self._collect, fn)
            # TOOL-PARAMETERS:
            if isinstance(tool.menu(), ParameterMenu):
                tool.menu().pTree.returnParameterOnClick(self._collect, fn)
Пример #7
0
    def __init__(self, window, file, modules=[]):
        QtWidgets.QGraphicsRectItem.__init__(self, window.view.hud)

        self.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))

        self.help_text = QtWidgets.QGraphicsSimpleTextItem(self)
        self.help_text.setFont(QtGui.QFont("", 11))
        self.help_text.setPos(0, 10)
        self.help_text.setBrush(QtGui.QBrush(QtGui.QColor(255, 255, 255)))

        self.setBrush(QtGui.QBrush(QtGui.QColor(0, 0, 0, 128)))
        self.setPos(100, 100)
        self.setZValue(19)

        self.button = QtWidgets.QPushButton()
        self.button.setCheckable(True)
        self.button.setIcon(qta.icon('fa.question'))
        self.button.setToolTip("display help")
        self.button.clicked.connect(self.ShowHelpText)
        window.layoutButtons.addWidget(self.button)

        self.files = [file]
        for mod in modules:
            try:
                self.files.append(mod.file())
            except AttributeError:
                pass
        self.text = ""
        self.setVisible(False)
Пример #8
0
def center_on_screen(widget):
    """Move widget to the center of the default screen"""
    desk = desktop()
    rect = desk.screenGeometry(QtGui.QCursor().pos())
    cy = rect.height()//2
    cx = rect.width()//2
    widget.move(cx - widget.width()//2, cy - widget.height()//2)
Пример #9
0
    def __init__(self, parent_hud, window, image_display, config):
        QtGui.QGraphicsRectItem.__init__(self, parent_hud)
        self.config = config

        self.window = window
        self.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))

        self.setBrush(QtGui.QBrush(QtGui.QColor(0, 0, 0, 250)))
        self.setZValue(30)

        self.setRect(QtGui.QRectF(0, 0, 110, 110))
        BoxGrabber(self)
        self.dragged = False

        self.hidden = False
        if self.config.hide_interfaces:
            self.setVisible(False)
            self.hidden = True

        self.qimages = []
        self.pixmaps = []
        self.shapes = []
        for i in xrange(600):
            self.pixmaps.append(QtGui.QGraphicsPixmapItem(self))
            self.qimages.append(QtGui.QImage())
            self.shapes.append((0, 0))

        self.offset = [0,0]

        self.t=checkUpdateThread(self)
        self.t.signal.sig.connect(self.updatePixmap)
        self.started = False
Пример #10
0
    def __init__(self, parent_hud, window):
        QtWidgets.QGraphicsRectItem.__init__(self, parent_hud)

        self.window = window
        self.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))

        self.setBrush(QtGui.QBrush(QtGui.QColor(0, 0, 0, 128)))
        self.setPos(20, -140)
        self.setZValue(19)

        self.font = QtGui.QFont()
        self.font.setPointSize(12)
        self.font.setStyleHint(QtGui.QFont.Monospace)
        self.font.setFixedPitch(True)

        self.text = QtWidgets.QGraphicsSimpleTextItem(self)
        self.text.setFont(self.font)
        self.text.setBrush(QtGui.QBrush(QtGui.QColor("white")))
        self.text.setZValue(10)
        self.text.setPos(5, 10)

        self.setRect(QtCore.QRectF(0, 0, 110, 110))
        BoxGrabber(self)
        self.dragged = False

        self.closeDataFile()
Пример #11
0
    def __init__(self, parent=None):
        super().__init__(parent)

        self.setAcceptDrops(True)
        self.set_elide_mode("right")
        self.set_remove_behaviour("left_tab")
        self.mouse_cursor = QtGui.QCursor()
Пример #12
0
def load_cursor(filename, hotX=-1, hotY=-1):
    renderer = QtSvg.QSvgRenderer(filename)
    pm = QtGui.QPixmap(16, 16)
    pm.fill(QtCore.Qt.transparent)
    painter = QtGui.QPainter(pm)
    renderer.render(painter)
    del painter, renderer
    return QtGui.QCursor(pm, hotX, hotY)
Пример #13
0
 def wrapper(*args, **kwargs):
     QtWidgets.QApplication.setOverrideCursor(
         QtGui.QCursor(QtCore.Qt.WaitCursor))
     try:
         ret_val = func(*args, **kwargs)
     finally:
         QtWidgets.QApplication.restoreOverrideCursor()
     return ret_val
Пример #14
0
 def inner(*args, **kwargs):
     
     QtWidgets.QApplication.setOverrideCursor(QtGui.QCursor(
         QtCore.Qt.WaitCursor))
     QtWidgets.QApplication.processEvents()
     retval = fnc(*args, **kwargs)
     QtWidgets.QApplication.restoreOverrideCursor()
     QtWidgets.QApplication.processEvents()
     return retval
Пример #15
0
    def __init__(self, sketchpad):
        """
		desc:
			Constructor.

		arguments:
			sketchpad:
				desc:	A sketchpad object.
				type:	sketchpad
		"""

        super(sketchpad_widget, self).__init__(sketchpad.main_window,
                                               ui=u'widgets.sketchpad')
        self.sketchpad = sketchpad
        self.initialized = False
        self.margin = 50
        self.canvas = self.sketchpad.canvas
        self.arrow_cursor = QtGui.QCursor(
            self.theme.qpixmap(u'os-pointer', size=32), 8, 4)
        self.ui.graphics_view.setScene(self.canvas)
        self.ui.graphics_view.setMouseTracking(True)
        self.ui.button_pointer.clicked.connect(self.select_pointer_tool)
        self.ui.spinbox_zoom.valueChanged.connect(self.zoom)
        self.ui.spinbox_scale.valueChanged.connect(self.apply_scale)
        self.ui.spinbox_rotation.valueChanged.connect(self.apply_rotation)
        self.ui.spinbox_penwidth.valueChanged.connect(self.apply_penwidth)
        self.ui.edit_color.textEdited.connect(self.apply_color)
        self.ui.edit_show_if.editingFinished.connect(self.apply_show_if)
        self.ui.edit_show_if.setValidator(
            cond_validator(self, default=u'always'))
        self.ui.edit_name.editingFinished.connect(self.apply_name)
        self.ui.spinbox_arrow_head_width.valueChanged.connect(
            self.apply_arrow_head_width)
        self.ui.spinbox_arrow_body_width.valueChanged.connect(
            self.apply_arrow_body_width)
        self.ui.spinbox_arrow_body_length.valueChanged.connect(
            self.apply_arrow_body_length)
        self.ui.checkbox_center.toggled.connect(self.apply_center)
        self.ui.checkbox_fill.toggled.connect(self.apply_fill)
        self.ui.checkbox_html.toggled.connect(self.apply_html)
        self.ui.widget_font.font_changed.connect(self.apply_font)
        self.ui.checkbox_grid.toggled.connect(self.apply_grid)
        self.ui.spinbox_grid.valueChanged.connect(self.apply_grid)
        self.ui.button_zoom_fit.clicked.connect(self.zoom_fit)
        self.ui.button_zoom_1.clicked.connect(self.zoom_1)
        # Set the minimum height of the settings widget to the height that it
        # has when all controls are visible. This prevents the display from
        # jumping.
        self.ui.widget_settings.adjustSize()
        self.ui.widget_settings.setMinimumHeight(
            self.ui.widget_settings.height())
        self.build_toolbar()
        self.selected_element_tool = None
        self.set_size()
        self.init_settings()
        self.select_pointer_tool()
Пример #16
0
 def _cursor_in_area(self):
     geom = self.geometry()
     top_left = self.mapToGlobal(geom.topLeft())
     bottom_right = self.mapToGlobal(geom.bottomRight())
     geom = QtCore.QRect(top_left, bottom_right)
     geom.setTop(geom.top() - CURSOR_MARGIN_TOP)
     geom.setBottom(geom.bottom() + CURSOR_MARGIN_BOTTOM)
     geom.setLeft(geom.left() - CURSOR_MARGIN_LEFT)
     geom.setRight(geom.right() + CURSOR_MARGIN_RIGHT)
     cursor_pos = QtGui.QCursor().pos()
     return geom.contains(cursor_pos)
Пример #17
0
        def __init__(self, parent=None):
            super().__init__(parent)

            self.setAcceptDrops(True)
            self.setElideMode(QtCore.Qt.ElideRight)
            self.setSelectionBehaviorOnRemove(QtWidgets.QTabBar.SelectLeftTab)

            self.dragStartPos = QtCore.QPoint()
            self.dragDropedPos = QtCore.QPoint()
            self.mouseCursor = QtGui.QCursor()
            self.dragInitiated = False
Пример #18
0
    def __init__(
        self,
        labelIndex,
        shape,
        delPolygon,
        setDirty,
        insideColor=[255, 0, 0],
        borderColor=[0, 255, 0],
        opacity=0.5,
        cocoIndex=None,
        parent=None,
    ):
        super(PolygonAnnotation, self).__init__(parent)
        self.points = []
        self.m_items = []
        self.m_lines = []
        self.coco_id = cocoIndex
        self.height, self.width = shape[:2]
        self.delPolygon = delPolygon
        self.setDirty = setDirty

        self.labelIndex = labelIndex
        self.item_hovering = False
        self.polygon_hovering = False
        self.anning = False  # 是否标注模式
        self.line_hovering = False
        self.noMove = False
        self.last_focse = False  # 之前是不是焦点在

        self.setZValue(10)
        self.opacity = opacity
        i = insideColor
        self.insideColor = QtGui.QColor(i[0], i[1], i[2])
        self.insideColor.setAlphaF(opacity)
        self.halfInsideColor = QtGui.QColor(i[0], i[1], i[2])
        self.halfInsideColor.setAlphaF(opacity / 2)
        self.setBrush(self.halfInsideColor)
        b = borderColor
        self.borderColor = QtGui.QColor(b[0], b[1], b[2])
        self.borderColor.setAlphaF(0.8)
        self.setPen(QtGui.QPen(self.borderColor))
        self.setAcceptHoverEvents(True)

        self.setFlag(QtWidgets.QGraphicsItem.ItemIsSelectable, True)
        self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable, False)
        self.setFlag(QtWidgets.QGraphicsItem.ItemSendsGeometryChanges, True)
        self.setFlag(QtWidgets.QGraphicsItem.ItemIsFocusable, True)

        self.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))

        # persistent this bbox instance and update when needed
        self.bbox = BBoxAnnotation(labelIndex, self, cocoIndex, self)
        self.bbox.setParentItem(self)
Пример #19
0
 def __long_action(*args, **kwargs):
     status_bar = getGui().statusBar()
     if message is not None:
         status_bar.showMessage(message)
     QtWidgets.QApplication.setOverrideCursor(
         QtGui.QCursor(QtCore.Qt.WaitCursor))
     try:
         res = f(*args, **kwargs)
     finally:
         QtWidgets.QApplication.restoreOverrideCursor()
         if message is not None:
             status_bar.clearMessage()
     return res
Пример #20
0
        def __init__(self, parent=None):
            QtWidgets.QTabBar.__init__(self, parent)

            self.setAcceptDrops(True)
            self.setElideMode(QtCore.Qt.ElideRight)
            self.setSelectionBehaviorOnRemove(QtWidgets.QTabBar.SelectLeftTab)

            self.drag_start_pos = QtCore.QPoint()
            self.drag_end_pos = QtCore.QPoint()
            self.mouse_cursor = QtGui.QCursor()
            self.drag_initiated = False

            self.drag_pixmap = None
Пример #21
0
    def set_busy(self, state=True):
        """
		Show/ hide the busy notification

		Keywords arguments:
		state -- indicates the busy status (default=True)
		"""

        if state:
            QtWidgets.QApplication.setOverrideCursor(
                QtGui.QCursor(QtCore.Qt.WaitCursor))
        else:
            QtWidgets.QApplication.restoreOverrideCursor()
        QtWidgets.QApplication.processEvents()
Пример #22
0
 def rehighlight(self):
     """
     Rehighlight the entire document, may be slow.
     """
     start = time.time()
     QtWidgets.QApplication.setOverrideCursor(
         QtGui.QCursor(QtCore.Qt.WaitCursor))
     try:
         super(SyntaxHighlighter, self).rehighlight()
     except RuntimeError:
         # cloned widget, no need to rehighlight the same document twice ;)
         pass
     QtWidgets.QApplication.restoreOverrideCursor()
     end = time.time()
     _logger().debug('rehighlight duration: %fs' % (end - start))
Пример #23
0
    def setCursor(self) -> None:
        icon = self.getIcon(color=QtGui.QColor(255, 255, 255))
        # convert icon to numpy array
        buffer = icon.pixmap(16, 16).toImage().constBits()
        cursor2 = np.ndarray(shape=(16, 16, 4), buffer=buffer.asarray(size=16 * 16 * 4), dtype=np.uint8)
        # load the cursor image
        cursor = imageio.imread(os.path.join(os.environ["CLICKPOINTS_ICON"], "Cursor.png"))
        # compose them
        cursor3 = np.zeros([cursor.shape[0] + cursor2.shape[0], cursor.shape[1] + cursor2.shape[1], 4], cursor.dtype)
        cursor3[:cursor.shape[0], :cursor.shape[1], :] = cursor
        y, x = (cursor.shape[0] - 6, cursor.shape[1] - 4)
        cursor3[y:y + cursor2.shape[0], x:x + cursor2.shape[1], :] = cursor2
        # create a cursor
        cursor = QtGui.QCursor(QtGui.QPixmap(array2qimage(cursor3)), 0, 0)

        # and the the cursor as the active one
        self.parent.ImageDisplay.setCursor(cursor)
Пример #24
0
    def _mouseReleaseEvent(self, event):
        button = event.button()

        if button == LeftButton:
            self.execute()
        elif button == RightButton:
            menu = QtWidgets.QMenu()
            actionCopy = menu.addAction("Copy")
            actionPaste = menu.addAction("Paste")
            global_position = QtGui.QCursor().pos()
            actionCopy.triggered.connect(self._copy)
            actionPaste.triggered.connect(self._paste)
            menu.exec_(global_position)
        elif button == MiddleButton:
            pass

        event.accept()
Пример #25
0
    def __init__(self,
                 parent,
                 name="",
                 start_value=None,
                 max_value=100,
                 min_value=0,
                 font=None,
                 scale=1):
        QtWidgets.QGraphicsRectItem.__init__(self, parent)

        self.parent = parent
        self.name = name
        self.maxValue = max_value
        self.minValue = min_value
        self.format = "%.2f"

        self.setCursor(QtGui.QCursor(QtCore.Qt.OpenHandCursor))
        self.setPen(QtGui.QPen(QtGui.QColor(255, 255, 255, 0)))

        self.text = QtWidgets.QGraphicsSimpleTextItem(self)
        if font is None:
            font = QtGui.QFont("", 11 / scale)
        else:
            font.setPointSize(11 / scale)
        self.text.setFont(font)
        self.text.setPos(0, -23)
        self.text.setBrush(QtGui.QBrush(QtGui.QColor("white")))

        self.sliderMiddel = QtWidgets.QGraphicsRectItem(self)
        self.sliderMiddel.setRect(QtCore.QRectF(0, 0, 100, 1))
        self.sliderMiddel.setPen(QtGui.QPen(QtGui.QColor("white")))

        path = QtGui.QPainterPath()
        path.addEllipse(-5, -5, 10, 10)
        self.slideMarker = QtWidgets.QGraphicsPathItem(path, self)
        self.slideMarker.setBrush(QtGui.QBrush(QtGui.QColor(255, 0, 0, 255)))

        self.setRect(QtCore.QRectF(-5, -5, 110, 10))
        self.dragged = False

        self.value = (self.maxValue + self.minValue) * 0.5
        if start_value is not None:
            self.value = start_value
        self.start_value = self.value
        self.setValue(self.value)
Пример #26
0
            def eventFilter(self, _obj, event):
                """
                Detect a QMainWindow drop event by looking for a NonClientAreaMouseMove (173)
                event that immediately follows a Move event
                :param _obj: the object that generated the event.
                :param event: the current event.
                """

                # If a NonClientAreaMouseMove (173) event immediately follows a Move event
                if self.lastEvent == QtCore.QEvent.Move and event.type() == 173:
                    # Determine the position of the mouse cursor and emit it with the onDropSignal
                    mouse_drop_pos = QtGui.QCursor().pos()
                    self.onDropSignal.emit(mouse_drop_pos)
                    self.lastEvent = event.type()
                    return True
                else:
                    self.lastEvent = event.type()
                    return False
Пример #27
0
    def __init__(self, annotation_item, index, color):
        super(GripItem, self).__init__()
        self.m_annotation_item = annotation_item
        self.hovering = False
        self.m_index = index
        color.setAlphaF(1)
        self.color = color

        self.updateSize()
        self.setPath(self.circle)
        self.setBrush(self.color)
        self.setPen(QtGui.QPen(self.color, 1))
        self.setFlag(QtWidgets.QGraphicsItem.ItemIsSelectable, True)
        self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable, True)
        self.setFlag(QtWidgets.QGraphicsItem.ItemSendsGeometryChanges, True)
        self.setFlag(QtWidgets.QGraphicsItem.ItemIsFocusable, True)
        self.setAcceptHoverEvents(True)
        self.setZValue(12)
        self.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
Пример #28
0
    def createDBDoc(self, filepath, is_tmp_db=False):
        """
        Create a new, empty database (:meth:`vitables.h5db.dbdoc.DBDoc`
        instance).

        :Parameters:

        - `filepath`: the full path of the file being created.
        - `is_tmp_db`: True if the `DBDoc` is tied to the temporary database
        """

        try:
            QtWidgets.qApp.setOverrideCursor(
                QtGui.QCursor(QtCore.Qt.WaitCursor))
            # Create the dbdoc
            try:
                db_doc = dbdoc.DBDoc(filepath, 'w', is_tmp_db)
            except (tables.NodeError, OSError):
                log.error(
                    translate(
                        'DBsTreeModel',
                        """File creation failed due to unknown"""
                        """reasons! Please, have a look to the """
                        """last error displayed in the logger. If you """
                        """think it's a bug, please report it to """
                        """developers.""", 'A file creation error'))
                return None

            # Track the just created dbdoc
            self.mapDB(filepath, db_doc)

            # Populate the model with the dbdoc
            root = rootgroupnode.RootGroupNode(self, db_doc, self.root,
                                               is_tmp_db)
            self.fdelta = frozenset([root])
            self.gdelta = frozenset([])
            self.ldelta = frozenset([])
            self.links_delta = frozenset([])
            self.insertRows(0, 1)
        finally:
            QtWidgets.qApp.restoreOverrideCursor()
        return db_doc
Пример #29
0
    def select_element_tool(self, element):
        """
		desc:
			Selects an element tool.

		argument:
			element:
				desc:	An element tool, which is a class, not an instance of
						an element.
				type:	type
		"""

        self.selected_element_tool = element
        self.show_element_tool_settings(element)
        cursor = element.cursor()
        if isinstance(cursor, tuple):
            pixmap, hotx, hoty = cursor
            cursor = QtGui.QCursor(self.theme.qpixmap(pixmap, size=32), hotx,
                                   hoty)
        self.ui.graphics_view.setCursor(cursor)
Пример #30
0
    def __init__(self, parent, marker_handler, icon, pos, scale):
        QtWidgets.QGraphicsRectItem.__init__(self, parent)
        self.parent = parent
        self.marker_handler = marker_handler

        self.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))

        self.setAcceptHoverEvents(True)
        self.active = False

        self.setZValue(9)

        self.pixmap = QtWidgets.QGraphicsPixmapItem(self)
        self.pixmap.setPixmap(icon.pixmap(16 * scale))

        self.setRect(-5 * scale, -3 * scale, 26 * scale, 22 * scale)
        self.setPos(pos[0] * scale, pos[1] * scale)

        self.clicked = lambda: 0

        self.SetToInactiveColor()