• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python painter.QwtPainter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中qwt.painter.QwtPainter的典型用法代码示例。如果您正苦于以下问题:Python QwtPainter类的具体用法?Python QwtPainter怎么用?Python QwtPainter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了QwtPainter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: legendIcon

    def legendIcon(self, index, size):
        if size.isEmpty():
            return QwtGraphic()
        graphic = QwtGraphic()
        graphic.setDefaultSize(size)
        graphic.setRenderHint(QwtGraphic.RenderPensUnscaled, True)
        painter = QPainter(graphic)
        painter.setRenderHint(QPainter.Antialiasing,
                          self.testRenderHint(QwtPlotItem.RenderAntialiased))
        if self.__data.legendAttributes == 0 or\
           (self.__data.legendAttributes & QwtPlotCurve.LegendShowBrush):
            brush = self.__data.brush
            if brush.style() == Qt.NoBrush and self.__data.legendAttributes == 0:
                if self.style() != QwtPlotCurve.NoCurve:
                    brush = QBrush(self.pen().color())
                elif self.__data.symbol and\
                     self.__data.symbol.style() != QwtSymbol.NoSymbol:
                    brush = QBrush(self.__data.symbol.pen().color())
            if brush.style() != Qt.NoBrush:
                r = QRectF(0, 0, size.width(), size.height())
                painter.fillRect(r, brush)
        if self.__data.legendAttributes & QwtPlotCurve.LegendShowLine:
            if self.pen() != Qt.NoPen:
                pn = self.pen()
#                pn.setCapStyle(Qt.FlatCap)
                painter.setPen(pn)
                y = .5*size.height()
                QwtPainter.drawLine(painter, 0., y, size.width(), y)
        if self.__data.legendAttributes & QwtPlotCurve.LegendShowSymbol:
            if self.__data.symbol:
                r = QRectF(0, 0, size.width(), size.height())
                self.__data.symbol.drawSymbol(painter, r)
        return graphic    
开发者ID:petebachant,项目名称:python-qwt,代码行数:33,代码来源:plot_curve.py


示例2: renderLegend

    def renderLegend(self, painter, rect, fillBackground):
        if self.__data.itemMap.isEmpty():
            return
        if fillBackground:
            if self.autoFillBackground() or\
               self.testAttribute(Qt.WA_StyledBackground):
                QwtPainter.drawBackground(painter, rect, self)
#    const QwtDynGridLayout *legendLayout = 
#        qobject_cast<QwtDynGridLayout *>( contentsWidget()->layout() );
        #TODO: not the exact same implementation
        legendLayout = self.__data.view.contentsWidget.layout()
        if legendLayout is None:
            return
        left, right, top, bottom = self.getContentsMargins()
        layoutRect = QRect()
        layoutRect.setLeft(np.ceil(rect.left())+left)
        layoutRect.setTop(np.ceil(rect.top())+top)
        layoutRect.setRight(np.ceil(rect.right())-right)
        layoutRect.setBottom(np.ceil(rect.bottom())-bottom)
        numCols = legendLayout.columnsForWidth(layoutRect.width())
        itemRects = legendLayout.layoutItems(layoutRect, numCols)
        index = 0
        for i in range(legendLayout.count()):
            item = legendLayout.itemAt(i)
            w = item.widget()
            if w is not None:
                painter.save()
                painter.setClipRect(itemRects[index], Qt.IntersectClip)
                self.renderItem(painter, w, itemRects[index], fillBackground)
                index += 1
                painter.restore()
开发者ID:petebachant,项目名称:python-qwt,代码行数:31,代码来源:legend.py


示例3: draw

 def draw(self, painter, rect):
     if self.__data.paintAttributes & self.PaintBackground:
         if self.__data.borderPen != Qt.NoPen or\
            self.__data.backgroundBrush != Qt.NoBrush:
             painter.save()
             painter.setPen(self.__data.borderPen)
             painter.setBrush(self.__data.backgroundBrush)
             if self.__data.borderRadius == 0:
                 QwtPainter.drawRect(painter, rect)
             else:
                 painter.setRenderHint(QPainter.Antialiasing, True)
                 painter.drawRoundedRect(rect, self.__data.borderRadius,
                                         self.__data.borderRadius)
             painter.restore()
     painter.save()
     if self.__data.paintAttributes & self.PaintUsingTextFont:
         painter.setFont(self.__data.font)
     if self.__data.paintAttributes & self.PaintUsingTextColor:
         if self.__data.color.isValid():
             painter.setPen(self.__data.color)
     expandedRect = rect
     if self.__data.layoutAttributes & self.MinimumLayout:
         font = QFont(painter.font(), self.desktopwidget)
         (left, right, top, bottom
          ) = self.__data.textEngine.textMargins(font)
         expandedRect.setTop(rect.top()-top)
         expandedRect.setBottom(rect.bottom()+bottom)
         expandedRect.setLeft(rect.left()-left)
         expandedRect.setRight(rect.right()+right)
     self.__data.textEngine.draw(painter, expandedRect,
                                 self.__data.renderFlags, self.__data.text)
     painter.restore()
