summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-10-06 02:17:37 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-10-06 02:17:37 (GMT)
commite559d97aa8e37c63b9e0090fe5dfa4b9bdeb079e (patch)
tree1a156cad6d7fcac237a06940285bcdcd7df92ada /src/declarative
parent47db21ecd772a980e0a4a5f91c63cdffafdff8c0 (diff)
parent3710e8ca85c7f1dddb9dc752a6120523ce6bf781 (diff)
downloadQt-e559d97aa8e37c63b9e0090fe5dfa4b9bdeb079e.zip
Qt-e559d97aa8e37c63b9e0090fe5dfa4b9bdeb079e.tar.gz
Qt-e559d97aa8e37c63b9e0090fe5dfa4b9bdeb079e.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/fx/qfxborderimage.cpp23
-rw-r--r--src/declarative/fx/qfxrect.cpp9
2 files changed, 17 insertions, 15 deletions
diff --git a/src/declarative/fx/qfxborderimage.cpp b/src/declarative/fx/qfxborderimage.cpp
index 3bc76da..6616912 100644
--- a/src/declarative/fx/qfxborderimage.cpp
+++ b/src/declarative/fx/qfxborderimage.cpp
@@ -124,19 +124,16 @@ QFxBorderImage::~QFxBorderImage()
BorderImage can handle any image format supported by Qt, loaded from any URL scheme supported by Qt.
It can also handle .sci files, which are a Qml-specific format. A .sci file uses a simple text-based format that specifies
- \list
- \i the grid lines describing a \l {BorderImage::border.left}{scale grid}.
- \i an image file.
- \endlist
-
- The following .sci file sets grid line offsets of 10 on each side for the image \c picture.png:
- \code
- gridLeft: 10
- gridTop: 10
- gridBottom: 10
- gridRight: 10
- imageFile: picture.png
- \endcode
+ the borders, the image file and the tile rules.
+
+ The following .sci file sets the borders to 10 on each side for the image \c picture.png:
+ \qml
+ border.left: 10
+ border.top: 10
+ border.bottom: 10
+ border.right: 10
+ source: picture.png
+ \endqml
The URL may be absolute, or relative to the URL of the component.
*/
diff --git a/src/declarative/fx/qfxrect.cpp b/src/declarative/fx/qfxrect.cpp
index 0648ac4..e802c94 100644
--- a/src/declarative/fx/qfxrect.cpp
+++ b/src/declarative/fx/qfxrect.cpp
@@ -427,14 +427,15 @@ void QFxRect::drawRect(QPainter &p)
int offset = 0;
const int pw = d->pen && d->pen->isValid() ? (d->pen->width()+1)/2*2 : 0;
+ const int realpw = d->pen && d->pen->isValid() ? d->pen->width() : 0;
if (d->radius > 0) {
generateRoundedRect();
//### implicit conversion to int
- offset = int(d->radius+1.5+pw);
+ offset = int(d->radius+realpw+1);
} else {
generateBorderedRect();
- offset = pw+1;
+ offset = realpw+1;
}
//basically same code as QFxImage uses to paint sci images
@@ -457,6 +458,8 @@ void QFxRect::drawRect(QPainter &p)
ySide = yOffset * 2;
}
+ Q_ASSERT(d->rectImage.width() >= 2*xOffset + 1);
+ Q_ASSERT(d->rectImage.height() >= 2*yOffset + 1);
QMargins margins(xOffset, yOffset, xOffset, yOffset);
QTileRules rules(Qt::StretchTile, Qt::StretchTile);
qDrawBorderPixmap(&p, QRect(-pw/2, -pw/2, width()+pw, height()+pw), margins, d->rectImage, d->rectImage.rect(), margins, rules);
@@ -479,6 +482,8 @@ void QFxRect::drawRect(QPainter &p)
\note Generally scaling artifacts are only visible if the item is stationary on
the screen. A common pattern when animating an item is to disable smooth
filtering at the beginning of the animation and reenable it at the conclusion.
+
+ \image rect-smooth.png
*/
QRectF QFxRect::boundingRect() const