|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.gui.QPixmapFilter
com.trolltech.qt.gui.QPixmapDropShadowFilter
public class QPixmapDropShadowFilter
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);
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.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 |
---|
public QPixmapDropShadowFilter()
Method Detail |
---|
public final double blurRadius()
A smaller radius results in a sharper shadow.
setBlurRadius()
, color()
, and offset()
.
public final QColor color()
setColor()
, blurRadius()
, and offset()
.
public final QPointF offset()
setOffset()
, blurRadius()
, and color()
.
public final void setBlurRadius(double radius)
Using a smaller radius results in a sharper shadow.
blurRadius()
, setColor()
, and setOffset()
.
public final void setColor(QColor color)
color()
, setBlurRadius()
, and setOffset()
.
public final void setOffset(QPointF offset)
offset()
, setBlurRadius()
, and setColor()
.
public final void setOffset(double dx, double dy)
Sets the shadow offset in pixels to be the displacement specified by the horizontal dx and vertical dy coordinates.
setBlurRadius()
, and setColor()
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |