Implemented text changed notification for line edit widgets.

git-svn-id: http://voip.null.ro/svn/yate@2670 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2009-06-01 10:33:02 +00:00
parent fc09730381
commit 524e8a55c4
2 changed files with 22 additions and 0 deletions

View File

@ -1898,6 +1898,17 @@ void QtWindow::chooseFileRejected()
Client::self()->action(this,action,0);
}
// Text changed slot. Notify the client
void QtWindow::textChanged(const QString& text)
{
if (!sender())
return;
NamedList params("");
QtClient::getUtf8(params,"sender",sender()->objectName());
QtClient::getUtf8(params,"text",text);
Client::self()->action(this,"textchanged",&params);
}
void QtWindow::openUrl(const QString& link)
{
QDesktopServices::openUrl(QUrl(link));
@ -2308,6 +2319,15 @@ void QtWindow::doInit()
for (int i = 0; i < tabs.size(); i++)
QtClient::connectObjects(tabs[i],SIGNAL(currentChanged(int)),this,SLOT(selectionChanged()));
// Connect line edit signals
QList<QLineEdit*> le = qFindChildren<QLineEdit*>(this);
for (int i = 0; i < le.size(); i++) {
QVariant var = le[i]->property("dynamicTextChangedNotify");
if (var.toBool())
QtClient::connectObjects(le[i],SIGNAL(textChanged(const QString&)),this,
SLOT(textChanged(const QString&)));
}
// Process tables:
// Insert a column and connect signals
// Hide columns starting with "hidden:"

View File

@ -452,6 +452,8 @@ public slots:
void chooseFileAccepted();
// Choose file window was cancelled
void chooseFileRejected();
// Text changed slot. Notify the client
void textChanged(const QString& text);
private slots:
void openUrl(const QString& link);