Пример #1
0
    def drawAxes(self):
        self.qp.drawLine(0, 1, self.sizeScreen[0], 1)
        self.qp.drawLine(1, 0, 1, self.sizeScreen[1])

        for i in range(100, self.sizeScreen[0], 100):
            self.qp.drawLine(i, 0, i, 7)
            self.qp.drawStaticText(i - 10, 7, QStaticText(str(i)))

        for i in range(100, self.sizeScreen[1], 100):
            self.qp.drawLine(0, i, 10, i)
            self.qp.drawStaticText(10, i - 10, QStaticText(str(i)))
Пример #2
0
    def drawAxes(self):
        oneUnit = self.coordinatePlane.oneUnit()
        self.qp.drawLine(1, 0, 1, self.sizeScreen.height())
        self.qp.drawLine(0, 1, self.sizeScreen.width(), 1)
        for i in range(100, self.sizeScreen.height(), 100):
            self.qp.drawLine(0, i, 10, i)
            self.qp.drawStaticText(12, i - 7, QStaticText(str(i)))

        for i in range(100, self.sizeScreen.width(), 100):
            self.qp.drawLine(i, 0, i, 10)
            self.qp.drawStaticText(i - 10, 12, QStaticText(str(i)))
            self.qp.drawStaticText(7, 7, QStaticText(str(0)))
Пример #3
0
 def draw(self, painter):
     gap = 1  # tooths' gap
     tooth_w = 10
     painter.save()
     painter.translate(self.posX - self.width / 2,
                       self.posY - self.height / 2)
     painter.drawStaticText(-2, -10, QStaticText(self.time))
     painter.drawStaticText(self.width - 38, -10,
                            QStaticText(self.end_time))
     painter.drawLine(0, self.height / 2, self.width, self.height / 2)
     painter.drawRect(0 + self.position - gap - tooth_w,
                      0 + self.height / 2, tooth_w, self.height)
     painter.drawRect(0 + self.position + gap, 0 + self.height / 2, tooth_w,
                      self.height)
     painter.restore()
Пример #4
0
 def __static_text_elided_cache(
         self, option: QStyleOptionViewItem, width: int) -> QStaticText:
     """
     Return a QStaticText instance for depicting the text of the `option`
     item.
     """
     key = option.text, option.font.key(), option.textElideMode, width
     try:
         st = self.__static_text_lru_cache[key]
     except KeyError:
         fm = option.fontMetrics
         text = fm.elidedText(option.text, option.textElideMode, width)
         st = QStaticText(text)
         st.prepare(QTransform(), option.font)
         self.__static_text_lru_cache[key] = st
     return st
Пример #5
0
 def drawNodes(self, target = None):
     '''draws the graph nodes and prints its coords'''
     if target:
         painter = QPainter(target)
     else:
         painter = QPainter(self.graph_image)
     node_width = 10
     painter.setPen(Qt.NoPen)
     for node in self.graph.nextNode():
         if node in self.graph.highlighted_node:
             if node.data is not None:
                 node_color = self.colorPicker(node)
                 painter.setBrush(QBrush(node_color, Qt.SolidPattern))
         else:
             painter.setBrush(QBrush(Qt.black, Qt.SolidPattern))
         painter.drawEllipse(node.x() - node_width//2,
                             node.y() - node_width//2,
                             node_width,
                             node_width)
         nodeNo = ""
         if node.data is not None and 'number' in node.data.keys():
             nodeNo = str(node.data['number']) + " "
         node_text = QStaticText(nodeNo + str(node))
         painter.setPen(QPen(Qt.black, 1))
         painter.drawStaticText(node.x() - 5, node.y() + 5, node_text)
     painter.end()
    def drawAxes(self):

        xMax, yMax, xMin, yMin = self.__getBounds()

        resize = 10

        if abs(xMax) < 1 or abs(yMax) < 1 or abs(xMin) < 1 or abs(yMin) < 1:
            resize = 0.5
        if abs(xMax) / 10 < 1 or abs(yMax) / 10 < 1 or abs(xMin) / 10 < 1 or abs(yMin) / 10 < 1:
            resize = 0.1

        xMin -= resize
        yMin -= resize

        self.dx = -1 * xMin
        self.dy = -1 * yMin

        intervalX = (xMax + resize) - xMin
        intervalY = (yMax + resize) - yMin

        k = min((self.sizeScreen[0] - resize) / (intervalX), (self.sizeScreen[1] - resize) / (intervalY))

        self.kx = k
        self.ky = k

        stepX = (intervalX / 10)
        stepY = (intervalY / 10)

        self.qp.drawLine(1, 0, 1, self.sizeScreen[1])
        self.qp.drawLine(0, self.sizeScreen[1] - 2, self.sizeScreen[0], self.sizeScreen[1] - 2)

        i = yMin + stepY
        while i <= self.sizeScreen[1] / self.ky:
            self.qp.drawLine(0, self.sizeScreen[1] - (i + self.dy) * self.ky, 10,
                             self.sizeScreen[1] - (i + self.dy) * self.ky)
            self.qp.drawStaticText(12, self.sizeScreen[1] - (i + self.dy) * self.ky, QStaticText(str(round(i, 2))))
            i += stepY

        i = xMin + stepX
        while i <= self.sizeScreen[0] / self.kx:
            self.qp.drawLine((i + self.dx) * self.kx, self.sizeScreen[1] - 1, (i + self.dx) * self.kx,
                             self.sizeScreen[1] - 11)
            self.qp.drawStaticText((i + self.dx) * self.kx, self.sizeScreen[1] - 25, QStaticText(str(round(i, 2))))
            i += stepX
