本文整理匯總了Python中qwt.qt.QtCore.QRectF.contains方法的典型用法代碼示例。如果您正苦於以下問題:Python QRectF.contains方法的具體用法?Python QRectF.contains怎麽用?Python QRectF.contains使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類qwt.qt.QtCore.QRectF
的用法示例。
在下文中一共展示了QRectF.contains方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: draw
# 需要導入模塊: from qwt.qt.QtCore import QRectF [as 別名]
# 或者: from qwt.qt.QtCore.QRectF import contains [as 別名]
def draw(self, painter, xMap, yMap, canvasRect):
pos = QPointF(xMap.transform(self.__data.xValue),
yMap.transform(self.__data.yValue))
self.drawLines(painter, canvasRect, pos)
if self.__data.symbol and\
self.__data.symbol.style() != QwtSymbol.NoSymbol:
sz = self.__data.symbol.size()
clipRect = QRectF(canvasRect.adjusted(-sz.width(), -sz.height(),
sz.width(), sz.height()))
if clipRect.contains(pos):
self.__data.symbol.drawSymbols(painter, [pos])
self.drawLabel(painter, canvasRect, pos)
示例2: draw
# 需要導入模塊: from qwt.qt.QtCore import QRectF [as 別名]
# 或者: from qwt.qt.QtCore.QRectF import contains [as 別名]
def draw(self, painter, xMap, yMap, canvasRect):
"""
Draw the marker
:param QPainter painter: Painter
:param qwt.scale_map.QwtScaleMap xMap: x Scale Map
:param qwt.scale_map.QwtScaleMap yMap: y Scale Map
:param QRectF canvasRect: Contents rectangle of the canvas in painter coordinates
"""
pos = QPointF(xMap.transform(self.__data.xValue),
yMap.transform(self.__data.yValue))
self.drawLines(painter, canvasRect, pos)
if self.__data.symbol and\
self.__data.symbol.style() != QwtSymbol.NoSymbol:
sz = self.__data.symbol.size()
clipRect = QRectF(canvasRect.adjusted(-sz.width(), -sz.height(),
sz.width(), sz.height()))
if clipRect.contains(pos):
self.__data.symbol.drawSymbols(painter, [pos])
self.drawLabel(painter, canvasRect, pos)