开发者ID:petebachant,项目名称:python-qwt,代码行数:32,代码来源:text.py


示例4: drawLines

 def drawLines(self, painter, canvasRect, pos):
     """
     Draw the lines marker
     
     :param QPainter painter: Painter
     :param QRectF canvasRect: Contents rectangle of the canvas in painter coordinates
     :param QPointF pos: Position of the marker, translated into widget coordinates
     
     .. seealso::
     
         :py:meth:`drawLabel()`, 
         :py:meth:`qwt.symbol.QwtSymbol.drawSymbol()`
     """
     if self.__data.style == self.NoLine:
         return
     doAlign = QwtPainter.roundingAlignment(painter)
     painter.setPen(self.__data.pen)
     if self.__data.style in (QwtPlotMarker.HLine, QwtPlotMarker.Cross):
         y = pos.y()
         if doAlign:
             y = round(y)
         QwtPainter.drawLine(painter, canvasRect.left(),
                               y, canvasRect.right()-1., y)
     if self.__data.style in (QwtPlotMarker.VLine, QwtPlotMarker.Cross):
         x = pos.x()
         if doAlign:
             x = round(x)
         QwtPainter.drawLine(painter, x,
                               canvasRect.top(), x, canvasRect.bottom()-1.)
开发者ID:gyenney,项目名称:Tools,代码行数:29,代码来源:plot_marker.py


示例5: qwtDrawTriangleSymbols

def qwtDrawTriangleSymbols(painter, type, points, numPoint, symbol):
    size =symbol.size()
    pen = QPen(symbol.pen())
    pen.setJoinStyle(Qt.MiterJoin)
    painter.setPen(pen)
    painter.setBrush(symbol.brush())
    doAlign = QwtPainter.roundingAlignment(painter)
    sw2 = .5*size.width()
    sh2 = .5*size.height()
    if doAlign:
        sw2 = np.floor(sw2)
        sh2 = np.floor(sh2)
    for pos in points:
        x = pos.x()
        y = pos.y()
        if doAlign:
            x = round(x)
            y = round(y)
        x1 = x-sw2
        x2 = x1+size.width()
        y1 = y-sh2
        y2 = y1+size.height()
        if type == QwtTriangle.Left:
            triangle = [QPointF(x2, y1), QPointF(x1, y), QPointF(x2, y2)]
        elif type == QwtTriangle.Right:
            triangle = [QPointF(x1, y1), QPointF(x2, y), QPointF(x1, y2)]
        elif type == QwtTriangle.Up:
            triangle = [QPointF(x1, y2), QPointF(x, y1), QPointF(x2, y2)]
        elif type == QwtTriangle.Down:
            triangle = [QPointF(x1, y1), QPointF(x, y2), QPointF(x2, y1)]
        QwtPainter.drawPolygon(painter, QPolygonF(triangle))
开发者ID:gyenney,项目名称:Tools,代码行数:31,代码来源:symbol.py


示例6: qwtDrawRectSymbols

def qwtDrawRectSymbols(painter, points, numPoints, symbol):
    size = symbol.size()
    pen = QPen(symbol.pen())
    pen.setJoinStyle(Qt.MiterJoin)
    painter.setPen(pen)
    painter.setBrush(symbol.brush())
    painter.setRenderHint(QPainter.Antialiasing, False)
    if QwtPainter.roundingAlignment(painter):
        sw = size.width()
        sh = size.height()
        sw2 = size.width()//2
        sh2 = size.height()//2
        for pos in points:
            x = round(pos.x())
            y = round(pos.y())
            r = QRectF(x-sw2, y-sh2, sw, sh)
            QwtPainter.drawRect(painter, r)
    else:
        sw = size.width()
        sh = size.height()
        sw2 = .5*size.width()
        sh2 = .5*size.height()
        for pos in points:
            x = pos.x()
            y = pos.y()
            r = QRectF(x-sw2, y-sh2, sw, sh)
            QwtPainter.drawRect(painter, r)
