当前位置: 首页>>代码示例>>Python>>正文


Python QtCore.QRectF方法代码示例

本文整理汇总了Python中pyqtgraph.Qt.QtCore.QRectF方法的典型用法代码示例。如果您正苦于以下问题:Python QtCore.QRectF方法的具体用法?Python QtCore.QRectF怎么用?Python QtCore.QRectF使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyqtgraph.Qt.QtCore的用法示例。


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

示例1: run

# 需要导入模块: from pyqtgraph.Qt import QtCore [as 别名]
# 或者: from pyqtgraph.Qt.QtCore import QRectF [as 别名]
def run(self):
        app = QtGui.QApplication([])
        ## Create window with GraphicsView widget
        win = pg.GraphicsLayoutWidget()
        win.show()  ## show widget alone in its own window
        win.setWindowTitle('pyqtgraph example: ImageItem')
        view = win.addViewBox()

        ## lock the aspect ratio so pixels are always square
        view.setAspectLocked(True)

        ## Create image item
        self.img = pg.ImageItem(border='w')
        view.addItem(self.img)

        ## Set initial view bounds
        view.setRange(QtCore.QRectF(0, 0, 2*self.image_hw, self.image_hw))

        timer = QtCore.QTimer()
        timer.timeout.connect(self._update)
        timer.start(50)

        app.exec_() 
开发者ID:udacity,项目名称:RoboND-DeepLearning-Project,代码行数:25,代码来源:visualization.py

示例2: newColorbar

# 需要导入模块: from pyqtgraph.Qt import QtCore [as 别名]
# 或者: from pyqtgraph.Qt.QtCore import QRectF [as 别名]
def newColorbar(view, left, top, impixpervoxx, impixpervoxy, imgsize):
    cb_xdim = imgsize // 10
    cb_ydim = imgsize
    theviewbox = pg.ViewBox(enableMouse=False)
    theviewbox.setRange(QtCore.QRectF(0, 0, cb_xdim, cb_ydim),
                        xRange=(0, cb_xdim - 1), yRange=(0, cb_ydim - 1), padding=0.0,
                        disableAutoRange=True)
    theviewbox.setAspectLocked()

    thecolorbarwin = pg.ImageItem()
    theviewbox.addItem(thecolorbarwin)
    thecolorbarwin.translate(left, top)
    thecolorbarwin.scale(impixpervoxx, impixpervoxy)

    colorbarvals = np.zeros((cb_xdim, cb_ydim), dtype=np.float64)
    for i in range(0, cb_ydim):
        colorbarvals[:, i] = i * (1.0 / (cb_ydim - 1.0))
    thecolorbarwin.setImage(colorbarvals, levels=[0.0, 1.0])
    return thecolorbarwin, theviewbox 
开发者ID:bbfrederick,项目名称:rapidtide,代码行数:21,代码来源:OrthoImageItem.py

示例3: boundingRect

# 需要导入模块: from pyqtgraph.Qt import QtCore [as 别名]
# 或者: from pyqtgraph.Qt.QtCore import QRectF [as 别名]
def boundingRect(self):
        return QtCore.QRectF() 
开发者ID:SrikanthVelpuri,项目名称:tf-pose,代码行数:4,代码来源:pyoptic.py

示例4: mkPath

# 需要导入模块: from pyqtgraph.Qt import QtCore [as 别名]
# 或者: from pyqtgraph.Qt.QtCore import QRectF [as 别名]
def mkPath(self):
        self.prepareGeometryChange()
        r = self.r
        d = self.d
        h2 = d/2.
        self.path = QtGui.QPainterPath()
        if r == 0:  ## flat surface
            self.path.moveTo(0, h2)
            self.path.lineTo(0, -h2)
        else:
            ## half-height of surface can't be larger than radius
            h2 = min(h2, abs(r))
            
            #dx = abs(r) - (abs(r)**2 - abs(h2)**2)**0.5
            #p.moveTo(-d*w/2.+ d*dx, d*h2)
            arc = QtCore.QRectF(0, -r, r*2, r*2)
            #self.surfaces.append((arc.center(), r, h2))
            a1 = np.arcsin(h2/r) * 180. / np.pi
            a2 = -2*a1
            a1 += 180.
            self.path.arcMoveTo(arc, a1)
            self.path.arcTo(arc, a1, a2)
            #if d == -1:
                #p1 = QtGui.QPainterPath()
                #p1.addRect(arc)
                #self.paths.append(p1)
        self.h2 = h2 
开发者ID:SrikanthVelpuri,项目名称:tf-pose,代码行数:29,代码来源:pyoptic.py

示例5: boundingRect

# 需要导入模块: from pyqtgraph.Qt import QtCore [as 别名]
# 或者: from pyqtgraph.Qt.QtCore import QRectF [as 别名]
def boundingRect(self):
        return QtCore.QRectF(0, 0, 20, 20) 
开发者ID:SrikanthVelpuri,项目名称:tf-pose,代码行数:4,代码来源:GraphicsScene.py

示例6: __init__

