예제 #1
0
 def __init__(self, future_build_info, x=0, y=0, selectable=True):
     QGraphicsRectItem.__init__(self, x, y, self.WIDTH, self.WIDTH)
     self.future_build_info = future_build_info
     if selectable:
         self.setFlags(self.ItemIsSelectable | self.ItemIsFocusable)
     else:
         self.setFlags(self.ItemIsFocusable)
예제 #2
0
    def __init__(self, x, y, width, height, text):
        """
        A Rectangle with some text in it
        :param text: str
        :param x: float
        :param y: float
        :param height: float
        :param width: float
        """
        self.id = LaunchButton.ID
        LaunchButton.ID += 1
        print("my self.id = ", str(self.id))
        self.x = x
        self.y = y
        self.width = width
        self.height = height
        self.text = text
        # super(SelectFolderButton, self).__init__(self.x, self.y, self.width, self.height)
        QObject.__init__(self)
        QGraphicsRectItem.__init__(self, self.x, self.y, self.width, self.height)
        self.setAcceptHoverEvents(True)

        # self.text = HText("Select Folder", self.x + self.width - 20, self.y + height / 2, self, 45)
        # self.text = HText("Select Folder", self.x + 5, self.y + 5, self, 45)

        # simple state array, represented as a numpy array, 0 = False, 1 = True
        # [0] = ZIPPED, [1] = SENT, [2] = SUBMITTED, [3] = FINISHED, [4] = DELIVERED
        self.state = np.zeros(5)
        self.state[0] = 1
        print(self.state.any())
        # indexes = np.array(np.where(self.state == 1))
        # indexes = list(np.where(self.state == 1))
        indexes = np.where(self.state == 1)
        print("TYPE")
        print(type(indexes))
        # indexes.append(3)
        print("index state = ", indexes)
        print("len = ", len(indexes))

        print("state = \n", self.state)

        self.mpen = scene_objects.initialize_qpen(QColor(7, 133, 192), width=2)

        # main block color
        self.current_color = QColor(7, 133, 192)

        # self.current_color_1 = Qt.gray
        # self.current_color_2 = Qt.gray
        self.i = 0
        self.qdate_time = QDateTime()
        print("################################################################################\n")
예제 #3
0
 def __init__(self, x, y, w, h):
     QGraphicsRectItem.__init__(self, x, y, w, h)
 def __init__(self, x, y, w, h):
     QGraphicsRectItem.__init__(self, x, y, w, h)