开发者ID:gyenney,项目名称:Tools,代码行数:27,代码来源:symbol.py


示例7: renderItem

    def renderItem(self, painter, widget, rect, fillBackground):
        """
        Render a legend entry into a given rectangle.

        :param QPainter painter: Painter
        :param QWidget widget: Widget representing a legend entry
        :param QRectF rect: Bounding rectangle
        :param bool fillBackground: When true, fill rect with the widget background
        """
        if fillBackground:
            if widget.autoFillBackground() or\
               widget.testAttribute(Qt.WA_StyledBackground):
                QwtPainter.drawBackground(painter, rect, widget)
        label = widget  #TODO: cast to QwtLegendLabel
        if label is not None:
            icon = label.data().icon()
            sz = icon.defaultSize()
            iconRect = QRectF(rect.x()+label.margin(),
                              rect.center().y()-.5*sz.height(),
                              sz.width(), sz.height())
            icon.render(painter, iconRect, Qt.KeepAspectRatio)
            titleRect = QRectF(rect)
            titleRect.setX(iconRect.right()+2*label.spacing())
            painter.setFont(label.font())
            painter.setPen(label.palette().color(QPalette.Text))
            label.drawText(painter, titleRect)  #TODO: cast label to QwtLegendLabel
开发者ID:gyenney,项目名称:Tools,代码行数:26,代码来源:legend.py


示例8: qwtDrawDiamondSymbols

def qwtDrawDiamondSymbols(painter, points, numPoints, symbol):
    size =symbol.size()
    pen = QPen(symbol.pen())
    pen.setJoinStyle(Qt.MiterJoin)
    painter.setPen(pen)
    painter.setBrush(symbol.brush())
    if QwtPainter.roundingAlignment(painter):
        for pos in points:
            x = round(pos.x())
            y = round(pos.y())
            x1 = x-size.width()//2
            y1 = y-size.height()//2
            x2 = x1+size.width()
            y2 = y1+size.height()
            polygon = QPolygonF()
            polygon += QPointF(x, y1)
            polygon += QPointF(x1, y)
            polygon += QPointF(x, y2)
            polygon += QPointF(x2, y)
            QwtPainter.drawPolygon(painter, polygon)
    else:
        for pos in points:
            x1 = pos.x()-.5*size.width()
            y1 = pos.y()-.5*size.height()
            x2 = x1+size.width()
            y2 = y1+size.height()
            polygon = QPolygonF()
            polygon += QPointF(pos.x(), y1)
            polygon += QPointF(x1, pos.y())
            polygon += QPointF(pos.x(), y2)
            polygon += QPointF(x2, pos.y())
            QwtPainter.drawPolygon(painter, polygon)
开发者ID:gyenney,项目名称:Tools,代码行数:32,代码来源:symbol.py


示例9: qwtDrawHexagonSymbols

def qwtDrawHexagonSymbols(painter, points, numPoints, symbol):
    painter.setBrush(symbol.brush())
    painter.setPen(symbol.pen())
    cos30 = np.cos(30*np.pi/180.)
    dx = .5*(symbol.size().width()-cos30)
    dy = .25*symbol.size().height()
    doAlign = QwtPainter.roundingAlignment(painter)
    for pos in points:
        if doAlign:
            x = round(pos.x())
            y = round(pos.y())
            x1 = np.ceil(x-dx)
            y1 = np.ceil(y-2*dy)
        else:
            x = pos.x()
            y = pos.y()
            x1 = x-dx
            y1 = y-2*dy
        x2 = x1+1*dx
        x3 = x1+2*dx
        y2 = y1+1*dy
        y3 = y1+3*dy
        y4 = y1+4*dy
        hexa = [QPointF(x2, y1), QPointF(x3, y2), QPointF(x3, y3),
                QPointF(x2, y4), QPointF(x1, y3), QPointF(x1, y2)]
        QwtPainter.drawPolygon(painter, QPolygonF(hexa))
开发者ID:gyenney,项目名称:Tools,代码行数:26,代码来源:symbol.py


