summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2009-08-19 04:40:46 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2009-08-19 04:40:46 (GMT)
commit78a1ceb440510e148b98b0d0d894063756f1b4b6 (patch)
tree6b09c51526779b6e9fc6fac7a90d0923af0ae577
parentb763dee21dc82fa2abb2f9f038a0253e4e8ed848 (diff)
downloadQt-78a1ceb440510e148b98b0d0d894063756f1b4b6.zip
Qt-78a1ceb440510e148b98b0d0d894063756f1b4b6.tar.gz
Qt-78a1ceb440510e148b98b0d0d894063756f1b4b6.tar.bz2
Update demos
Remove uses of margin for positioners. Update MediaLineEdit to use a TextInput, in the process added a selectAll() slot to TextInput (like TextEdit has).
-rw-r--r--demos/declarative/calculator/calculator.qml2
-rw-r--r--demos/declarative/contacts/Contact.qml5
-rw-r--r--demos/declarative/flickr/content/MediaLineEdit.qml2
-rw-r--r--src/declarative/fx/qfxtextinput.cpp8
-rw-r--r--src/declarative/fx/qfxtextinput.h3
5 files changed, 16 insertions, 4 deletions
diff --git a/demos/declarative/calculator/calculator.qml b/demos/declarative/calculator/calculator.qml
index f766a30..56bdc4d 100644
--- a/demos/declarative/calculator/calculator.qml
+++ b/demos/declarative/calculator/calculator.qml
@@ -8,7 +8,7 @@ Rect {
Script { source: "calculator.js" }
VerticalPositioner {
- x: 2; spacing: 10; margin: 2
+ x: 2; spacing: 10;
Rect {
id: Container
diff --git a/demos/declarative/contacts/Contact.qml b/demos/declarative/contacts/Contact.qml
index c6ed906..d02157c 100644
--- a/demos/declarative/contacts/Contact.qml
+++ b/demos/declarative/contacts/Contact.qml
@@ -82,9 +82,10 @@ Item {
}
VerticalPositioner {
id: layout
- anchors.fill: parent
+ width: contents.width
+ height:contents.height
+ anchors.centerIn: parent
spacing: 5
- margin: 5
ContactField {
id: labelField
anchors.left: layout.left
diff --git a/demos/declarative/flickr/content/MediaLineEdit.qml b/demos/declarative/flickr/content/MediaLineEdit.qml
index e175b4e..1642d44 100644
--- a/demos/declarative/flickr/content/MediaLineEdit.qml
+++ b/demos/declarative/flickr/content/MediaLineEdit.qml
@@ -86,7 +86,7 @@ Item {
text: Container.label + "..."
}
- TextEdit {
+ TextInput {
id: Editor
font.bold: true
color: "white"
diff --git a/src/declarative/fx/qfxtextinput.cpp b/src/declarative/fx/qfxtextinput.cpp
index 1407a78..eb6c5bf 100644
--- a/src/declarative/fx/qfxtextinput.cpp
+++ b/src/declarative/fx/qfxtextinput.cpp
@@ -194,6 +194,7 @@ void QFxTextInput::setHAlign(HAlignment align)
{
Q_D(QFxTextInput);
d->hAlign = align;
+ //TODO: implement
}
bool QFxTextInput::isReadOnly() const
@@ -513,6 +514,13 @@ 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
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();