4 @SuppressWarnings public class QBrush : QNative{
24 LinearGradientPattern ,
25 RadialGradientPattern ,
26 ConicalGradientPattern ,
36 public static class Gradient{
37 public long gradhandle = 0;
39 int nstyle = Style.LinearGradientPattern;
45 public bool create(@NotNilptr
double [] data){
51 case Style.LinearGradientPattern:
52 gradhandle = QtXnl.createPObject(QType.qtLineGradient, data);
54 case Style.RadialGradientPattern:
58 gradhandle = QtXnl.createPObject(QType.qtRadialGradient3, data);
61 gradhandle = QtXnl.createPObject(QType.qtRadialGradient5, data);
64 gradhandle = QtXnl.createPObject(QType.qtRadialGradient6, data);
69 case Style.ConicalGradientPattern:
70 gradhandle = QtXnl.createPObject(QType.qtConicalGradient, data);
73 return gradhandle != 0;
77 QtXnl.widget_set_v2int_double_value(gradhandle, Constant.SETCOLORAT, color, pos, 0);
81 QtXnl.widget_set_vint_value(gradhandle, Constant.SETSPREAD, spread);
86 QtXnl.widget_slot(gradhandle, Constant.DELLOCGRADIENT);
91 public static class QLinearGradient : Gradient{
93 super(Style.LinearGradientPattern);
94 double [] _params = {x, y, ex, ey};
95 if (create(_params) ==
false){
102 public static class QRadialGradient : Gradient{
104 super(Style.RadialGradientPattern);
105 double [] _params = {x, y, r};
106 if (create(_params) ==
false){
112 super(Style.RadialGradientPattern);
113 double [] _params = {x, y, r, fx, fy};
114 if (create(_params) ==
false){
120 super(Style.RadialGradientPattern);
121 double [] _params = {x, y, r, fx, fy, fr};
122 if (create(_params) ==
false){
128 public static class QConicalGradient : Gradient{
130 super(Style.ConicalGradientPattern);
131 double [] _params = {cx, cy, s};
132 if (create(_params) ==
false){
139 nativehandle = QtXnl.createNObject(QType.qtBrush, 0);
140 if (nativehandle == 0){
146 nativehandle = QtXnl.createNObject(QType.qtBrush, grad.gradhandle);
147 if (nativehandle == 0){
153 nativehandle = QtXnl.createNObject(QType.qtImgBrush, img.himage);
154 if (nativehandle == 0){
160 if (nativehandle != 0){
161 QtXnl.widget_slot(nativehandle, Constant.DELLOCBRUSH);
bool create(@NotNilptr double [] data)
void setColorAt(double pos, int color)
void setSpread(int spread)
QConicalGradient(double cx,double cy,double s)
QLinearGradient(double x,double y,double ex,double ey)
QRadialGradient(double x,double y,double r)
QRadialGradient(double x,double y,double r,double fx,double fy, double fr)
QRadialGradient(double x,double y,double r,double fx,double fy)
QBrush(@NotNilptr Gradient grad)
QBrush(@NotNilptr QImage img)