qquickpainteditem.sip 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. // qquickpainteditem.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtQuick Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  8. //
  9. // This file may be used under the terms of the GNU General Public License
  10. // version 3.0 as published by the Free Software Foundation and appearing in
  11. // the file LICENSE included in the packaging of this file. Please review the
  12. // following information to ensure the GNU General Public License version 3.0
  13. // requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  14. //
  15. // If you do not wish to use this file under the terms of the GPL version 3.0
  16. // then you may purchase a commercial license. For more information contact
  17. // info@riverbankcomputing.com.
  18. //
  19. // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  20. // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  21. class QQuickPaintedItem : public QQuickItem /ExportDerived/
  22. {
  23. %TypeHeaderCode
  24. #include <qquickpainteditem.h>
  25. %End
  26. public:
  27. explicit QQuickPaintedItem(QQuickItem *parent /TransferThis/ = 0);
  28. virtual ~QQuickPaintedItem();
  29. enum RenderTarget
  30. {
  31. Image,
  32. FramebufferObject,
  33. InvertedYFramebufferObject,
  34. };
  35. enum PerformanceHint /BaseType=Flag/
  36. {
  37. FastFBOResizing,
  38. };
  39. typedef QFlags<QQuickPaintedItem::PerformanceHint> PerformanceHints;
  40. void update(const QRect &rect = QRect());
  41. bool opaquePainting() const;
  42. void setOpaquePainting(bool opaque);
  43. bool antialiasing() const;
  44. void setAntialiasing(bool enable);
  45. bool mipmap() const;
  46. void setMipmap(bool enable);
  47. QQuickPaintedItem::PerformanceHints performanceHints() const;
  48. void setPerformanceHint(QQuickPaintedItem::PerformanceHint hint, bool enabled = true);
  49. void setPerformanceHints(QQuickPaintedItem::PerformanceHints hints);
  50. QRectF contentsBoundingRect() const;
  51. QSize contentsSize() const;
  52. void setContentsSize(const QSize &);
  53. void resetContentsSize();
  54. qreal contentsScale() const;
  55. void setContentsScale(qreal);
  56. QColor fillColor() const;
  57. void setFillColor(const QColor &);
  58. QQuickPaintedItem::RenderTarget renderTarget() const;
  59. void setRenderTarget(QQuickPaintedItem::RenderTarget target);
  60. virtual void paint(QPainter *painter) = 0;
  61. signals:
  62. void fillColorChanged();
  63. void contentsSizeChanged();
  64. void contentsScaleChanged();
  65. void renderTargetChanged();
  66. protected:
  67. virtual QSGNode *updatePaintNode(QSGNode *, QQuickItem::UpdatePaintNodeData *);
  68. public:
  69. virtual bool isTextureProvider() const;
  70. virtual QSGTextureProvider *textureProvider() const;
  71. protected:
  72. virtual void releaseResources();
  73. virtual void itemChange(QQuickItem::ItemChange, const QQuickItem::ItemChangeData &);
  74. public:
  75. QSize textureSize() const;
  76. void setTextureSize(const QSize &size);
  77. signals:
  78. void textureSizeChanged();
  79. };