summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-10-28 05:50:28 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-10-28 05:50:28 (GMT)
commit2a3ebb69d4a91ae233dd015debf9f323a86b79d3 (patch)
tree618e5288f3bf32e2fac6bd3edc677d40da615a1f /src/declarative/fx
parent1cfb6992aaa381e07a2751b100eb6c353f874c8e (diff)
parent44be8cc3bb1aebd47f75dcf9cae54884322e1955 (diff)
downloadQt-2a3ebb69d4a91ae233dd015debf9f323a86b79d3.zip
Qt-2a3ebb69d4a91ae233dd015debf9f323a86b79d3.tar.gz
Qt-2a3ebb69d4a91ae233dd015debf9f323a86b79d3.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/fx')
-rw-r--r--src/declarative/fx/qfxpositioners.cpp16
-rw-r--r--src/declarative/fx/qfxtext.cpp22
-rw-r--r--src/declarative/fx/qfxtext.h15
-rw-r--r--src/declarative/fx/qfxtext_p.h4
4 files changed, 38 insertions, 19 deletions
diff --git a/src/declarative/fx/qfxpositioners.cpp b/src/declarative/fx/qfxpositioners.cpp
index cc385e0..86a069d 100644
--- a/src/declarative/fx/qfxpositioners.cpp
+++ b/src/declarative/fx/qfxpositioners.cpp
@@ -375,6 +375,10 @@ Column {
\endqml
\endtable
+ Note that the positioner assumes that the x and y positions of its children
+ will not change. If you manually change the x or y properties in script, bind
+ the x or y properties, or use anchors on a child of a positioner, then the
+ positioner may exhibit strange behaviour.
*/
/*!
@@ -539,6 +543,11 @@ Row {
\endqml
\image horizontalpositioner_example.png
+ Note that the positioner assumes that the x and y positions of its children
+ will not change. If you manually change the x or y properties in script, bind
+ the x or y properties, or use anchors on a child of a positioner, then the
+ positioner may exhibit strange behaviour.
+
*/
/*!
\qmlproperty Transition Row::remove
@@ -659,7 +668,7 @@ void QFxRow::doPositioning()
child->setX(hoffset);
setMovingItem(0);
}
- if(!child->width() || !child->height()){//don't advance for invisible children
+ if(child->width() && child->height()){//don't advance for invisible children
hoffset += child->width();
hoffset += spacing();
}
@@ -707,6 +716,11 @@ Grid {
}
\endqml
\endtable
+
+ Note that the positioner assumes that the x and y positions of its children
+ will not change. If you manually change the x or y properties in script, bind
+ the x or y properties, or use anchors on a child of a positioner, then the
+ positioner may exhibit strange behaviour.
*/
/*!
\qmlproperty Transition Grid::remove
diff --git a/src/declarative/fx/qfxtext.cpp b/src/declarative/fx/qfxtext.cpp
index 4d02f0d..763256b 100644
--- a/src/declarative/fx/qfxtext.cpp
+++ b/src/declarative/fx/qfxtext.cpp
@@ -420,28 +420,28 @@ void QFxText::setTextFormat(TextFormat format)
}
/*!
- \qmlproperty Qt::TextElideMode Text::elide
+ \qmlproperty enumeration Text::elide
Set this property to elide parts of the text fit to the Text item's width.
The text will only elide if an explicit width has been set.
This property cannot be used with wrap enabled or with rich text.
- Eliding can be ElideNone (the default), ElideLeft, ElideMiddle, or ElideRight.
+ Eliding can be \c ElideNone (the default), \c ElideLeft, \c ElideMiddle, or \c ElideRight.
- If the text is a multi-length string, and the mode is not ElideNone,
+ If the text is a multi-length string, and the mode is not \c ElideNone,
the first string that fits will be used, otherwise the last will be elided.
Multi-length strings are ordered from longest to shortest, separated by the
- Unicode "String Terminator" character U009C (write this in QML with "\\x9C").
+ Unicode "String Terminator" character \c U009C (write this in QML with \c{"\\x9C"}).
*/
-Qt::TextElideMode QFxText::elideMode() const
+QFxText::TextElideMode QFxText::elideMode() const
{
Q_D(const QFxText);
return d->elideMode;
}
-void QFxText::setElideMode(Qt::TextElideMode mode)
+void QFxText::setElideMode(QFxText::TextElideMode mode)
{
Q_D(QFxText);
if (mode == d->elideMode)
@@ -458,7 +458,7 @@ void QFxText::geometryChanged(const QRectF &newGeometry,
{
Q_D(QFxText);
if (newGeometry.width() != oldGeometry.width()) {
- if (d->wrap || d->elideMode != Qt::ElideNone) {
+ if (d->wrap || d->elideMode != QFxText::ElideNone) {
d->imgDirty = true;
d->updateSize();
}
@@ -486,8 +486,8 @@ void QFxTextPrivate::updateSize()
tmp = text;
tmp.replace(QLatin1Char('\n'), QChar::LineSeparator);
singleline = !tmp.contains(QChar::LineSeparator);
- if (singleline && elideMode != Qt::ElideNone && q->widthValid())
- tmp = fm.elidedText(tmp,elideMode,q->width()); // XXX still worth layout...?
+ if (singleline && elideMode != QFxText::ElideNone && q->widthValid())
+ tmp = fm.elidedText(tmp,(Qt::TextElideMode)elideMode,q->width()); // XXX still worth layout...?
layout.clearLayout();
layout.setFont(font);
layout.setText(tmp);
@@ -586,7 +586,7 @@ QSize QFxTextPrivate::setupTextLayout(QTextLayout *layout)
qreal lineWidth = 0;
//set manual width
- if ((wrap || elideMode != Qt::ElideNone) && q->widthValid())
+ if ((wrap || elideMode != QFxText::ElideNone) && q->widthValid())
lineWidth = q->width();
layout->beginLayout();
@@ -596,7 +596,7 @@ QSize QFxTextPrivate::setupTextLayout(QTextLayout *layout)
if (!line.isValid())
break;
- if ((wrap || elideMode != Qt::ElideNone) && q->widthValid())
+ if ((wrap || elideMode != QFxText::ElideNone) && q->widthValid())
line.setLineWidth(lineWidth);
}
layout->endLayout();
diff --git a/src/declarative/fx/qfxtext.h b/src/declarative/fx/qfxtext.h
index 763e2aa..cdb8025 100644
--- a/src/declarative/fx/qfxtext.h
+++ b/src/declarative/fx/qfxtext.h
@@ -57,6 +57,7 @@ class Q_DECLARATIVE_EXPORT QFxText : public QFxItem
Q_ENUMS(VAlignment)
Q_ENUMS(TextStyle)
Q_ENUMS(TextFormat)
+ Q_ENUMS(TextElideMode)
Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
Q_PROPERTY(QFont font READ font WRITE setFont)
@@ -67,7 +68,7 @@ class Q_DECLARATIVE_EXPORT QFxText : public QFxItem
Q_PROPERTY(VAlignment verticalAlignment READ vAlign WRITE setVAlign)
Q_PROPERTY(bool wrap READ wrap WRITE setWrap) //### there are several wrap modes in Qt
Q_PROPERTY(TextFormat textFormat READ textFormat WRITE setTextFormat)
- Q_PROPERTY(Qt::TextElideMode elide READ elideMode WRITE setElideMode) //### elideMode?
+ Q_PROPERTY(TextElideMode elide READ elideMode WRITE setElideMode) //### elideMode?
public:
QFxText(QFxItem *parent=0);
@@ -84,8 +85,12 @@ public:
Raised,
Sunken };
enum TextFormat { PlainText = Qt::PlainText,
- RichText = Qt::RichText,
- AutoText = Qt::AutoText };
+ RichText = Qt::RichText,
+ AutoText = Qt::AutoText };
+ enum TextElideMode { ElideLeft = Qt::ElideLeft,
+ ElideRight = Qt::ElideRight,
+ ElideMiddle = Qt::ElideMiddle,
+ ElideNone = Qt::ElideNone };
QString text() const;
void setText(const QString &);
@@ -114,8 +119,8 @@ public:
TextFormat textFormat() const;
void setTextFormat(TextFormat format);
- Qt::TextElideMode elideMode() const;
- void setElideMode(Qt::TextElideMode);
+ TextElideMode elideMode() const;
+ void setElideMode(TextElideMode);
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
diff --git a/src/declarative/fx/qfxtext_p.h b/src/declarative/fx/qfxtext_p.h
index 8b24c66..a10cdfa 100644
--- a/src/declarative/fx/qfxtext_p.h
+++ b/src/declarative/fx/qfxtext_p.h
@@ -70,7 +70,7 @@ class QFxTextPrivate : public QFxItemPrivate
public:
QFxTextPrivate()
: color((QRgb)0), style(QFxText::Normal), imgDirty(true),
- hAlign(QFxText::AlignLeft), vAlign(QFxText::AlignTop), elideMode(Qt::ElideNone),
+ hAlign(QFxText::AlignLeft), vAlign(QFxText::AlignTop), elideMode(QFxText::ElideNone),
dirty(true), wrap(false), richText(false), singleline(false), control(0), doc(0),
format(QFxText::AutoText)
{
@@ -97,7 +97,7 @@ public:
QPixmap imgStyleCache;
QFxText::HAlignment hAlign;
QFxText::VAlignment vAlign;
- Qt::TextElideMode elideMode;
+ QFxText::TextElideMode elideMode;
bool dirty;
bool wrap;
bool richText;