Handle tab widgets in get/set select. Notify the client when a tab page is selected.

git-svn-id: http://yate.null.ro/svn/yate/trunk@2655 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2009-05-27 15:11:59 +00:00
parent 6c62be3718
commit 3dc240a079
1 changed files with 26 additions and 0 deletions

View File

@ -1162,6 +1162,19 @@ bool QtWindow::setSelect(const String& name, const String& item)
else
w.progressBar()->setValue(w.progressBar()->maximum());
return true;
case QtWidget::Tab:
d = w.tab()->count() - 1;
for (QString tmp = QtClient::setUtf8(item); d >= 0; d--) {
QWidget* wid = w.tab()->widget(d);
if (wid && wid->objectName() == tmp)
break;
}
if (d >= 0 && d < w.tab()->count()) {
w.tab()->setCurrentIndex(d);
return true;
}
return false;
}
return false;
}
@ -1726,6 +1739,14 @@ bool QtWindow::getSelect(const String& name, String& item)
return true;
case QtWidget::CustomTable:
return w.customTable()->getSelect(item);
case QtWidget::Tab:
{
item = "";
QWidget* wid = w.tab()->currentWidget();
if (wid)
QtClient::getUtf8(item,wid->objectName());
}
return true;
}
return false;
}
@ -2282,6 +2303,11 @@ void QtWindow::doInit()
this,SLOT(selectionChanged()));
}
// Connect tab widget signals
QList<QTabWidget*> tabs = qFindChildren<QTabWidget*>(this);
for (int i = 0; i < tabs.size(); i++)
QtClient::connectObjects(tabs[i],SIGNAL(currentChanged(int)),this,SLOT(selectionChanged()));
// Process tables:
// Insert a column and connect signals
// Hide columns starting with "hidden:"