Пример #7
0
    def __init__(self, parent=None):
        super(RollingLabel, self).__init__(parent)
        self.timer = QTimer()
        self.timer.timeout.connect(self.updateR)
        self.timer.start(55)

        self.wholeTextSize = QSize(0, 0)
        self.singleTextWidth = 0

        self.scrollEnabled = False
        self.scrollPos = 0

        self.buffer = QImage()
        self.alphaChannel = QImage()

        self.staticText = QStaticText("")
        self.staticText.setTextFormat(Qt.PlainText)

        self.setFixedHeight(self.fontMetrics().height())
        self.leftMargin = self.height() / 3
        self._text = ""
Пример #8
0
 def paintTitle(self, painter: QPainter):
     text = QStaticText(self.title())
     text.setTextWidth(20)
     half_size = QPointF(
         text.size().width() / 2,
         text.size().height() / 2
     )
     painter.drawStaticText(self.pos() - half_size, text)
    def __drawPoints(self):
        color = Qt.red
        newPen = QPen()
        newPen.setColor(color)
        self.qp.setPen(newPen)
        for i in range(len(self.set1)):
            point = QPoint((self.set1[i].get_x() + self.dx) * self.kx, self.sizeScreen[1] - (self.set1[i].get_y() + self.dy) * self.ky)
            self.qp.drawEllipse(point, 5, 5)
            point = QPoint(round(point.x() - 20), round((point.y() - 20)))
            text = ""
            text += str(self.set1[i].get_x()) + "," + str(self.set1[i].get_y())
            self.qp.drawStaticText(point, QStaticText(text))

        color = Qt.green
        newPen = QPen()
        newPen.setColor(color)
        self.qp.setPen(newPen)
        for i in range(len(self.set2)):
            point = QPoint((self.set2[i].get_x() + self.dx) * self.kx, self.sizeScreen[1] - (self.set2[i].get_y() + self.dy) * self.ky)
            self.qp.drawEllipse(point, 5, 5)
            point = QPoint(round(point.x() - 20), round((point.y() - 20)))
            text = ""
            text += str(self.set2[i].get_x()) + "," + str(self.set2[i].get_y())
            self.qp.drawStaticText(point, QStaticText(text))
Пример #10
0
 def paintEvent(self, e):
     """ Overwritten paintEvent method. 
     
     Sets current arc color and width and adds text if necessary.
     
     Keyword arguments:
     e -- sender which triggered the event
     """
     painter = QtGui.QPainter(self)
     pen = QtGui.QPen()
     pen.setColor(QtGui.QColor(self.arcColor))
     pen.setWidth(self.arcWidth)
     painter.setPen(pen)
     painter.drawArc(self.arcWidth, self.arcWidth,
                     self.width() - 2 * self.arcWidth,
                     self.width() - 2 * self.arcWidth, 0, 16 * self.angle)
     if self.addText:
         text = QStaticText('Target Symbol:')
         pen.setColor(QtGui.QColor('black'))
         painter.setPen(pen)
         painter.setFont(QFont("times", 22))
         painter.drawStaticText(QPoint(90, 40), text)
