diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-07-31 01:52:29 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-07-31 01:52:29 (GMT) |
commit | 2411b42ff4638bc1a707ab9ebe9fbadf2a4a0292 (patch) | |
tree | c895ba39c4fa4f48b2aad1a6c1c86fdc788700aa /src/declarative/fx | |
parent | 56f67f2fdf84fe5e7660552c52b67c4e474054dd (diff) | |
download | Qt-2411b42ff4638bc1a707ab9ebe9fbadf2a4a0292.zip Qt-2411b42ff4638bc1a707ab9ebe9fbadf2a4a0292.tar.gz Qt-2411b42ff4638bc1a707ab9ebe9fbadf2a4a0292.tar.bz2 |
Rename Rect.pen to Rect.border
Diffstat (limited to 'src/declarative/fx')
-rw-r--r-- | src/declarative/fx/qfxrect.cpp | 73 | ||||
-rw-r--r-- | src/declarative/fx/qfxrect.h | 4 |
2 files changed, 20 insertions, 57 deletions
diff --git a/src/declarative/fx/qfxrect.cpp b/src/declarative/fx/qfxrect.cpp index c43e034..93a2997 100644 --- a/src/declarative/fx/qfxrect.cpp +++ b/src/declarative/fx/qfxrect.cpp @@ -52,7 +52,6 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Gradient,QFxGradient) /*! \internal \class QFxPen - \ingroup group_utility \brief The QFxPen class provides a pen used for drawing rect borders on a QFxView. By default, the pen is invalid and nothing is drawn. You must either set a color (then the default @@ -62,12 +61,12 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Gradient,QFxGradient) Example: \qml - Rect { pen.width: 2; pen.color: "red" ... } + Rect { border.width: 2; border.color: "red" ... } \endqml */ /*! \property QFxPen::width - \brief the width of the pen. + \brief the width of the border. A width of 1 is a single-pixel line on the border of the item being painted. @@ -76,17 +75,17 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Gradient,QFxGradient) /*! \property QFxPen::color - \brief the color of the pen. + \brief the color of the border. color is most commonly specified in hexidecimal notation (#RRGGBB) or as an \l {http://www.w3.org/TR/SVG/types.html#ColorKeywords}{SVG color keyword name} (as defined by the World Wide Web Consortium). For example: \qml // rect with green border using hexidecimal notation - Rect { pen.color: "#00FF00" } + Rect { border.color: "#00FF00" } // rect with steelblue border using SVG color name - Rect { pen.color: "steelblue" } + Rect { border.color: "steelblue" } \endqml For the full set of ways to specify color, see Qt's QColor::setNamedColor documentation. @@ -101,10 +100,10 @@ void QFxPen::setColor(const QColor &c) /*! \property QFxPen::width - \brief the width of the pen. + \brief the width of the border. \qml - Rect { pen.width: 4 } + Rect { border.width: 4 } \endqml A width of 1 creates a thin line. For no line, use a width of 0 or a transparent color. @@ -200,8 +199,8 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Rect,QFxRect) width: 100 height: 100 color: "red" - pen.color: "black" - pen.width: 5 + border.color: "black" + border.width: 5 radius: 10 } \endqml @@ -213,26 +212,6 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Rect,QFxRect) \internal \class QFxRect \brief The QFxRect class provides a rect item that you can add to a QFxView. - - A Rect is painted having a solid fill (color) and an optional border (pen). - You can also create rounded rectangles using the radius property. - - \qml - Rect { - width: 100 - height: 100 - color: "red" - pen.color: "black" - pen.width: 5 - radius: 10 - } - \endqml - - \image declarative-rect.png - - A QFxRect object can be instantiated in Qml using the tag \l Rect. - - \ingroup group_coreitems */ QFxRect::QFxRect(QFxItem *parent) : QFxItem(*(new QFxRectPrivate), parent) @@ -260,16 +239,17 @@ void QFxRect::doUpdate() } /*! - \qmlproperty int Rect::pen.width - \qmlproperty color Rect::pen.color + \qmlproperty int Rect::border.width + \qmlproperty color Rect::border.color - The pen used to draw the border of the rect. -*/ -/*! - \property QFxRect::pen - \brief the pen used to draw the border of the rect. + The width and color used to draw the border of the rect. + + A width of 1 creates a thin line. For no line, use a width of 0 or a transparent color. + + To keep the border smooth (rather than blurry), odd widths cause the rect to be painted at + a half-pixel offset; */ -QFxPen *QFxRect::pen() +QFxPen *QFxRect::border() { Q_D(QFxRect); return d->getPen(); @@ -335,11 +315,6 @@ void QFxRect::setGradient(QFxGradient *gradient) painted as a normal rectangle. The same radius is used by all 4 corners; there is currently no way to specify different radii for different corners. */ - -/*! - \property QFxRect::radius - \brief the corner radius used to draw a rounded rect. -*/ qreal QFxRect::radius() const { Q_D(const QFxRect); @@ -371,11 +346,6 @@ void QFxRect::setRadius(qreal radius) The default color is white. */ - -/*! - \property QFxRect::color - \brief the color used to fill the rect. -*/ QColor QFxRect::color() const { Q_D(const QFxRect); @@ -393,8 +363,6 @@ void QFxRect::setColor(const QColor &c) update(); } - - /*! \qmlproperty color Rect::tintColor This property holds The color to tint the rectangle. @@ -409,11 +377,6 @@ void QFxRect::setColor(const QColor &c) This attribute is not intended to be used with a single color over the lifetime of an user interface. It is most useful when a subtle change is intended to be conveyed due to some event; you can then use the tint color to more effectively tune the visible color. */ - -/*! - \property QFxRect::tintColor - \brief The color to tint the rectangle. -*/ QColor QFxRect::tintColor() const { Q_D(const QFxRect); diff --git a/src/declarative/fx/qfxrect.h b/src/declarative/fx/qfxrect.h index d438459..98f5e67 100644 --- a/src/declarative/fx/qfxrect.h +++ b/src/declarative/fx/qfxrect.h @@ -138,7 +138,7 @@ class Q_DECLARATIVE_EXPORT QFxRect : public QFxItem Q_PROPERTY(QColor color READ color WRITE setColor) Q_PROPERTY(QColor tintColor READ tintColor WRITE setTintColor) Q_PROPERTY(QFxGradient *gradient READ gradient WRITE setGradient) - Q_PROPERTY(QFxPen * pen READ pen) + Q_PROPERTY(QFxPen * border READ border) Q_PROPERTY(qreal radius READ radius WRITE setRadius) public: QFxRect(QFxItem *parent=0); @@ -149,7 +149,7 @@ public: QColor tintColor() const; void setTintColor(const QColor &); - QFxPen *pen(); + QFxPen *border(); QFxGradient *gradient() const; void setGradient(QFxGradient *gradient); |