# 需要导入模块: from pyqtgraph.Qt import QtCore [as 别名]
# 或者: from pyqtgraph.Qt.QtCore import QRectF [as 别名]
def __init__(self, clock):
        pg.ItemGroup.__init__(self)
        self.size = clock.size
        self.item = QtGui.QGraphicsEllipseItem(QtCore.QRectF(0, 0, self.size, self.size))
        self.item.translate(-self.size*0.5, -self.size*0.5)
        self.item.setPen(pg.mkPen(100,100,100))
        self.item.setBrush(clock.brush)
        self.hand = QtGui.QGraphicsLineItem(0, 0, 0, self.size*0.5)
        self.hand.setPen(pg.mkPen('w'))
        self.hand.setZValue(10)
        self.flare = QtGui.QGraphicsPolygonItem(QtGui.QPolygonF([
            QtCore.QPointF(0, -self.size*0.25),
            QtCore.QPointF(0, self.size*0.25),
            QtCore.QPointF(self.size*1.5, 0),
            QtCore.QPointF(0, -self.size*0.25),
            ]))
        self.flare.setPen(pg.mkPen('y'))
        self.flare.setBrush(pg.mkBrush(255,150,0))
        self.flare.setZValue(-10)
        self.addItem(self.hand)
        self.addItem(self.item)
        self.addItem(self.flare)
 
        self.clock = clock
        self.i = 1
        
        self._spaceline = None 
开发者ID:SrikanthVelpuri,项目名称:tf-pose,代码行数:29,代码来源:relativity.py

示例7: boundingRect

# 需要导入模块: from pyqtgraph.Qt import QtCore [as 别名]
# 或者: from pyqtgraph.Qt.QtCore import QRectF [as 别名]
def boundingRect(self):
        return QtCore.QRectF(0, 0, 10, 10) 
开发者ID:SrikanthVelpuri,项目名称:tf-pose,代码行数:4,代码来源:contextMenu.py

示例8: __init__

# 需要导入模块: from pyqtgraph.Qt import QtCore [as 别名]
# 或者: from pyqtgraph.Qt.QtCore import QRectF [as 别名]
def __init__(self, parent=None):
        super(App, self).__init__(parent)

        #### Create Gui Elements ###########
        self.mainbox = QtGui.QWidget()
        self.setCentralWidget(self.mainbox)
        self.mainbox.setLayout(QtGui.QVBoxLayout())

        self.canvas = pg.GraphicsLayoutWidget()
        self.mainbox.layout().addWidget(self.canvas)

        self.label = QtGui.QLabel()
        self.mainbox.layout().addWidget(self.label)

        self.view = self.canvas.addViewBox()
        self.view.setAspectLocked(True)
        self.view.setRange(QtCore.QRectF(0,0, 100, 100))

        #  image plot
        self.img = pg.ImageItem(border='w')
        self.view.addItem(self.img)

        self.canvas.nextRow()
        #  line plot
        self.otherplot = self.canvas.addPlot()
        self.h2 = self.otherplot.plot(pen='y')


        #### Set Data  #####################

        self.x = np.linspace(0,50., num=100)
        self.X,self.Y = np.meshgrid(self.x,self.x)

        self.counter = 0
        self.fps = 0.
        self.lastupdate = time.time()

        #### Start  #####################
        self._update() 
开发者ID:timctho,项目名称:VNect-tensorflow,代码行数:41,代码来源:plotly_test.py

示例9: newViewWindow

# 需要导入模块: from pyqtgraph.Qt import QtCore [as 别名]
# 或者: from pyqtgraph.Qt.QtCore import QRectF [as 别名]
def newViewWindow(view, xdim, ydim, left, top, impixpervoxx, impixpervoxy, imgsize, enableMouse=False):
    theviewbox = view.addViewBox(enableMouse=enableMouse, enableMenu=False, lockAspect=1.0)
    theviewbox.setAspectLocked()
    theviewbox.setRange(QtCore.QRectF(0, 0, imgsize, imgsize), padding=0., disableAutoRange=True)
    theviewbox.setBackgroundColor([50, 50, 50])

    theviewfgwin = pg.ImageItem()
    theviewbox.addItem(theviewfgwin)
    theviewfgwin.setZValue(10)
    theviewfgwin.translate(left, top)
    theviewfgwin.scale(impixpervoxx, impixpervoxy)

    theviewbgwin = pg.ImageItem()
    theviewbox.addItem(theviewbgwin)
    theviewbgwin.setZValue(0)
    theviewbgwin.translate(left, top)
    theviewbgwin.scale(impixpervoxx, impixpervoxy)

    theviewvLine = pg.InfiniteLine(angle=90, movable=False, pen='g')
    theviewvLine.setZValue(20)
    theviewbox.addItem(theviewvLine)
    theviewhLine = pg.InfiniteLine(angle=0, movable=False, pen='g')
    theviewhLine.setZValue(20)
    theviewbox.addItem(theviewhLine)

    return theviewfgwin, theviewbgwin, theviewvLine, theviewhLine, theviewbox 
开发者ID:bbfrederick,项目名称:rapidtide,代码行数:28,代码来源:OrthoImageItem.py


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