示例10: fillCurve

    def fillCurve(self, painter, xMap, yMap, canvasRect, polygon):
        """
        Fill the area between the curve and the baseline with
        the curve brush

        :param QPainter painter: Painter
        :param qwt.scale_map.QwtScaleMap xMap: Maps x-values into pixel coordinates.
        :param qwt.scale_map.QwtScaleMap yMap: Maps y-values into pixel coordinates.
        :param QRectF canvasRect: Contents rectangle of the canvas
        :param QPolygonF polygon: Polygon - will be modified !
        
        .. seealso::
        
            :py:meth:`setBrush()`, :py:meth:`setBaseline()`, 
            :py:meth:`setStyle()`
        """
        if self.__data.brush.style() == Qt.NoBrush:
            return
        self.closePolyline(painter, xMap, yMap, polygon)
        if polygon.count() <= 2:
            return
        brush = self.__data.brush
        if not brush.color().isValid():
            brush.setColor(self.__data.pen.color())
        if self.__data.paintAttributes & self.ClipPolygons:
            polygon = QwtClipper().clipPolygonF(canvasRect, polygon, True)
        painter.save()
        painter.setPen(Qt.NoPen)
        painter.setBrush(brush)
        QwtPainter.drawPolygon(painter, polygon)
        painter.restore()
开发者ID:gyenney,项目名称:Tools,代码行数:31,代码来源:plot_curve.py


示例11: drawColorBar

 def drawColorBar(self, painter, rect):
     if not self.__data.colorBar.interval.isValid():
         return
     sd = self.__data.scaleDraw
     QwtPainter.drawColorBar(painter, self.__data.colorBar.colorMap,
                               self.__data.colorBar.interval.normalized(),
                               sd.scaleMap(), sd.orientation(), rect)
开发者ID:petebachant,项目名称:python-qwt,代码行数:7,代码来源:scale_widget.py


示例12: legendIcon

 def legendIcon(self, index, size):
     """
     :param int index: Index of the legend entry (ignored as there is only one)
     :param QSizeF size: Icon size
     :return: Icon representing the marker on the legend
     
     .. seealso::
     
         :py:meth:`qwt.plot.QwtPlotItem.setLegendIconSize()`,
         :py:meth:`qwt.plot.QwtPlotItem.legendData()`
     """
     if size.isEmpty():
         return QwtGraphic()
     icon = QwtGraphic()
     icon.setDefaultSize(size)
     icon.setRenderHint(QwtGraphic.RenderPensUnscaled, True)
     painter = QPainter(icon)
     painter.setRenderHint(QPainter.Antialiasing,
                       self.testRenderHint(QwtPlotItem.RenderAntialiased))
     if self.__data.style != QwtPlotMarker.NoLine:
         painter.setPen(self.__data.pen)
         if self.__data.style in (QwtPlotMarker.HLine, QwtPlotMarker.Cross):
             y = .5*size.height()
             QwtPainter.drawLine(painter, 0., y, size.width(), y)
         if self.__data.style in (QwtPlotMarker.VLine, QwtPlotMarker.Cross):
             x = .5*size.width()
             QwtPainter.drawLine(painter, x, 0., x, size.height())
     if self.__data.symbol:
         r = QRect(0, 0, size.width(), size.height())
         self.__data.symbol.drawSymbol(painter, r)
     return icon
开发者ID:gyenney,项目名称:Tools,代码行数:31,代码来源:plot_marker.py


示例13: drawBorder

 def drawBorder(self, painter):
     if self.__data.borderRadius > 0:
         if self.frameWidth() > 0:
             QwtPainter.drawRoundedFrame(painter, QRectF(self.frameRect()),
                     self.__data.borderRadius, self.__data.borderRadius,
                     self.palette(), self.frameWidth(), self.frameStyle())
     else:
         if QT_VERSION >= 0x040500:
             if PYQT5:
                 from qwt.qt.QtGui import QStyleOptionFrame
             else:
                 from qwt.qt.QtGui import QStyleOptionFrameV3 as\
                                          QStyleOptionFrame
             opt = QStyleOptionFrame()
             opt.initFrom(self)
             frameShape = self.frameStyle() & QFrame.Shape_Mask
             frameShadow = self.frameStyle() & QFrame.Shadow_Mask
             opt.frameShape = QFrame.Shape(int(opt.frameShape)|frameShape)
             if frameShape in (QFrame.Box, QFrame.HLine, QFrame.VLine,
                               QFrame.StyledPanel, QFrame.Panel):
                 opt.lineWidth = self.lineWidth()
                 opt.midLineWidth = self.midLineWidth()
             else:
                 opt.lineWidth = self.frameWidth()
             if frameShadow == self.Sunken:
                 opt.state |= QStyle.State_Sunken
             elif frameShadow == self.Raised:
                 opt.state |= QStyle.State_Raised
             self.style().drawControl(QStyle.CE_ShapedFrame, opt, painter, self)
         else:
             self.drawFrame(painter)
