Now custom widgets' parameters can be set when calling QtWindow::setParams().

git-svn-id: http://yate.null.ro/svn/yate/trunk@2162 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2008-08-15 10:02:51 +00:00
parent 0d5d1ddf79
commit 230549647b
1 changed files with 23 additions and 0 deletions

View File

@ -572,6 +572,29 @@ void QtWindow::context(const String& text)
bool QtWindow::setParams(const NamedList& params)
{
XDebug(QtDriver::self(),DebugAll,"QtWindow::setParams() [%p]",this);
// Check for custom widget params
if (params == "customwidget") {
// Each parameter is a list of parameters for a custom widget
// Parameter name is the widget's name
unsigned int n = params.length();
bool ok = false;
for (unsigned int i = 0; i < n; i++) {
NamedString* ns = params.getParam(i);
NamedList* nl = static_cast<NamedList*>(ns ? ns->getObject("NamedList") : 0);
if (!(nl && ns->name()))
continue;
// Find the widget and set its params
QtWidget w(this,ns->name());
if (w.type() == QtWidget::CustomTable)
ok = w.customTable()->setParams(*nl) && ok;
else
ok = false;
}
return ok;
}
// Window or other parameters
if (params.getBoolValue("modal"))
setWindowModality(Qt::ApplicationModal);
if (params.getBoolValue("minimized"))