com.trolltech.qt.gui
Class QLinearGradient

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.QGradient
                  extended by com.trolltech.qt.gui.QLinearGradient
All Implemented Interfaces:
QtJambiInterface, java.lang.Cloneable

public class QLinearGradient
extends QGradient
implements java.lang.Cloneable

The QLinearGradient class is used in combination with QBrush to specify a linear gradient brush. Linear gradients interpolate colors between start and end points. Outside these points the gradient is either padded, reflected or repeated depending on the currently set spread method:







PadSpread (default) ReflectSpread RepeatSpread
The colors in a gradient is defined using stop points of the QGradientStop type, i.e. a position and a color. Use the QGradient::setColorAt() or the QGradient::setStops() function to define the stop points. It is the gradient's complete set of stop points that describes how the gradient area should be filled. If no stop points have been specified, a gradient of black at 0 to white at 1 is used.

In addition to the functions inherited from QGradient, the QLinearGradient class provides the finalStop() function which returns the final stop point of the gradient, and the start() function returning the start point of the gradient.

See also:
QRadialGradient, QConicalGradient, and The Gradients Demo.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QGradient
QGradient.CoordinateMode, QGradient.Spread, QGradient.Type
 
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
QLinearGradient()
          Constructs a default linear gradient with interpolation area between (0, 0) and (1, 1).
QLinearGradient(double xStart, double yStart, double xFinalStop, double yFinalStop)
          Constructs a linear gradient with interpolation area between (x1, y1) and (x2, y2).
QLinearGradient(QPointF start, QPointF finalStop)
          Constructs a linear gradient with interpolation area between the given start point and finalStop.
 
Method Summary
 QLinearGradient clone()
          This method is reimplemented for internal reasons
 QPointF finalStop()
          Returns the final stop point of this linear gradient in logical coordinates.
 void setFinalStop(double x, double y)
          This is an overloaded member function, provided for convenience.
 void setFinalStop(QPointF stop)
          Sets the final stop point of this linear gradient in logical coordinates to stop.
 void setStart(double x, double y)
          This is an overloaded member function, provided for convenience.
 void setStart(QPointF start)
          Sets the start point of this linear gradient in logical coordinates to start.
 QPointF start()
          Returns the start point of this linear gradient in logical coordinates.
 
Methods inherited from class com.trolltech.qt.gui.QGradient
coordinateMode, setColorAt, setCoordinateMode, setSpread, setStops, spread, stops, 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
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Constructor Detail

QLinearGradient

public QLinearGradient()
Constructs a default linear gradient with interpolation area between (0, 0) and (1, 1).

See also:
QGradient::setColorAt(), setStart(), and setFinalStop().


QLinearGradient

public QLinearGradient(QPointF start,
                       QPointF finalStop)
Constructs a linear gradient with interpolation area between the given start point and finalStop.

Note: The expected parameter values are in pixels.

See also:
QGradient::setColorAt(), and QGradient::setStops().


QLinearGradient

public QLinearGradient(double xStart,
                       double yStart,
                       double xFinalStop,
                       double yFinalStop)
Constructs a linear gradient with interpolation area between (x1, y1) and (x2, y2).

Note: The expected parameter values are in pixels.

See also:
QGradient::setColorAt(), and QGradient::setStops().

Method Detail

finalStop

public final QPointF finalStop()
Returns the final stop point of this linear gradient in logical coordinates.

See also:
setFinalStop(), and QGradient::stops().


setFinalStop

public final void setFinalStop(QPointF stop)
Sets the final stop point of this linear gradient in logical coordinates to stop.

See also:
finalStop().


setFinalStop

public final void setFinalStop(double x,
                               double y)
This is an overloaded member function, provided for convenience.

Sets the final stop point of this linear gradient in logical coordinates to x, y.

See also:
start().


setStart

public final void setStart(QPointF start)
Sets the start point of this linear gradient in logical coordinates to start.

See also:
start().


setStart

public final void setStart(double x,
                           double y)
This is an overloaded member function, provided for convenience.

Sets the start point of this linear gradient in logical coordinates to x, y.

See also:
start().


start

public final QPointF start()
Returns the start point of this linear gradient in logical coordinates.

See also:
setStart(), and QGradient::stops().


clone

public QLinearGradient clone()
This method is reimplemented for internal reasons

Overrides:
clone in class QGradient