开发者ID:petebachant,项目名称:python-qwt,代码行数:31,代码来源:plot_canvas.py


示例14: drawSteps

 def drawSteps(self, painter, xMap, yMap, canvasRect, from_, to):
     doAlign = QwtPainter.roundingAlignment(painter)
     polygon = QPolygonF(2*(to-from_)+1)
     inverted = self.orientation() == Qt.Vertical
     if self.__data.attributes & self.Inverted:
         inverted = not inverted
     series = self.data()
     ip = 0
     for i in range(from_, to+1):
         sample = series.sample(i)
         xi = xMap.transform(sample.x())
         yi = yMap.transform(sample.y())
         if doAlign:
             xi = round(xi)
             yi = round(yi)
         if ip > 0:
             p0 = polygon[ip-2]
             if inverted:
                 polygon[ip-1] = QPointF(p0.x(), yi)
             else:
                 polygon[ip-1] = QPointF(xi, p0.y())
         polygon[ip] = QPointF(xi, yi)
         ip += 2
     if self.__data.paintAttributes & self.ClipPolygons:
         clipped = QwtClipper().clipPolygonF(canvasRect, polygon, False)
         QwtPainter.drawPolyline(painter, clipped)
     else:
         QwtPainter.drawPolyline(painter, polygon)
     if self.__data.brush.style() != Qt.NoBrush:
         self.fillCurve(painter, xMap, yMap, canvasRect, polygon)
开发者ID:petebachant,项目名称:python-qwt,代码行数:30,代码来源:plot_curve.py


示例15: draw

    def draw(self, painter, rect, flags, text):
        """
        Draw the text in a clipping rectangle

        :param QPainter painter: Painter
        :param QRectF rect: Clipping rectangle
        :param int flags: Bitwise OR of the flags like in for QPainter::drawText()
        :param str text: Text to be rendered
        """
        QwtPainter.drawText(painter, rect, flags, text)
开发者ID:gyenney,项目名称:Tools,代码行数:10,代码来源:text_engine.py


示例16: drawBackbone

 def drawBackbone(self, painter):
     doAlign = QwtPainter.roundingAlignment(painter)
     pos = self.__data.pos
     len_ = self.__data.len
     pw = max([self.penWidth(), 1])
     
     if doAlign:
         if self.alignment() in (self.LeftScale, self.TopScale):
             off = (pw-1)/2
         else:
             off = pw/2
     else:
         off = .5*self.penWidth()
         
     if self.alignment() == self.LeftScale:
         x = pos.x() - off
         if doAlign:
             x = round(x)
         QwtPainter.drawLine(painter, x, pos.y(), x, pos.y()+len_)
     elif self.alignment() == self.RightScale:
         x = pos.x() + off
         if doAlign:
             x = round(x)
         QwtPainter.drawLine(painter, x, pos.y(), x, pos.y()+len_)
     elif self.alignment() == self.TopScale:
         y = pos.y() - off
         if doAlign:
             y = round(y)
         QwtPainter.drawLine(painter, pos.x(), y, pos.x()+len_, y)
     elif self.alignment() == self.BottomScale:
         y = pos.y() + off
         if doAlign:
             y = round(y)
         QwtPainter.drawLine(painter, pos.x(), y, pos.x()+len_, y)
开发者ID:petebachant,项目名称:python-qwt,代码行数:34,代码来源:scale_draw.py


示例17: qwtDrawXCrossSymbols

