com.trolltech.qt.gui
Class QPixmapDropShadowFilter

java.lang.Object
  extended by com.trolltech.qt.internal.QSignalEmitterInternal
      extended by com.trolltech.qt.QSignalEmitter
          extended by com.trolltech.qt.QtJambiObject
              extended by com.trolltech.qt.gui.QPixmapFilter
                  extended by com.trolltech.qt.gui.QPixmapDropShadowFilter
All Implemented Interfaces:
QtJambiInterface

public class QPixmapDropShadowFilter
extends QPixmapFilter

The QPixmapDropShadowFilter class is a convenience class for drawing pixmaps with drop shadows. The drop shadow is produced by taking a copy of the source pixmap and applying a color to the copy using a QPainter::CompositionMode_DestinationIn operation. This produces a homogeneously-colored pixmap which is then drawn using a QPixmapConvolutionFilter at an offset. The original pixmap is drawn on top.

The QPixmapDropShadowFilter class provides some customization options to specify how the drop shadow should appear. The color of the drop shadow can be modified using the setColor() function, the drop shadow offset can be modified using the setOffset() function, and the blur radius of the drop shadow can be changed through the setBlurRadius() function.

By default, the drop shadow is a dark gray shadow, blurred with a radius of 1 at an offset of 8 pixels towards the lower right.

Example:

The following code example is written in c++.

QPixmapDropShadowFilter *myFilter = new QPixmapDropShadowFilter;
myFilter->draw(painter, QPoint(0, 0), originalPixmap);

See also:
QPixmapColorizeFilter, and QPixmapConvolutionFilter.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QPixmapFilter
QPixmapFilter.FilterType
 
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.AbstractSignal, QSignalEmitter.PrivateSignal0, QSignalEmitter.PrivateSignal1, QSignalEmitter.PrivateSignal2, QSignalEmitter.PrivateSignal3, QSignalEmitter.PrivateSignal4, QSignalEmitter.PrivateSignal5, QSignalEmitter.PrivateSignal6, QSignalEmitter.PrivateSignal7, QSignalEmitter.PrivateSignal8, QSignalEmitter.PrivateSignal9, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9
 
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal
 
Field Summary
 
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
currentSender
 
Constructor Summary
QPixmapDropShadowFilter()
          Constructs drop shadow filter.
 
Method Summary
 double blurRadius()
          Returns the radius in pixels of the blur on the drop shadow.
 QColor color()
          Returns the color of the drop shadow.
 QPointF offset()
          Returns the shadow offset in pixels.
 void setBlurRadius(double radius)
          Sets the radius in pixels of the blur on the drop shadow to the radius specified.
 void setColor(QColor color)
          Sets the color of the drop shadow to the color specified.
 void setOffset(double dx, double dy)
          This is an overloaded member function, provided for convenience.
 void setOffset(QPointF offset)
          Sets the shadow offset in pixels to the offset specified.
 
Methods inherited from class com.trolltech.qt.gui.QPixmapFilter
boundingRectFor, draw, draw, type
 
Methods inherited from class com.trolltech.qt.QtJambiObject
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread
 
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
__qt_signalInitialization
 
Methods inherited from class java.lang.Object
clone, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Constructor Detail

QPixmapDropShadowFilter

public QPixmapDropShadowFilter()
Constructs drop shadow filter.

Method Detail

blurRadius

public final double blurRadius()
Returns the radius in pixels of the blur on the drop shadow.

A smaller radius results in a sharper shadow.

See also:
setBlurRadius(), color(), and offset().


color

public final QColor color()
Returns the color of the drop shadow.

See also:
setColor(), blurRadius(), and offset().


offset

public final QPointF offset()
Returns the shadow offset in pixels.

See also:
setOffset(), blurRadius(), and color().


setBlurRadius

public final void setBlurRadius(double radius)
Sets the radius in pixels of the blur on the drop shadow to the radius specified.

Using a smaller radius results in a sharper shadow.

See also:
blurRadius(), setColor(), and setOffset().


setColor

public final void setColor(QColor color)
Sets the color of the drop shadow to the color specified.

See also:
color(), setBlurRadius(), and setOffset().


setOffset

public final void setOffset(QPointF offset)
Sets the shadow offset in pixels to the offset specified.

See also:
offset(), setBlurRadius(), and setColor().


setOffset

public final void setOffset(double dx,
                            double dy)
This is an overloaded member function, provided for convenience.

Sets the shadow offset in pixels to be the displacement specified by the horizontal dx and vertical dy coordinates.

See also:
setBlurRadius(), and setColor().