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)
{
event->accept();
emit editingFinished();
} else {
QGraphicsTextItem::keyPressEvent(event); //let QT handle other keypresses
}
if (this->toHtml()!=oldText)
{
oldText=this->toHtml();
emit textChanged(oldText);
}
}
} // namespace Plasma

View File

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