Add textChanged(QString&) signal.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=678161
This commit is contained in:
Thomas Georgiou 2007-06-20 20:12:38 +00:00
parent 40c39333a1
commit c4ff3b9135
2 changed files with 7 additions and 1 deletions

View File

@ -135,11 +135,15 @@ void LineEdit::keyPressEvent(QKeyEvent* event)
{ {
if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return)
{ {
event->accept();
emit editingFinished(); emit editingFinished();
} else { } else {
QGraphicsTextItem::keyPressEvent(event); //let QT handle other keypresses QGraphicsTextItem::keyPressEvent(event); //let QT handle other keypresses
} }
if (this->toHtml()!=oldText)
{
oldText=this->toHtml();
emit textChanged(oldText);
}
} }
} // namespace Plasma } // namespace Plasma

View File

@ -60,6 +60,7 @@ class PLASMA_EXPORT LineEdit : public QGraphicsTextItem, public LayoutItem
Q_SIGNALS: Q_SIGNALS:
void editingFinished(); void editingFinished();
void textChanged(const QString &text);
public Q_SLOTS: public Q_SLOTS:
void updated(const QString&, const Plasma::DataEngine::Data&); void updated(const QString&, const Plasma::DataEngine::Data&);
@ -67,6 +68,7 @@ class PLASMA_EXPORT LineEdit : public QGraphicsTextItem, public LayoutItem
private: private:
class Private; class Private;
Private* const d; Private* const d;
QString oldText;
protected: protected:
void keyPressEvent(QKeyEvent* event); void keyPressEvent(QKeyEvent* event);