summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-08-19 06:01:00 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-08-19 06:01:00 (GMT)
commit51555ed45f6397fa7cdfae771ee6275733bce615 (patch)
tree2307a7b976dcc6cb5cda57e90bc956cd889b9312 /src/declarative/fx
parent2eb1aba797f9380b4622575a3ef9c409e3b35036 (diff)
parent82a48966332f7683df27150ba73d44efb8cff1eb (diff)
downloadQt-51555ed45f6397fa7cdfae771ee6275733bce615.zip
Qt-51555ed45f6397fa7cdfae771ee6275733bce615.tar.gz
Qt-51555ed45f6397fa7cdfae771ee6275733bce615.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/qfxgridview.cpp21
-rw-r--r--src/declarative/fx/qfxitem.cpp57
-rw-r--r--src/declarative/fx/qfxlistview.cpp12
-rw-r--r--src/declarative/fx/qfxloader.cpp7
-rw-r--r--src/declarative/fx/qfxmouseregion.cpp8
-rw-r--r--src/declarative/fx/qfxtextinput.cpp46
-rw-r--r--src/declarative/fx/qfxtextinput.h3
7 files changed, 53 insertions, 101 deletions
diff --git a/src/declarative/fx/qfxgridview.cpp b/src/declarative/fx/qfxgridview.cpp
index 6c5a712..28f2219 100644
--- a/src/declarative/fx/qfxgridview.cpp
+++ b/src/declarative/fx/qfxgridview.cpp
@@ -1028,18 +1028,12 @@ void QFxGridView::sizeChange()
}
}
-/*!
- \reimp
-*/
void QFxGridView::viewportMoved()
{
QFxFlickable::viewportMoved();
refill();
}
-/*!
- \reimp
-*/
qreal QFxGridView::minYExtent() const
{
Q_D(const QFxGridView);
@@ -1048,9 +1042,6 @@ qreal QFxGridView::minYExtent() const
return -d->startPosition();
}
-/*!
- \reimp
-*/
qreal QFxGridView::maxYExtent() const
{
Q_D(const QFxGridView);
@@ -1059,9 +1050,6 @@ qreal QFxGridView::maxYExtent() const
return -(d->endPosition() - height());
}
-/*!
- \reimp
-*/
qreal QFxGridView::minXExtent() const
{
Q_D(const QFxGridView);
@@ -1070,9 +1058,6 @@ qreal QFxGridView::minXExtent() const
return -d->startPosition();
}
-/*!
- \reimp
-*/
qreal QFxGridView::maxXExtent() const
{
Q_D(const QFxGridView);
@@ -1081,9 +1066,6 @@ qreal QFxGridView::maxXExtent() const
return -(d->endPosition() - height());
}
-/*!
- \reimp
-*/
void QFxGridView::keyPressEvent(QKeyEvent *event)
{
Q_D(QFxGridView);
@@ -1131,9 +1113,6 @@ void QFxGridView::keyPressEvent(QKeyEvent *event)
QFxFlickable::keyPressEvent(event);
}
-/*!
- \reimp
-*/
void QFxGridView::componentComplete()
{
Q_D(QFxGridView);
diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp
index 572fcc7..4ec0a85 100644
--- a/src/declarative/fx/qfxitem.cpp
+++ b/src/declarative/fx/qfxitem.cpp
@@ -331,7 +331,7 @@ void QFxContents::setItem(QFxItem *item)
\code
Item {
focus: true
- key.onLeftPressed: print("move left")
+ Keys.onLeftPressed: print("move left")
}
\endcode
@@ -893,18 +893,6 @@ QFxKeysAttached *QFxKeysAttached::qmlAttachedProperties(QObject *obj)
*/
/*!
- \fn void QFxItem::hcenterChanged()
-
- This signal is emitted when the horizontal center coordinate of the item changes.
-*/
-
-/*!
- \fn void QFxItem::vcenterChanged()
-
- This signal is emitted when the vertical center coordinate of the item changes.
-*/
-
-/*!
\fn void QFxItem::stateChanged(const QString &state)
This signal is emitted when the \a state of the item changes.
@@ -1334,27 +1322,6 @@ void QFxItem::setClip(bool c)
*/
/*!
- \property QFxItem::x
-
- The x coordinate of the item relative to its parent.
-*/
-
-/*!
- \property QFxItem::y
-
- The y coordinate of the item relative to its parent.
-*/
-
-/*!
- \property QFxItem::z
-
- The z coordinate of the item relative to its parent.
-
- A negative z coordinate means the item will be painted below its parent.
-*/
-
-
-/*!
\qmlproperty real Item::z
Sets the stacking order of the item. By default the stacking order is 0.
@@ -1977,12 +1944,7 @@ QmlList<QmlTransition *>* QFxItem::transitions()
return d->states()->transitionsProperty();
}
-/*!
- \internal
- \property QFxItem::filter
-*/
-
-/*!
+/*
\qmlproperty list<Filter> Item::filter
This property holds a list of graphical filters to be applied to the item.
@@ -2205,11 +2167,17 @@ QPointF QFxItemPrivate::computeTransformOrigin() const
}
}
+/*!
+ \reimp
+*/
bool QFxItem::sceneEvent(QEvent *event)
{
return QGraphicsItem::sceneEvent(event);
}
+/*!
+ \reimp
+*/
QVariant QFxItem::itemChange(GraphicsItemChange change,
const QVariant &value)
{
@@ -2220,6 +2188,9 @@ QVariant QFxItem::itemChange(GraphicsItemChange change,
return QGraphicsItem::itemChange(change, value);
}
+/*!
+ \reimp
+*/
QRectF QFxItem::boundingRect() const
{
Q_D(const QFxItem);
@@ -2441,10 +2412,16 @@ bool QFxItem::hasActiveFocus() const
return QGraphicsItem::hasFocus();
}
+/*!
+ \reimp
+*/
void QFxItem::paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *)
{
}
+/*!
+ \reimp
+*/
bool QFxItem::event(QEvent *ev)
{
return QGraphicsObject::event(ev);
diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp
index 0232717..b6301f6 100644
--- a/src/declarative/fx/qfxlistview.cpp
+++ b/src/declarative/fx/qfxlistview.cpp
@@ -1260,9 +1260,6 @@ void QFxListView::viewportMoved()
}
}
-/*!
- \reimp
-*/
qreal QFxListView::minYExtent() const
{
Q_D(const QFxListView);
@@ -1275,9 +1272,6 @@ qreal QFxListView::minYExtent() const
return extent;
}
-/*!
- \reimp
-*/
qreal QFxListView::maxYExtent() const
{
Q_D(const QFxListView);
@@ -1294,9 +1288,6 @@ qreal QFxListView::maxYExtent() const
return extent;
}
-/*!
- \reimp
-*/
qreal QFxListView::minXExtent() const
{
Q_D(const QFxListView);
@@ -1309,9 +1300,6 @@ qreal QFxListView::minXExtent() const
return extent;
}
-/*!
- \reimp
-*/
qreal QFxListView::maxXExtent() const
{
Q_D(const QFxListView);
diff --git a/src/declarative/fx/qfxloader.cpp b/src/declarative/fx/qfxloader.cpp
index 6d06ee9..95ddae3 100644
--- a/src/declarative/fx/qfxloader.cpp
+++ b/src/declarative/fx/qfxloader.cpp
@@ -85,13 +85,6 @@ QFxLoader::~QFxLoader()
}
/*!
- \internal
- \fn void QFxItem::sourceChanged()
- This signal is emitted whenever the item's dynamic QML
- source url changes.
- */
-
-/*!
\qmlproperty url Loader::source
This property holds the dynamic URL of the QML for the item.
diff --git a/src/declarative/fx/qfxmouseregion.cpp b/src/declarative/fx/qfxmouseregion.cpp
index 1125673..858764a 100644
--- a/src/declarative/fx/qfxmouseregion.cpp
+++ b/src/declarative/fx/qfxmouseregion.cpp
@@ -306,6 +306,7 @@ void QFxMouseRegion::mousePressEvent(QGraphicsSceneMouseEvent *event)
d->dragX = drag()->axis() & QFxDrag::XAxis;
d->dragY = drag()->axis() & QFxDrag::YAxis;
d->dragged = false;
+ setHovered(true);
d->start = event->pos();
d->startScene = event->scenePos();
// we should only start timer if pressAndHold is connected to.
@@ -393,6 +394,9 @@ void QFxMouseRegion::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
else {
d->saveEvent(event);
setPressed(false);
+ // If we don't accept hover, we need to reset containsMouse.
+ if (!acceptHoverEvents())
+ setHovered(false);
}
}
@@ -477,8 +481,8 @@ void QFxMouseRegion::timerEvent(QTimerEvent *event)
\qmlproperty bool MouseRegion::containsMouse
This property holds whether the mouse is currently inside the mouse region.
- \warning This property is only partially implemented -- it is only valid when the mouse is moved over the
- region. If the region moves under the mouse, \e containsMouse will not change.
+ \warning This property is not updated if the region moves under the mouse: \e containsMouse will not change.
+ In addition, if hoverEnabled is false, containsMouse will only be valid when the mouse is pressed.
*/
bool QFxMouseRegion::hovered() const
{
diff --git a/src/declarative/fx/qfxtextinput.cpp b/src/declarative/fx/qfxtextinput.cpp
index 1407a78..164739f 100644
--- a/src/declarative/fx/qfxtextinput.cpp
+++ b/src/declarative/fx/qfxtextinput.cpp
@@ -53,8 +53,8 @@ QML_DEFINE_NOCREATE_TYPE(QValidator);
QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,QIntValidator,QIntValidator);
/*!
- \qmlclass LineEdit
- The LineEdit item allows you to add an editable line of text to a scene.
+ \qmlclass TextInput
+ The TextInput item allows you to add an editable line of text to a scene.
*/
QFxTextInput::QFxTextInput(QFxItem* parent)
: QFxPaintedItem(*(new QFxTextInputPrivate), parent)
@@ -78,9 +78,9 @@ QFxTextInput::~QFxTextInput()
}
/*!
- \qmlproperty string LineEdit::text
+ \qmlproperty string TextInput::text
- The text in the LineEdit.
+ The text in the TextInput.
*/
QString QFxTextInput::text() const
@@ -99,9 +99,9 @@ void QFxTextInput::setText(const QString &s)
}
/*!
- \qmlproperty font LineEdit::font
+ \qmlproperty font TextInput::font
- Set the LineEdit's font attributes. \c font.size sets the font's point size.
+ Set the TextInput's font attributes. \c font.size sets the font's point size.
*/
QFont QFxTextInput::font() const
{
@@ -125,7 +125,7 @@ void QFxTextInput::setFont(const QFont &font)
}
/*!
- \qmlproperty color LineEdit::color
+ \qmlproperty color TextInput::color
The text color.
*/
@@ -143,7 +143,7 @@ void QFxTextInput::setColor(const QColor &c)
/*!
- \qmlproperty color LineEdit::highlightColor
+ \qmlproperty color TextInput::highlightColor
The text highlight color, used behind selections.
*/
@@ -164,7 +164,7 @@ void QFxTextInput::setHighlightColor(const QColor &color)
}
/*!
- \qmlproperty color LineEdit::highlightedTextColor
+ \qmlproperty color TextInput::highlightedTextColor
The highlighted text color, used in selections.
*/
@@ -194,6 +194,7 @@ void QFxTextInput::setHAlign(HAlignment align)
{
Q_D(QFxTextInput);
d->hAlign = align;
+ //TODO: implement
}
bool QFxTextInput::isReadOnly() const
@@ -221,7 +222,7 @@ void QFxTextInput::setMaxLength(int ml)
}
/*!
- \qmlproperty bool LineEdit::cursorVisible
+ \qmlproperty bool TextInput::cursorVisible
If true the text edit shows a cursor.
This property is set and unset when the line edit gets focus, but it can also
@@ -244,8 +245,8 @@ void QFxTextInput::setCursorVisible(bool on)
}
/*!
- \qmlproperty int LineEdit::cursorPosition
- The position of the cursor in the LineEdit.
+ \qmlproperty int TextInput::cursorPosition
+ The position of the cursor in the TextInput.
*/
int QFxTextInput::cursorPosition() const
{
@@ -259,7 +260,7 @@ void QFxTextInput::setCursorPosition(int cp)
}
/*!
- \qmlproperty int LineEdit::selectionStart
+ \qmlproperty int TextInput::selectionStart
The cursor position before the first character in the current selection.
Setting this and selectionEnd allows you to specify a selection in the
@@ -287,7 +288,7 @@ void QFxTextInput::setSelectionStart(int s)
}
/*!
- \qmlproperty int LineEdit::selectionEnd
+ \qmlproperty int TextInput::selectionEnd
The cursor position after the last character in the current selection.
Setting this and selectionStart allows you to specify a selection in the
@@ -368,12 +369,12 @@ void QFxTextInput::setEchoMode(uint echo)
}
/*!
- \qmlproperty Component LineEdit::cursorDelegate
- The delegate for the cursor in the LineEdit.
+ \qmlproperty Component TextInput::cursorDelegate
+ The delegate for the cursor in the TextInput.
- If you set a cursorDelegate for a LineEdit, this delegate will be used for
+ If you set a cursorDelegate for a TextInput, this delegate will be used for
drawing the cursor instead of the standard cursor. An instance of the
- delegate will be created and managed by the LineEdit when a cursor is
+ delegate will be created and managed by the TextInput when a cursor is
needed, and the x property of delegate instance will be set so as
to be one pixel before the top left of the current character.
@@ -513,8 +514,15 @@ void QFxTextInput::drawContents(QPainter *p, const QRect &r)
p->restore();
}
+void QFxTextInput::selectAll()
+{
+ Q_D(QFxTextInput);
+ d->control->setSelection(0, d->control->text().length());
+}
+
+
/*!
- \qmlproperty bool LineEdit::smooth
+ \qmlproperty bool TextInput::smooth
Set this property if you want the text to be smoothly scaled or
transformed. Smooth filtering gives better visual quality, but is slower. If
diff --git a/src/declarative/fx/qfxtextinput.h b/src/declarative/fx/qfxtextinput.h
index fe72f1e..b5812d4 100644
--- a/src/declarative/fx/qfxtextinput.h
+++ b/src/declarative/fx/qfxtextinput.h
@@ -169,6 +169,9 @@ protected:
void focusChanged(bool hasFocus);
+public Q_SLOTS:
+ void selectAll();
+
private Q_SLOTS:
void updateSize();
void q_textChanged();