Пример #11
0
    def paintEvent(self, event):
        painter = QPainter()
        painter.begin(self)
        if not self.ignored:
            self.paint_background(painter)
        painter.setPen(QColor(255, 0, 255))
        painter.setBrush(QColor(0, 0, 0))

        for index, i in enumerate(self.initial_dots):
            painter.setPen(QColor(255, 0, 255))
            painter.drawRect(i.x() - 1, i.y() - 1, 2, 2)
            try:
                end_point = self.final_dots[index]
                painter.setPen(QColor(0, 0, 255))
                moving = False
            except IndexError:
                # There is no end point, so cursor is end point
                end_point = self.cursor().pos()
                painter.setPen(QColor(0, 0, 255, 64))
                moving = True

            mid_point = QPoint(end_point.x(), i.y())
            painter.drawPolyline(i, mid_point, end_point, i)
            painter.setPen(QColor(255, 0, 255))
            halfx = (mid_point.x() - i.x()) / 2 + i.x()
            halfy = (end_point.y() - mid_point.y()) / 2 + mid_point.y()

            # Draw perpendicular magenta lines in each of the triangle's sides' center
            top_horizontal_half = QPoint(halfx, i.y() + 10)
            bot_horizontal_half = QPoint(halfx, i.y() - 10)

            left_vertical_half = QPoint(end_point.x() - 10, halfy)
            right_vertical_half = QPoint(end_point.x() + 10, halfy)
            try:
                hipotenuse = math.sqrt((2 * (halfx - i.x()))**2 +
                                       (2 * (halfy - mid_point.y()))**2)
                scaling_factor = hipotenuse / 10  # To ensure line length = 10
                y_change = (2 * (halfx - i.x()) / scaling_factor)
                x_change = (2 * (halfy - mid_point.y()) / scaling_factor)

            except ZeroDivisionError:
                y_change = 0
                x_change = 0

            top_hipotenuse_half = QPoint(halfx - x_change, halfy + y_change)
            bot_hipotenuse_half = QPoint(halfx + x_change, halfy - y_change)

            if hipotenuse >= 20 and moving:  # To not be in the way while looking for a second point
                painter.drawLine(top_horizontal_half, bot_horizontal_half)
                painter.drawLine(left_vertical_half, right_vertical_half)
                painter.drawLine(top_hipotenuse_half, bot_hipotenuse_half)

            painter.setPen(QColor(255, 255, 255))
            x_px = abs(int((halfx - i.x()) * 2)) + 1
            y_px = abs(int((halfy - mid_point.y()) * 2)) + 1
            hipotenuse = abs(hipotenuse)
            inch_to_cm = 2.54
            x_inches = x_px / self.ppix
            y_inches = y_px / self.ppiy
            hip_inches = hipotenuse / ((self.ppiy + self.ppix) / 2)
            x_cm = x_inches * inch_to_cm
            y_cm = y_inches * inch_to_cm
            hip_cm = hip_inches * inch_to_cm
            x_text = str(
                x_px
            ) + "px | " + f"{x_cm:7.2f}" + "cm | " + f"{x_inches:7.2f}" + "inch"
            y_text = str(
                y_px
            ) + "px | " + f"{y_cm:7.2f}" + "cm | " + f"{y_inches:7.2f}" + "inch"
            hip_text = f"{abs(hipotenuse):7.2f}" + "px | " + f"{hip_cm:7.2f}" + "cm | " + f"{hip_inches:7.2f}" + "inch"
            # in 7.2f -> 7 = max char, 2 = max floating point precision
            if moving and hipotenuse >= 20:  # To not be in the way while looking for a second point
                painter.drawText(QPoint(halfx, i.y()), x_text)
                painter.drawText(QPoint(end_point.x(), halfy), y_text)
                painter.drawText(
                    QPoint(halfx, halfy - 12),
                    hip_text)  # 7 = max char, 2 = max floating point precision
            elif not moving:
                # drawStaticText is more optimized if it rarely updates
                painter.drawStaticText(QPoint(halfx, i.y()),
                                       QStaticText(x_text))
                painter.drawStaticText(QPoint(end_point.x(), halfy),
                                       QStaticText(y_text))
                painter.drawStaticText(QPoint(halfx, halfy - 12),
                                       QStaticText(hip_text))

        painter.setPen(QColor(255, 0, 255))
        for i in self.final_dots:
            painter.drawRect(i.x() - 1, i.y() - 1, 2, 2)
        """if not self.ignored:
            self.paint_cursor(painter)"""
        painter.end()
