qgraphicseffect.sip 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. // qgraphicseffect.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtWidgets 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 QGraphicsEffect : public QObject
  22. {
  23. %TypeHeaderCode
  24. #include <qgraphicseffect.h>
  25. %End
  26. public:
  27. enum ChangeFlag /BaseType=Flag/
  28. {
  29. SourceAttached,
  30. SourceDetached,
  31. SourceBoundingRectChanged,
  32. SourceInvalidated,
  33. };
  34. typedef QFlags<QGraphicsEffect::ChangeFlag> ChangeFlags;
  35. enum PixmapPadMode
  36. {
  37. NoPad,
  38. PadToTransparentBorder,
  39. PadToEffectiveBoundingRect,
  40. };
  41. QGraphicsEffect(QObject *parent /TransferThis/ = 0);
  42. virtual ~QGraphicsEffect();
  43. virtual QRectF boundingRectFor(const QRectF &sourceRect) const;
  44. QRectF boundingRect() const;
  45. bool isEnabled() const;
  46. public slots:
  47. void setEnabled(bool enable);
  48. void update();
  49. signals:
  50. void enabledChanged(bool enabled);
  51. protected:
  52. virtual void draw(QPainter *painter) = 0;
  53. virtual void sourceChanged(QGraphicsEffect::ChangeFlags flags);
  54. void updateBoundingRect();
  55. bool sourceIsPixmap() const;
  56. QRectF sourceBoundingRect(Qt::CoordinateSystem system = Qt::LogicalCoordinates) const;
  57. void drawSource(QPainter *painter);
  58. QPixmap sourcePixmap(Qt::CoordinateSystem system = Qt::LogicalCoordinates, QPoint *offset /Out/ = 0, QGraphicsEffect::PixmapPadMode mode = QGraphicsEffect::PadToEffectiveBoundingRect) const;
  59. };
  60. class QGraphicsColorizeEffect : public QGraphicsEffect
  61. {
  62. %TypeHeaderCode
  63. #include <qgraphicseffect.h>
  64. %End
  65. public:
  66. QGraphicsColorizeEffect(QObject *parent /TransferThis/ = 0);
  67. virtual ~QGraphicsColorizeEffect();
  68. QColor color() const;
  69. qreal strength() const;
  70. public slots:
  71. void setColor(const QColor &c);
  72. void setStrength(qreal strength);
  73. signals:
  74. void colorChanged(const QColor &color);
  75. void strengthChanged(qreal strength);
  76. protected:
  77. virtual void draw(QPainter *painter);
  78. };
  79. class QGraphicsBlurEffect : public QGraphicsEffect
  80. {
  81. %TypeHeaderCode
  82. #include <qgraphicseffect.h>
  83. %End
  84. public:
  85. enum BlurHint /BaseType=Flag/
  86. {
  87. PerformanceHint,
  88. QualityHint,
  89. AnimationHint,
  90. };
  91. typedef QFlags<QGraphicsBlurEffect::BlurHint> BlurHints;
  92. QGraphicsBlurEffect(QObject *parent /TransferThis/ = 0);
  93. virtual ~QGraphicsBlurEffect();
  94. virtual QRectF boundingRectFor(const QRectF &rect) const;
  95. qreal blurRadius() const;
  96. QGraphicsBlurEffect::BlurHints blurHints() const;
  97. public slots:
  98. void setBlurRadius(qreal blurRadius);
  99. void setBlurHints(QGraphicsBlurEffect::BlurHints hints);
  100. signals:
  101. void blurRadiusChanged(qreal blurRadius);
  102. void blurHintsChanged(QGraphicsBlurEffect::BlurHints hints /ScopesStripped=1/);
  103. protected:
  104. virtual void draw(QPainter *painter);
  105. };
  106. class QGraphicsDropShadowEffect : public QGraphicsEffect
  107. {
  108. %TypeHeaderCode
  109. #include <qgraphicseffect.h>
  110. %End
  111. public:
  112. QGraphicsDropShadowEffect(QObject *parent /TransferThis/ = 0);
  113. virtual ~QGraphicsDropShadowEffect();
  114. virtual QRectF boundingRectFor(const QRectF &rect) const;
  115. QPointF offset() const;
  116. qreal xOffset() const;
  117. qreal yOffset() const;
  118. qreal blurRadius() const;
  119. QColor color() const;
  120. public slots:
  121. void setOffset(const QPointF &ofs);
  122. void setOffset(qreal dx, qreal dy);
  123. void setOffset(qreal d);
  124. void setXOffset(qreal dx);
  125. void setYOffset(qreal dy);
  126. void setBlurRadius(qreal blurRadius);
  127. void setColor(const QColor &color);
  128. signals:
  129. void offsetChanged(const QPointF &offset);
  130. void blurRadiusChanged(qreal blurRadius);
  131. void colorChanged(const QColor &color);
  132. protected:
  133. virtual void draw(QPainter *painter);
  134. };
  135. class QGraphicsOpacityEffect : public QGraphicsEffect
  136. {
  137. %TypeHeaderCode
  138. #include <qgraphicseffect.h>
  139. %End
  140. public:
  141. QGraphicsOpacityEffect(QObject *parent /TransferThis/ = 0);
  142. virtual ~QGraphicsOpacityEffect();
  143. qreal opacity() const;
  144. QBrush opacityMask() const;
  145. public slots:
  146. void setOpacity(qreal opacity);
  147. void setOpacityMask(const QBrush &mask);
  148. signals:
  149. void opacityChanged(qreal opacity);
  150. void opacityMaskChanged(const QBrush &mask);
  151. protected:
  152. virtual void draw(QPainter *painter);
  153. };