diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2009-11-10 12:35:42 (GMT) |
---|---|---|
committer | David Boddie <dboddie@trolltech.com> | 2009-11-11 16:06:55 (GMT) |
commit | 3b93dfa8c64a209456f8ba2cde6e0edca27c6b42 (patch) | |
tree | 3cc8b509ac15ce1d7408cd24a3be24a3013daf7c /doc | |
parent | 71f5f5f62463c70bba76485ef07e930829423997 (diff) | |
download | Qt-3b93dfa8c64a209456f8ba2cde6e0edca27c6b42.zip Qt-3b93dfa8c64a209456f8ba2cde6e0edca27c6b42.tar.gz Qt-3b93dfa8c64a209456f8ba2cde6e0edca27c6b42.tar.bz2 |
Improvements to graphics effects API after review round.
* Get rid of QGraphicsEffectSource from the public API, instead add
convenience functions in QGraphicsEffect. This way we commit to less
API, and are free to introduce a customizable QGraphicsEffectSource
in a future release.
* Move PixmapPadMode into QGraphicsEffect and tweak the names of the
enum values.
* Make QGraphicsBlurEffect::BlurHint into a bit flag, for extensibility.
Reviewed-by: Bjørn Erik Nilsen
Diffstat (limited to 'doc')
-rw-r--r-- | doc/src/snippets/code/src_gui_effects_qgraphicseffect.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/doc/src/snippets/code/src_gui_effects_qgraphicseffect.cpp b/doc/src/snippets/code/src_gui_effects_qgraphicseffect.cpp index 35689f4..5ef6609 100644 --- a/doc/src/snippets/code/src_gui_effects_qgraphicseffect.cpp +++ b/doc/src/snippets/code/src_gui_effects_qgraphicseffect.cpp @@ -40,11 +40,11 @@ ****************************************************************************/ //! [0] -MyGraphicsOpacityEffect::draw(QPainter *painter, QGraphicsEffectSource *source) +MyGraphicsOpacityEffect::draw(QPainter *painter) { // Fully opaque; draw directly without going through a pixmap. if (qFuzzyCompare(m_opacity, 1)) { - source->draw(painter); + drawSource(painter); return; } ... @@ -52,18 +52,18 @@ MyGraphicsOpacityEffect::draw(QPainter *painter, QGraphicsEffectSource *source) //! [0] //! [1] -MyGraphicsEffect::draw(QPainter *painter, QGraphicsEffectSource *source) +MyGraphicsEffect::draw(QPainter *painter) { ... QPoint offset; - if (source->isPixmap()) { + if (sourceIsPixmap()) { // No point in drawing in device coordinates (pixmap will be scaled anyways). - const QPixmap pixmap = source->pixmap(Qt::LogicalCoordinates, &offset); + const QPixmap pixmap = sourcePixmap(Qt::LogicalCoordinates, &offset); ... painter->drawPixmap(offset, pixmap); } else { // Draw pixmap in device coordinates to avoid pixmap scaling; - const QPixmap pixmap = source->pixmap(Qt::DeviceCoordinates, &offset); + const QPixmap pixmap = sourcePixmap(Qt::DeviceCoordinates, &offset); painter->setWorldTransform(QTransform()); ... painter->drawPixmap(offset, pixmap); |