Пример #12
0
 def sttext(text: str) -> QStaticText:
     return QStaticText(text)
Пример #13
0
class RollingLabel(QLabel):
    def __init__(self, parent=None):
        super(RollingLabel, self).__init__(parent)
        self.timer = QTimer()
        self.timer.timeout.connect(self.updateR)
        self.timer.start(55)

        self.wholeTextSize = QSize(0, 0)
        self.singleTextWidth = 0

        self.scrollEnabled = False
        self.scrollPos = 0

        self.buffer = QImage()
        self.alphaChannel = QImage()

        self.staticText = QStaticText("")
        self.staticText.setTextFormat(Qt.PlainText)

        self.setFixedHeight(self.fontMetrics().height())
        self.leftMargin = self.height() / 3
        self._text = ""

    def text(self):
        return self._text

    def setText(self, text):
        self._text = text
        self.updateText()
        self.update()

    def paintEvent(self, event):
        p = QPainter(self)

        if self.scrollEnabled:
            self.buffer.fill(qRgba(0, 0, 0, 0))
            pb = QPainter(self.buffer)
            pb.setPen(p.pen())
            pb.setFont(p.font())

            x = min(-self.scrollPos, 0) + self.leftMargin
            while x < self.width():
                pb.drawStaticText(
                    QPointF(x,
                            (self.height() - self.wholeTextSize.height()) / 2)
                    + QPoint(2, 2), self.staticText)
                x += self.wholeTextSize.width()

            #Apply Alpha Channel
            pb.setCompositionMode(QPainter.CompositionMode_DestinationIn)
            pb.setClipRect(self.width() - 15, 0, 15, self.height())
            pb.drawImage(0, 0, self.alphaChannel)
            pb.setClipRect(0, 0, 15, self.height())
            #initial situation: don't apply alpha channel in the left half of the image at all; apply it more and more until scrollPos gets positive
            if self.scrollPos < 0:
                pb.setOpacity((max(-8, self.scrollPos) + 8) / 8.0)
            pb.drawImage(0, 0, self.alphaChannel)

            p.drawImage(0, 0, self.buffer)
        else:
            x = (self.width() - self.wholeTextSize.width()) / 2
            y = (self.height() - self.wholeTextSize.height()) / 2
            p.drawStaticText(QPointF(x, y), self.staticText)

    def updateR(self):
        self.scrollPos = (self.scrollPos + 2) % self.wholeTextSize.width()
        self.update()

    def updateText(self):
        self.timer.stop()

        self.singleTextWidth = self.fontMetrics().width(self._text)
        self.scrollEnabled = (self.singleTextWidth >
                              self.width() - self.leftMargin)

        if self.scrollEnabled:
            self.scrollPos = -64
            self.staticText.setText(self._text)
            self.timer.start()
        else:
            self.staticText.setText(self._text)

        self.staticText.prepare(QTransform(), self.font())
        self.wholeTextSize = QSize(
            self.fontMetrics().width(self.staticText.text()),
            self.fontMetrics().height())

    def resizeEvent(self, event):
        #When the widget is resized, we need to update the alpha channel.
        self.alphaChannel = QImage(self.size(),
                                   QImage.Format_ARGB32_Premultiplied)
        self.buffer = QImage(self.size(), QImage.Format_ARGB32_Premultiplied)

        #Create Alpha Channel:
        if self.width() > 64:
            #create first scanline
            scanline = [0] * self.width()
            for x in range(0, 15):
                scanline[x] = scanline[self.width() - x - 1] = qRgba(
                    0, 0, 0, x << 4)
            # Background
            for x in range(15, self.width() - 15):
                scanline[x] = qRgb(0, 0, 0)
            #copy scanline to the other ones
            for y in range(0, self.height()):
                for x in range(0, self.width()):
                    self.alphaChannel.setPixel(x, y, scanline[x])
        else:
            self.alphaChannel.fill(qRgba(0, 0, 0, 0))

        #Update scrolling state
        newScrollEnabled = (self.singleTextWidth >
                            self.width() - self.leftMargin)
        if newScrollEnabled != self.scrollEnabled:
            self.updateText()
Пример #14
0
 def drawForeground(self, painter, rectf):
     super(Scene, self).drawForeground(painter, rectf)
     painter.resetTransform()
     painter.scale(1.5, 1.5)
     text = QStaticText("Workflow: " + self.workflow.name)
     painter.drawStaticText(QPoint(5,5), text)
Пример #15
0
    def paintEvent(self, event):
        if not self.fm:
            return

        # set leftmost x-coordinate of graph
        zoom_level = self.get_zoom()
        self.rect_x_width = self.get_width() * zoom_level
        self.rect_x = (self.rect().width() / 2) - (self.rect_x_width / 2)

        self.qp.begin(self)

        # what is a good default font for OSX/Linux?
        self.qp.setFont(QFont(FONT_DEFAULT))

        # fill background
        self.qp.fillRect(self.rect(), Qt.black)

        content_addr = content_size = None
        if self.fm.support_selection:
            selected, start, end = ida_kernwin.read_range_selection(None)
            if selected:
                content_addr = start  #min(start, end)
                content_size = end - start  #max(start, end) - content_addr

        # use colorfilter to render image
        img = self.render_image(addr=content_addr, buf_size=content_size)

        if img:
            """
            if zoom_level > 6:
                opacity = self.qp.opacity()
                full_opacity_zoom = 40.0
                cur_opacity = (1.0 - (full_opacity_zoom - float(min(zoom_level-1, full_opacity_zoom)))/full_opacity_zoom)
                self.qp.setOpacity(1.0-cur_opacity)
            """
            # draw image
            self.qp.drawImage(
                QRect(
                    QPoint(self.rect_x, 0),
                    QPoint(self.rect_x + self.get_width() * zoom_level,
                           (self.get_pixels_total() / self.get_width()) *
                           zoom_level)), img)

            # TODO: pen color contrast
            # TODO: data export: render data
            # TODO: default fonts / OS?
            # TODO: optimization
            # FIXME: there's a bug with gaps/unmapped buffers
            if self.render_data and not self.fm.disable_data and zoom_level > 6:
                self.qp.setPen(QColor(Qt.white))
                fontsize = self.qp.font().pointSize()
                font = self.qp.font()

                font.setPointSize(zoom_level / 3)
                self.qp.setFont(font)

                opacity = self.qp.opacity()
                full_opacity_zoom = 28
                cur_opacity = (
                    1.0 - (full_opacity_zoom -
                           float(min(zoom_level - 1, full_opacity_zoom))) /
                    full_opacity_zoom)
                self.qp.setOpacity(cur_opacity)

                m = self.qp.fontMetrics()
                x = y = 0
                num_pixels_per_row = self.get_width()

                if self.cur_formatter_idx == 0:
                    sample = "%c" % (ord('X'))
                    cwidth = m.width(sample)
                    cheight = m.height()

                    for mapped, buf in self.buffers:
                        for i in range(len(buf)):
                            if mapped:
                                b = ord(buf[i])
                                data = "%c" % (chr(b) if b in range(
                                    0x20, 0x7E) else ".")

                                self.qp.drawStaticText(
                                    self.rect_x + x * zoom_level +
                                    (zoom_level - cwidth) / 2, y * zoom_level +
                                    (zoom_level - cheight) / 2,
                                    QStaticText(data))

                            x = (i + 1) % num_pixels_per_row
                            if not x:
                                y = y + 1

                elif self.cur_formatter_idx == 1:
                    sample = "%02X" % (ord('X'))
                    cwidth = m.width(sample)
                    cheight = m.height()

                    for mapped, buf in self.buffers:
                        for i in range(len(buf)):
                            if mapped:
                                data = "%02X" % ord(buf[i])

                                self.qp.drawStaticText(
                                    self.rect_x + x * zoom_level +
                                    (zoom_level - cwidth) / 2, y * zoom_level +
                                    (zoom_level - cheight) / 2,
                                    QStaticText(data))

                            x = (i + 1) % num_pixels_per_row
                            if not x:
                                y = y + 1

                self.qp.setOpacity(opacity)
                font.setPointSize(fontsize)
                self.qp.setFont(font)

        if self.show_address_range and self.fm.link_pixel:
            self.render_slider(addr=content_addr, buf_size=content_size)

        # get and draw annotations and pointers
        annotations = self.fm.on_get_annotations(
            content_addr if content_addr else self.get_address(),
            self.get_pixels_total(), self.mouseOffs)

        if annotations:
            self.render_annotations(annotations)

        self.qp.end()
        return
Пример #16
0
 def drawLetter(self, x, y, c, let):
     self.setFont(self.font)
     self.setPen(c)
     self.drawStaticText(x, y, QStaticText(let))
Пример #17
0
 def initTextView(self):
     textView = QStaticText()
     self.text = 'TEXT'
     textView.setText(text)
Пример #18
0
    def on_frame_ready(self, frame: QImage, info, instances):
        self.process_results(instances)
        video = self.ui.video
        table = self.ui.infoTable
        origin_pixmap = QPixmap.fromImage(frame)
        painter = QPainter()
        pixmap = origin_pixmap.scaled(video.width(), video.height(),
                                      Qt.KeepAspectRatio)
        painter.begin(pixmap)
        width_scale = pixmap.width() / origin_pixmap.width()
        height_scale = pixmap.height() / origin_pixmap.height()

        def translate_bbox(bbox):
            return [
                width_scale * bbox[0], height_scale * bbox[1],
                width_scale * bbox[2], height_scale * bbox[3]
            ]

        font = painter.font()
        font.setPointSize(FONT_SIZE)
        painter.setFont(font)
        for instance in instances:
            color = instance['instance_color']
            painter.setPen(QPen(QColor(color), 4))
            bbox = translate_bbox(instance['instance_bbox'])
            painter.drawRect(bbox[0], bbox[1], bbox[2] - bbox[0],
                             bbox[3] - bbox[1])
            if instance['face'] is not None:
                painter.setPen(QPen(QColor(instance['face_color']), 2))
                bbox = translate_bbox(instance['face_bbox'])
                painter.drawRect(bbox[0], bbox[1], bbox[2] - bbox[0],
                                 bbox[3] - bbox[1])
        for instance in instances:
            bbox = translate_bbox(instance['instance_bbox'])
            attributes = {
                **instance['attributes'],
                'ID':
                instance['instance_name'] or str(instance['instance'])[:8],
            }
            height = len(attributes) * (FONT_SIZE +
                                        FONT_SPACE) + 2 * FONT_SPACE
            top = bbox[1] - height
            if instance['blacklist'] is not None:
                background_color = QColor(0xff0000)
            else:
                background_color = QColor(0xffffff)
            background_color.setAlphaF(0.5)
            painter.fillRect(bbox[0], top, 150, height, background_color)
            painter.setPen(QPen(QColor(0x0)))
            top += FONT_SPACE
            for key, value in attributes.items():
                painter.drawStaticText(bbox[0] + FONT_SPACE, top,
                                       QStaticText('%s: %s' % (key, value)))
                top += FONT_SIZE + FONT_SPACE
        for instance in instances:
            if instance['face'] is None:
                continue
            bbox = translate_bbox(instance['face_bbox'])
            attributes = {
                'ID': instance['face_name'] or str(instance['face'])[:8],
            }
            if instance['blacklist'] is not None:
                attributes['黑名单'] = instance['blacklist_name'] or str(
                    instance['blacklist'])[:8]
                background_color = QColor(0xff0000)
            else:
                background_color = QColor(0xffffff)
            height = len(attributes) * (FONT_SIZE +
                                        FONT_SPACE) + 2 * FONT_SPACE
            top = bbox[3]
            background_color.setAlphaF(0.5)
            painter.fillRect(bbox[0], top, 100, height, background_color)
            painter.setPen(QPen(QColor(0x0)))
            top += FONT_SPACE
            for key, value in attributes.items():
                painter.drawStaticText(bbox[0] + FONT_SPACE, top,
                                       QStaticText('%s: %s' % (key, value)))
                top += FONT_SIZE + FONT_SPACE
        painter.end()
        video.setPixmap(pixmap)
        table.item(VideoInfoRow.Frame,
                   1).setText(str(info[VideoInfoRow.Frame]))
        table.item(VideoInfoRow.Time,
                   1).setText('%.2f' % info[VideoInfoRow.Time])
        table.item(VideoInfoRow.Progress,
                   1).setText('%.2f' % (info[VideoInfoRow.Progress] * 100))
        time = math.floor(info[VideoInfoRow.Time] / 1000)
        if self.ui.playSlider.isEnabled():
            self.ui.playSlider.blockSignals(True)
            self.ui.playSlider.setValue(info[VideoInfoRow.Frame] - 1)
            self.ui.playSlider.blockSignals(False)
        self.ui.progressText.setText(
            '%02d:%02d/%s %d/%d' %
            (time // 60, time % 60, self.total_time_text,
             info[VideoInfoRow.Frame], self.total_frames))