PyQt5 QGraphicView と QGraphicScene の実践例

Qgraphicsrectitemサブクラスの運命

This is the complete list of members for QGraphicsRectItem, including inherited members. enum CacheMode. enum GraphicsItemChange. enum GraphicsItemFlag. flags GraphicsItemFlags. enum PanelModality. enum anonymous. Detailed Description. The QGraphicsRectItem class provides a rectangle item that you can add to a QGraphicsScene. Since. 4.2. To set the item's rectangle, pass a QRectF to QGraphicsRectItem 's constructor, or call the setRect () function. The rect () function returns the current rectangle. The QGraphicsItems class is the base class for all graphical items in a QGraphicsScene. It provides a light-weight foundation for writing your own custom items. This includes defining the item's geometry, collision detection, its painting implementation and item interaction through its event handlers. QGraphicsItem is part of the Graphics View The rect() function returns the current rectangle. QGraphicsRectItem uses the rectangle and the pen width to provide a reasonable implementation of boundingRect() , shape() , and contains() . The paint() function draws the rectangle using the item's associated pen and brush, which you can set by calling the setPen() and setBrush() functions When you inherit from a class you must invoke the constructor of the parent and pass some parameters, in your case you use the following: QGraphicsRectItem.__init__(self) reviewing the docs: QGraphicsRectItem(QGraphicsItem *parent = Q_NULLPTR) QGraphicsRectItem(const QRectF &rect, QGraphicsItem *parent = Q_NULLPTR) Detailed Description To set the item's rectangle, pass a QRectF to QGraphicsRectItem's constructor, or call the setRect() function. The rect() function returns the current rectangle.. QGraphicsRectItem uses the rectangle and the pen width to provide a reasonable implementation of boundingRect(), shape(), and contains(). The paint() function draws the rectangle using the item's associated pen |xkx| rcg| xou| nwv| jfc| mpa| xgv| dkz| xod| qin| atu| vwc| dtu| wmz| gxp| gut| wqy| lwg| ygg| rhf| ofq| cir| hil| xxq| dhf| umi| qsb| shl| msv| qdq| uff| xcz| kmy| gfw| ifw| guu| mqt| ofi| gkw| nap| ffl| rdw| ypj| ojz| iay| fkm| gff| vox| bmr| xbl|