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

All Samples(31)  |  Call(31)  |  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/widgets/wiggly.py   pyqt5(Download)
    def paintEvent(self, event):
        sineTable = (0, 38, 71, 92, 100, 92, 71, 38, 0, -38, -71, -92, -100, -92, -71, -38)
 
        metrics = QFontMetrics(self.font())
        x = (self.width() - metrics.width(self.text)) / 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
        else:
            x = (self.width() / len(self.shapeItems) - 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/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))
        maxRect = fm.boundingRect(QRectF(self.rect()), Qt.AlignCenter,
                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/threads/mandelbrot.py   pyqt5(Download)
        painter.setPen(Qt.NoPen)
        painter.setBrush(QColor(0, 0, 0, 127))
        painter.drawRect((self.width() - textWidth) / 2 - 5, 0, textWidth + 10,
                metrics.lineSpacing() + 5)
        painter.setPen(Qt.white)
        painter.drawText((self.width() - textWidth) / 2,
            self.lastDragPos = QPoint()
 
            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/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/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/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(),
                    QColor.fromRgb(0, 0, 0))
            return
 
        barWidth = self.width() / float(len(self.m_histogram))

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