diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-07-17 01:58:16 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-07-17 01:58:16 (GMT) |
commit | 00d841a494aff8d7158e355a5169d19c4f808573 (patch) | |
tree | 33bf7c993b785a1a7025393c43ea8d6f488a9a50 | |
parent | 1cea1e158e212f7182586c2963d7e28747d0140c (diff) | |
download | Qt-00d841a494aff8d7158e355a5169d19c4f808573.zip Qt-00d841a494aff8d7158e355a5169d19c4f808573.tar.gz Qt-00d841a494aff8d7158e355a5169d19c4f808573.tar.bz2 |
LineEdit cleanup.
-rw-r--r-- | src/declarative/fx/qfxlineedit.cpp | 28 | ||||
-rw-r--r-- | src/declarative/fx/qfxlineedit.h | 7 | ||||
-rw-r--r-- | src/declarative/fx/qfxlineedit_p.h | 6 |
3 files changed, 4 insertions, 37 deletions
diff --git a/src/declarative/fx/qfxlineedit.cpp b/src/declarative/fx/qfxlineedit.cpp index d23c325..24cf3fc 100644 --- a/src/declarative/fx/qfxlineedit.cpp +++ b/src/declarative/fx/qfxlineedit.cpp @@ -207,23 +207,6 @@ QString QFxLineEdit::selectedText() const return d->control->selectedText(); } -bool QFxLineEdit::isAwesome() const -{ - Q_D(const QFxLineEdit); - return d->awesome; -} - -#include <QTimer> //Can be removed along wit the property -void QFxLineEdit::setAwesome(bool a) -{ - Q_D(QFxLineEdit); - d->awesome = a; - if(a){ - setColor(QColor(0,0,255)); - rainbowRedraw(); - } -} - QObject* QFxLineEdit::validator() const { Q_D(const QFxLineEdit); @@ -462,7 +445,7 @@ void QFxLineEditPrivate::init() { Q_Q(QFxLineEdit); control->setCursorWidth(1); - control->setPasswordCharacter('*'); + control->setPasswordCharacter(QLatin1Char('*')); control->setLayoutDirection(Qt::LeftToRight); control->setSelection(0,0); q->setSmooth(true); @@ -530,14 +513,5 @@ void QFxLineEdit::updateSize() setContentsSize(QSize(width(), height())); } -void QFxLineEdit::rainbowRedraw() -{ - Q_D(QFxLineEdit); - if(!d->awesome) - return; - setColor(QColor::fromHsv((d->color.hue() + 5)%360, d->color.saturation(), d->color.value())); - updateAll(); - QTimer::singleShot(50, this, SLOT(rainbowRedraw())); -} QT_END_NAMESPACE diff --git a/src/declarative/fx/qfxlineedit.h b/src/declarative/fx/qfxlineedit.h index 5abb418..e053c54 100644 --- a/src/declarative/fx/qfxlineedit.h +++ b/src/declarative/fx/qfxlineedit.h @@ -84,8 +84,7 @@ class Q_DECLARATIVE_EXPORT QFxLineEdit : public QFxPaintedItem /* Q_PROPERTY(int scrollDuration READ scrollDuration SET setScrollDuration NOTIFY scrollDurationChanged); */ - //### Requested by Aaron K.(Remove before release?) - Q_PROPERTY(bool awesome READ isAwesome WRITE setAwesome); + public: QFxLineEdit(QFxItem* parent=0); ~QFxLineEdit(); @@ -148,9 +147,6 @@ public: bool hasAcceptableInput() const; - bool isAwesome() const; - void setAwesome(bool a); - void drawContents(QPainter *p,const QRect &r); Q_SIGNALS: void textChanged(); @@ -178,7 +174,6 @@ private slots: void updateAll(); void createCursor(); void moveCursor(); - void rainbowRedraw(); private: Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr, QFxLineEdit); diff --git a/src/declarative/fx/qfxlineedit_p.h b/src/declarative/fx/qfxlineedit_p.h index 8ee5cca..a0ab19c 100644 --- a/src/declarative/fx/qfxlineedit_p.h +++ b/src/declarative/fx/qfxlineedit_p.h @@ -65,9 +65,9 @@ class QFxLineEditPrivate : public QFxPaintedItemPrivate public: QFxLineEditPrivate() : control(new QLineControl(QString())), font(0), color((QRgb)0), style(QFxText::Normal), + styleColor((QRgb)0), hAlign(QFxText::AlignLeft), vAlign(QFxText::AlignTop), - styleColor((QRgb)0), oldScroll(0), hscroll(0), - focused(false), awesome(false) + hscroll(0), oldScroll(0), focused(false) { } @@ -96,8 +96,6 @@ public: int hscroll; int oldScroll; bool focused; - bool awesome; - }; QT_END_NAMESPACE |