def qwtDrawXCrossSymbols(painter, points, numPoints, symbol):
    size =symbol.size()
    off = 0
    pen = QPen(symbol.pen())
    if pen.width() > 1:
        pen.setCapStyle(Qt.FlatCap)
        off = 1
    painter.setPen(pen)
    if QwtPainter.roundingAlignment(painter):
        sw = np.floor(size.width())
        sh = np.floor(size.height())
        sw2 = size.width()//2
        sh2 = size.height()//2
        for pos in points:
            x = round(pos.x())
            y = round(pos.y())
            x1 = x-sw2
            x2 = x1+sw+off
            y1 = y-sh2
            y2 = y1+sh+off
            QwtPainter.drawLine(painter, x1, y1, x2, y2)
            QwtPainter.drawLine(painter, x2, y1, x1, y2)
    else:
        sw = size.width()
        sh = size.height()
        sw2 = .5*size.width()
        sh2 = .5*size.height()
        for pos in points:
            x1 = pos.x()-sw2
            x2 = x1+sw
            y1 = pos.y()-sh2
            y2 = y1+sh
            QwtPainter.drawLine(painter, x1, y1, x2, y2)
            QwtPainter.drawLine(painter, x2, y1, x1, y2)
开发者ID:gyenney,项目名称:Tools,代码行数:34,代码来源:symbol.py


示例18: drawFocusIndicator

 def drawFocusIndicator(self, painter):
     """
     Draw the focus indication
     
     :param QPainter painter: Painter
     """
     margin = 1
     focusRect = self.contentsRect()
     focusRect.setRect(focusRect.x()+margin, focusRect.y()+margin,
                       focusRect.width()-2*margin, focusRect.height()-2*margin)
     QwtPainter.drawFocusRect(painter, self, focusRect)
开发者ID:berrosse,项目名称:PythonQwt,代码行数:11,代码来源:plot_canvas.py


示例19: drawContents

 def drawContents(self, painter):
     r = self.textRect()
     if r.isEmpty():
         return
     painter.setFont(self.font())
     painter.setPen(self.palette().color(QPalette.Active, QPalette.Text))
     self.drawText(painter, QRectF(r))
     if self.hasFocus():
         m = 2
         focusRect = self.contentsRect().adjusted(m, m, -m+1, -m+1)
         QwtPainter.drawFocusRect(painter, self, focusRect)
开发者ID:petebachant,项目名称:python-qwt,代码行数:11,代码来源:text.py


示例20: paintEvent

    def paintEvent(self, event):
        painter = QPainter(self)
        painter.setClipRegion(event.region())
        if self.testPaintAttribute(self.BackingStore) and\
           self.__data.backingStore is not None:
            bs = self.__data.backingStore
            if bs.size() != self.size():
                bs = QwtPainter.backingStore(self, self.size())
                if self.testAttribute(Qt.WA_StyledBackground):
                    p = QPainter(bs)
                    qwtFillBackground(p, self)
                    self.drawCanvas(p, True)
                else:
                    p = QPainter()
                    if self.__data.borderRadius <= 0.:
#                        print('**DEBUG: QwtPlotCanvas.paintEvent')
                        QwtPainter.fillPixmap(self, bs)
                        p.begin(bs)
                        self.drawCanvas(p, False)
                    else:
                        p.begin(bs)
                        qwtFillBackground(p, self)
                        self.drawCanvas(p, True)
                    if self.frameWidth() > 0:
                        self.drawBorder(p)
                    p.end()
            painter.drawPixmap(0, 0, self.__data.backingStore)
        else:
            if self.testAttribute(Qt.WA_StyledBackground):
                if self.testAttribute(Qt.WA_OpaquePaintEvent):
                    qwtFillBackground(painter, self)
                    self.drawCanvas(painter, True)
                else:
                    self.drawCanvas(painter, False)
            else:
                if self.testAttribute(Qt.WA_OpaquePaintEvent):
                    if self.autoFillBackground():
                        qwtFillBackground(painter, self)
                        qwtDrawBackground(painter, self)
                else:
                    if self.borderRadius() > 0.:
                        clipPath = QPainterPath()
                        clipPath.addRect(self.rect())
                        clipPath = clipPath.subtracted(self.borderPath(self.rect()))
                        painter.save()
                        painter.setClipPath(clipPath, Qt.IntersectClip)
                        qwtFillBackground(painter, self)
                        qwtDrawBackground(painter, self)
                        painter.restore()
                self.drawCanvas(painter, False)
                if self.frameWidth() > 0:
                    self.drawBorder(painter)
        if self.hasFocus() and self.focusIndicator() == self.CanvasFocusIndicator:
            self.drawFocusIndicator(painter)
开发者ID:petebachant,项目名称:python-qwt,代码行数:54,代码来源:plot_canvas.py



注:本文中的qwt.painter.QwtPainter类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python QtCore.QRectF类代码示例发布时间:2022-05-26
下一篇:
Python qwt.QwtPlotCurve类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap