Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(30)  |  Call(30)  |  Derive(0)  |  Import(0)

src/p/y/pyqt5-HEAD/examples/widgets/shapedclock.py   pyqt5(Download)
    def paintEvent(self, event):
        side = min(self.width(), self.height())
        time = QTime.currentTime()
 
        painter = QPainter(self)
        painter.setRenderHint(QPainter.Antialiasing)
        painter.translate(self.width() / 2, self.height() / 2)
    def resizeEvent(self, event):
        side = min(self.width(), self.height())
 
        maskedRegion = QRegion(self.width()/2 - side/2, self.height()/2 - side/2, side, side, QRegion.Ellipse)
        self.setMask(maskedRegion)

src/p/y/pyqt5-HEAD/examples/multimediawidgets/player.py   pyqt5(Download)
    def paintEvent(self, event):
        painter = QPainter(self)
 
        if len(self.m_histogram) == 0:
            painter.fillRect(0, 0, self.width(), self.height(),
 
        for i, value in enumerate(self.m_histogram):
            h = value * self.height()
            # Draw the level.
            painter.fillRect(barWidth * i, self.height() - h,
                    barWidth * (i + 1), self.height(), Qt.red)
            # Clear the rest of the control.
            painter.fillRect(barWidth * i, 0, barWidth * (i + 1),
                    self.height() - h, Qt.black)

src/p/y/pyqt5-HEAD/examples/widgets/wiggly.py   pyqt5(Download)
        metrics = QFontMetrics(self.font())
        x = (self.width() - metrics.width(self.text)) / 2
        y = (self.height() + metrics.ascent() - metrics.descent()) / 2
        color = QColor()
 

src/p/y/pyqt5-HEAD/examples/designer/plugins/widgets/counterlabel.py   pyqt5(Download)
        p.setRenderHint(QPainter.Antialiasing)
        p.setFont(self._font)
        p.translate(self.width()/2.0, self.height()/2.0)
        p.scale(self._scale, self._scale)
        p.drawText(self._xpos, self._ypos, str(self._value))
                str(self._maximum))
        xscale = float(self.width())/maxRect.width()
        yscale = float(self.height())/maxRect.height()
        self._scale = min(xscale, yscale)
 

src/p/y/pyqt5-HEAD/examples/designer/plugins/widgets/analogclock.py   pyqt5(Download)
    def paintEvent(self, event):
 
        side = min(self.width(), self.height())
        time = QTime.currentTime()
        time = time.addSecs(self.timeZoneOffset * 3600)
 
        painter = QPainter()
        painter.begin(self)
        painter.setRenderHint(QPainter.Antialiasing)
        painter.translate(self.width() / 2, self.height() / 2)

src/p/y/pyqt5-HEAD/examples/widgets/tooltips/tooltips.py   pyqt5(Download)
    def resizeEvent(self, event):
        margin = self.style().pixelMetric(QStyle.PM_DefaultTopLevelMargin)
        x = self.width() - margin
        y = self.height() - margin
 
    def initialItemPosition(self, path):
        y = (self.height() - path.controlPointRect().height()) / 2
 
        if len(self.shapeItems) == 0:
            x = ((3 * self.width()) / 2 - path.controlPointRect().width()) / 2
    def randomItemPosition(self):
        x = random.randint(0, self.width() - 120)
        y = random.randint(0, self.height() - 120)
 
        return QPoint(x, y)

src/p/y/pyqt5-HEAD/examples/network/lightmaps.py   pyqt5(Download)
    def resizeEvent(self, event):
        self._normalMap.width = self.width()
        self._normalMap.height = self.height()
        self._normalMap.invalidate()
        self._largeMap.width = self._normalMap.width * 2
 
        if self.zoomed:
            dim = min(self.width(), self.height())
            magnifierSize = min(MAX_MAGNIFIER, dim * 2 / 3)
            radius = magnifierSize / 2
                self._normalMap.pan(QPoint(0, -20))
            if event.key() == Qt.Key_Z or event.key() == Qt.Key_Select:
                self.dragPos = QPoint(self.width() / 2, self.height() / 2)
                self.activateZoom()
        else:

src/p/y/pyqt5-HEAD/examples/threads/mandelbrot.py   pyqt5(Download)
 
            deltaX = (self.width() - self.pixmap.width()) / 2 - self.pixmapOffset.x()
            deltaY = (self.height() - self.pixmap.height()) / 2 - self.pixmapOffset.y()
            self.scroll(deltaX, deltaY)
 

src/p/y/pyqt5-HEAD/examples/widgets/analogclock.py   pyqt5(Download)
    def paintEvent(self, event):
        side = min(self.width(), self.height())
        time = QTime.currentTime()
 
        painter = QPainter(self)
        painter.setRenderHint(QPainter.Antialiasing)
        painter.translate(self.width() / 2, self.height() / 2)

src/p/y/pyqt5-HEAD/examples/widgets/scribble.py   pyqt5(Download)
    def resizeEvent(self, event):
        if self.width() > self.image.width() or self.height() > self.image.height():
            newWidth = max(self.width() + 128, self.image.width())
            newHeight = max(self.height() + 128, self.image.height())
            self.resizeImage(self.image, QSize(newWidth, newHeight))

  1 | 2  Next