1 /***************************************************************************
2 effecstackview.cpp - description
5 copyright : (C) 2008 by Marco Gittler
6 email : g.marco@freenet.de
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
18 #include "effectstackedit.h"
19 #include "ui_constval_ui.h"
20 #include "ui_listval_ui.h"
21 #include "ui_boolval_ui.h"
22 #include "ui_wipeval_ui.h"
23 #include "ui_urlval_ui.h"
24 #include "complexparameter.h"
25 #include "geometryval.h"
26 #include "positionedit.h"
27 #include "projectlist.h"
28 #include "effectslist.h"
29 #include "kdenlivesettings.h"
30 #include "profilesdialog.h"
31 #include "kis_curve_widget.h"
32 #include "kis_cubic_curve.h"
33 #include "choosecolorwidget.h"
34 #include "geometrywidget.h"
38 #include <KFileDialog>
40 #include <QVBoxLayout>
43 #include <QPushButton>
45 #include <QScrollArea>
48 class Boolval: public QWidget, public Ui::Boolval_UI
52 class Constval: public QWidget, public Ui::Constval_UI
56 class Listval: public QWidget, public Ui::Listval_UI
60 class Wipeval: public QWidget, public Ui::Wipeval_UI
64 class Urlval: public QWidget, public Ui::Urlval_UI
68 QMap<QString, QImage> EffectStackEdit::iconCache;
70 EffectStackEdit::EffectStackEdit(Monitor *monitor, QWidget *parent) :
74 m_frameSize(QPoint()),
75 m_keyframeEditor(NULL),
78 m_baseWidget = new QWidget(this);
79 setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
80 setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
81 setFrameStyle(QFrame::NoFrame);
82 setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::MinimumExpanding));
84 setWidget(m_baseWidget);
85 setWidgetResizable(true);
86 m_vbox = new QVBoxLayout(m_baseWidget);
87 m_vbox->setContentsMargins(0, 0, 0, 0);
88 m_vbox->setSpacing(0);
92 EffectStackEdit::~EffectStackEdit()
98 void EffectStackEdit::setFrameSize(QPoint p)
101 QDomNodeList namenode = m_params.elementsByTagName("parameter");
102 for (int i = 0; i < namenode.count() ; i++) {
103 QDomNode pa = namenode.item(i);
104 QDomNode na = pa.firstChildElement("name");
105 QString type = pa.attributes().namedItem("type").nodeValue();
106 QString paramName = i18n(na.toElement().text().toUtf8().data());
108 if (type == "geometry") {
109 Geometryval *geom = ((Geometryval*)m_valueItems[paramName+"geometry"]);
110 geom->setFrameSize(m_frameSize);
116 void EffectStackEdit::updateTimecodeFormat()
118 if (m_keyframeEditor)
119 m_keyframeEditor->updateTimecodeFormat();
120 QDomNodeList namenode = m_params.elementsByTagName("parameter");
121 for (int i = 0; i < namenode.count() ; i++) {
122 QDomNode pa = namenode.item(i);
123 QDomNode na = pa.firstChildElement("name");
124 QString type = pa.attributes().namedItem("type").nodeValue();
125 QString paramName = i18n(na.toElement().text().toUtf8().data());
127 if (type == "geometry" && !KdenliveSettings::on_monitor_effects()) {
128 Geometryval *geom = ((Geometryval*)m_valueItems[paramName+"geometry"]);
129 geom->updateTimecodeFormat();
132 if (type == "position") {
133 PositionEdit *posi = ((PositionEdit*)m_valueItems[paramName+"position"]);
134 posi->updateTimecodeFormat();
140 void EffectStackEdit::updateProjectFormat(MltVideoProfile profile, Timecode t)
146 void EffectStackEdit::updateParameter(const QString &name, const QString &value)
148 m_params.setAttribute(name, value);
151 void EffectStackEdit::transferParamDesc(const QDomElement d, int pos, int in, int out)
154 if (m_keyframeEditor) delete m_keyframeEditor;
155 m_keyframeEditor = NULL;
159 if (m_params.isNull()) {
160 kDebug() << "// EMPTY EFFECT STACK";
165 doc.appendChild(doc.importNode(m_params, true));
166 kDebug() << "IMPORTED TRANS: " << doc.toString();*/
168 QDomNodeList namenode = m_params.elementsByTagName("parameter");
169 QDomElement e = m_params.toElement();
170 const int minFrame = e.attribute("start").toInt();
171 const int maxFrame = e.attribute("end").toInt();
174 for (int i = 0; i < namenode.count() ; i++) {
175 QDomElement pa = namenode.item(i).toElement();
176 QDomNode na = pa.firstChildElement("name");
177 QString type = pa.attribute("type");
178 QString paramName = i18n(na.toElement().text().toUtf8().data());
179 QWidget * toFillin = new QWidget(m_baseWidget);
180 QString value = pa.attribute("value").isNull() ?
181 pa.attribute("default") : pa.attribute("value");
183 /** Currently supported parameter types are:
184 * constant (=double): a slider with an integer value (use the "factor" attribute to divide the value so that you can get a double
185 * list: a combobox containing a list of values to choose
187 * complex: designed for keyframe parameters, but old and not finished, do not use
188 * geometry: a rectangle that can be moved & resized, with possible keyframes, used in composite transition
189 * keyframe: a list widget with a list of entries (position and value)
190 * color: a color chooser button
191 * position: a slider representing the position of a frame in the current clip
192 * curve: a single curve representing multiple points
193 * wipe: a widget designed for the wipe transition, allowing to choose a position (left, right, top,...)
196 if (type == "double" || type == "constant") {
199 if (pa.attribute("min").startsWith('%'))
200 min = (int) ProfilesDialog::getStringEval(m_profile, pa.attribute("min"));
202 min = pa.attribute("min").toInt();
203 if (pa.attribute("max").startsWith('%'))
204 max = (int) ProfilesDialog::getStringEval(m_profile, pa.attribute("max"));
206 max = pa.attribute("max").toInt();
207 createSliderItem(paramName, (int)(value.toDouble() + 0.5) , min, max, pa.attribute("suffix", QString()));
210 } else if (type == "list") {
211 Listval *lsval = new Listval;
212 lsval->setupUi(toFillin);
213 QStringList listitems = pa.attribute("paramlist").split(',');
214 QStringList listitemsdisplay = pa.attribute("paramlistdisplay").split(',');
215 if (listitemsdisplay.count() != listitems.count()) listitemsdisplay = listitems;
216 //lsval->list->addItems(listitems);
217 lsval->list->setIconSize(QSize(30, 30));
218 for (int i = 0; i < listitems.count(); i++) {
219 lsval->list->addItem(listitemsdisplay.at(i), listitems.at(i));
220 QString entry = listitems.at(i);
221 if (!entry.isEmpty() && (entry.endsWith(".png") || entry.endsWith(".pgm"))) {
222 if (!EffectStackEdit::iconCache.contains(entry)) {
224 EffectStackEdit::iconCache[entry] = pix.scaled(30, 30);
226 lsval->list->setItemIcon(i, QPixmap::fromImage(iconCache[entry]));
229 if (!value.isEmpty()) lsval->list->setCurrentIndex(listitems.indexOf(value));
230 lsval->title->setTitle(paramName);
231 m_valueItems[paramName] = lsval;
232 connect(lsval->list, SIGNAL(currentIndexChanged(int)) , this, SLOT(collectAllParameters()));
233 m_uiItems.append(lsval);
234 } else if (type == "bool") {
235 Boolval *bval = new Boolval;
236 bval->setupUi(toFillin);
237 bval->checkBox->setCheckState(value == "0" ? Qt::Unchecked : Qt::Checked);
238 bval->checkBox->setText(paramName);
239 m_valueItems[paramName] = bval;
240 connect(bval->checkBox, SIGNAL(stateChanged(int)) , this, SLOT(collectAllParameters()));
241 m_uiItems.append(bval);
242 } else if (type == "complex") {
243 /*QStringList names=nodeAtts.namedItem("name").nodeValue().split(';');
244 QStringList max=nodeAtts.namedItem("max").nodeValue().split(';');
245 QStringList min=nodeAtts.namedItem("min").nodeValue().split(';');
246 QStringList val=value.split(';');
247 kDebug() << "in complex"<<names.size() << " " << max.size() << " " << min.size() << " " << val.size() ;
248 if ( (names.size() == max.size() ) &&
249 (names.size()== min.size()) &&
250 (names.size()== val.size()) )
252 for (int i=0;i< names.size();i++){
253 createSliderItem(names[i],val[i].toInt(),min[i].toInt(),max[i].toInt());
256 ComplexParameter *pl = new ComplexParameter;
257 pl->setupParam(d, pa.attribute("name"), 0, 100);
258 m_vbox->addWidget(pl);
259 m_valueItems[paramName+"complex"] = pl;
260 connect(pl, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
261 } else if (type == "geometry") {
262 if (KdenliveSettings::on_monitor_effects()) {
263 GeometryWidget *geometry = new GeometryWidget(m_monitor, pos, this);
264 if (minFrame == maxFrame)
265 geometry->setupParam(pa, m_in, m_out);
267 geometry->setupParam(pa, minFrame, maxFrame);
268 m_vbox->addWidget(geometry);
269 m_valueItems[paramName+"geometry"] = geometry;
270 connect(geometry, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
272 Geometryval *geo = new Geometryval(m_profile, m_timecode, m_frameSize, pos);
273 if (minFrame == maxFrame)
274 geo->setupParam(pa, m_in, m_out);
276 geo->setupParam(pa, minFrame, maxFrame);
277 m_vbox->addWidget(geo);
278 m_valueItems[paramName+"geometry"] = geo;
279 connect(geo, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
280 connect(geo, SIGNAL(seekToPos(int)), this, SIGNAL(seekTimeline(int)));
282 } else if (type == "keyframe" || type == "simplekeyframe") {
283 //Â keyframe editor widget
284 kDebug() << "min: " << m_in << ", MAX: " << m_out;
285 if (m_keyframeEditor == NULL) {
286 KeyframeEdit *geo = new KeyframeEdit(pa, m_in, m_in + m_out, pa.attribute("min").toInt(), pa.attribute("max").toInt(), m_timecode, e.attribute("active_keyframe", "-1").toInt());
287 m_vbox->addWidget(geo);
288 m_valueItems[paramName+"keyframe"] = geo;
289 m_keyframeEditor = geo;
290 connect(geo, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
291 connect(geo, SIGNAL(seekToPos(int)), this, SIGNAL(seekTimeline(int)));
293 // we already have a keyframe editor, so just add another column for the new param
294 m_keyframeEditor->addParameter(pa);
296 } else if (type == "color") {
297 if (value.startsWith('#'))
298 value = value.replace('#', "0x");
300 ChooseColorWidget *choosecolor = new ChooseColorWidget(paramName, QColor(value.toUInt(&ok, 16)), this);
301 m_vbox->addWidget(choosecolor);
302 m_valueItems[paramName] = choosecolor;
303 connect(choosecolor, SIGNAL(displayMessage(const QString&, int)), this, SIGNAL(displayMessage(const QString&, int)));
304 connect(choosecolor, SIGNAL(modified()) , this, SLOT(collectAllParameters()));
305 } else if (type == "position") {
306 int pos = value.toInt();
307 if (d.attribute("id") == "fadein" || d.attribute("id") == "fade_from_black") {
309 } else if (d.attribute("id") == "fadeout" || d.attribute("id") == "fade_to_black") {
310 // fadeout position starts from clip end
311 pos = m_out - (pos - m_in);
313 PositionEdit *posedit = new PositionEdit(paramName, pos, 1, m_out, m_timecode);
314 m_vbox->addWidget(posedit);
315 m_valueItems[paramName+"position"] = posedit;
316 connect(posedit, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
317 } else if (type == "curve") {
318 KisCurveWidget *curve = new KisCurveWidget(this);
319 curve->setMaxPoints(pa.attribute("max").toInt());
320 QList<QPointF> points;
321 int number = EffectsList::parameter(e, pa.attribute("number")).toInt();
322 QString inName = pa.attribute("inpoints");
323 QString outName = pa.attribute("outpoints");
324 int start = pa.attribute("min").toInt();
325 for (int j = start; j <= number; j++) {
327 in.replace("%i", QString::number(j));
328 QString out = outName;
329 out.replace("%i", QString::number(j));
330 points << QPointF(EffectsList::parameter(e, in).toDouble(), EffectsList::parameter(e, out).toDouble());
332 if (!points.isEmpty())
333 curve->setCurve(KisCubicCurve(points));
334 QSpinBox *spinin = new QSpinBox();
335 spinin->setRange(0, 1000);
336 QSpinBox *spinout = new QSpinBox();
337 spinout->setRange(0, 1000);
338 curve->setupInOutControls(spinin, spinout, 0, 1000);
339 m_vbox->addWidget(curve);
340 m_vbox->addWidget(spinin);
341 m_vbox->addWidget(spinout);
342 connect(curve, SIGNAL(modified()), this, SLOT(collectAllParameters()));
343 m_valueItems[paramName] = curve;
344 } else if (type == "wipe") {
345 Wipeval *wpval = new Wipeval;
346 wpval->setupUi(toFillin);
347 wipeInfo w = getWipeInfo(value);
350 wpval->start_up->setChecked(true);
353 wpval->start_down->setChecked(true);
356 wpval->start_right->setChecked(true);
359 wpval->start_left->setChecked(true);
362 wpval->start_center->setChecked(true);
367 wpval->end_up->setChecked(true);
370 wpval->end_down->setChecked(true);
373 wpval->end_right->setChecked(true);
376 wpval->end_left->setChecked(true);
379 wpval->end_center->setChecked(true);
382 wpval->start_transp->setValue(w.startTransparency);
383 wpval->end_transp->setValue(w.endTransparency);
384 m_valueItems[paramName] = wpval;
385 connect(wpval->end_up, SIGNAL(clicked()), this, SLOT(collectAllParameters()));
386 connect(wpval->end_down, SIGNAL(clicked()), this, SLOT(collectAllParameters()));
387 connect(wpval->end_left, SIGNAL(clicked()), this, SLOT(collectAllParameters()));
388 connect(wpval->end_right, SIGNAL(clicked()), this, SLOT(collectAllParameters()));
389 connect(wpval->end_center, SIGNAL(clicked()), this, SLOT(collectAllParameters()));
390 connect(wpval->start_up, SIGNAL(clicked()), this, SLOT(collectAllParameters()));
391 connect(wpval->start_down, SIGNAL(clicked()), this, SLOT(collectAllParameters()));
392 connect(wpval->start_left, SIGNAL(clicked()), this, SLOT(collectAllParameters()));
393 connect(wpval->start_right, SIGNAL(clicked()), this, SLOT(collectAllParameters()));
394 connect(wpval->start_center, SIGNAL(clicked()), this, SLOT(collectAllParameters()));
395 connect(wpval->start_transp, SIGNAL(valueChanged(int)), this, SLOT(collectAllParameters()));
396 connect(wpval->end_transp, SIGNAL(valueChanged(int)), this, SLOT(collectAllParameters()));
397 //wpval->title->setTitle(na.toElement().text());
398 m_uiItems.append(wpval);
399 } else if (type == "url") {
400 Urlval *cval = new Urlval;
401 cval->setupUi(toFillin);
402 cval->label->setText(paramName);
403 cval->urlwidget->fileDialog()->setFilter(ProjectList::getExtensions());
404 m_valueItems[paramName] = cval;
405 cval->urlwidget->setUrl(KUrl(value));
406 connect(cval->urlwidget, SIGNAL(returnPressed()) , this, SLOT(collectAllParameters()));
407 connect(cval->urlwidget, SIGNAL(urlSelected(const KUrl&)) , this, SLOT(collectAllParameters()));
408 m_uiItems.append(cval);
415 m_vbox->addWidget(toFillin);
417 m_vbox->addStretch();
420 wipeInfo EffectStackEdit::getWipeInfo(QString value)
423 QString start = value.section(';', 0, 0);
424 QString end = value.section(';', 1, 1).section('=', 1, 1);
426 if (start.startsWith("-100%,0"))
428 else if (start.startsWith("100%,0"))
430 else if (start.startsWith("0%,100%"))
432 else if (start.startsWith("0%,-100%"))
437 if (start.count(':') == 2)
438 info.startTransparency = start.section(':', -1).toInt();
440 info.startTransparency = 100;
442 if (end.startsWith("-100%,0"))
444 else if (end.startsWith("100%,0"))
446 else if (end.startsWith("0%,100%"))
448 else if (end.startsWith("0%,-100%"))
453 if (end.count(':') == 2)
454 info.endTransparency = end.section(':', -1).toInt();
456 info.endTransparency = 100;
461 QString EffectStackEdit::getWipeString(wipeInfo info)
466 switch (info.start) {
468 start = "-100%,0%:100%x100%";
471 start = "100%,0%:100%x100%";
474 start = "0%,100%:100%x100%";
477 start = "0%,-100%:100%x100%";
480 start = "0%,0%:100%x100%";
483 start.append(':' + QString::number(info.startTransparency));
487 end = "-100%,0%:100%x100%";
490 end = "100%,0%:100%x100%";
493 end = "0%,100%:100%x100%";
496 end = "0%,-100%:100%x100%";
499 end = "0%,0%:100%x100%";
502 end.append(':' + QString::number(info.endTransparency));
503 return QString(start + ";-1=" + end);
506 void EffectStackEdit::collectAllParameters()
508 if (m_valueItems.isEmpty() || m_params.isNull()) return;
509 const QDomElement oldparam = m_params.cloneNode().toElement();
510 QDomElement newparam = oldparam.cloneNode().toElement();
511 QDomNodeList namenode = newparam.elementsByTagName("parameter");
513 for (int i = 0; i < namenode.count() ; i++) {
514 QDomNode pa = namenode.item(i);
515 QDomNode na = pa.firstChildElement("name");
516 QString type = pa.attributes().namedItem("type").nodeValue();
517 QString paramName = i18n(na.toElement().text().toUtf8().data());
518 if (type == "complex")
519 paramName.append("complex");
520 else if (type == "position")
521 paramName.append("position");
522 else if (type == "geometry")
523 paramName.append("geometry");
524 else if (type == "keyframe")
525 paramName.append("keyframe");
526 if (type != "simplekeyframe" && !m_valueItems.contains(paramName)) {
527 kDebug() << "// Param: " << paramName << " NOT FOUND";
532 if (type == "double" || type == "constant") {
533 QSlider* slider = ((Constval*)m_valueItems.value(paramName))->horizontalSlider;
534 setValue = QString::number(slider->value());
535 } else if (type == "list") {
536 KComboBox *box = ((Listval*)m_valueItems.value(paramName))->list;
537 setValue = box->itemData(box->currentIndex()).toString();
538 } else if (type == "bool") {
539 QCheckBox *box = ((Boolval*)m_valueItems.value(paramName))->checkBox;
540 setValue = box->checkState() == Qt::Checked ? "1" : "0" ;
541 } else if (type == "color") {
542 ChooseColorWidget *choosecolor = ((ChooseColorWidget*)m_valueItems.value(paramName));
543 setValue = choosecolor->getColor().name();
544 } else if (type == "complex") {
545 ComplexParameter *complex = ((ComplexParameter*)m_valueItems.value(paramName));
546 namenode.item(i) = complex->getParamDesc();
547 } else if (type == "geometry") {
548 if (KdenliveSettings::on_monitor_effects()) {
549 GeometryWidget *geometry = ((GeometryWidget*)m_valueItems.value(paramName));
550 namenode.item(i).toElement().setAttribute("value", geometry->getValue());
552 Geometryval *geom = ((Geometryval*)m_valueItems.value(paramName));
553 namenode.item(i).toElement().setAttribute("value", geom->getValue());
555 } else if (type == "position") {
556 PositionEdit *pedit = ((PositionEdit*)m_valueItems.value(paramName));
557 int pos = pedit->getPosition();
558 setValue = QString::number(pos);
559 if (newparam.attribute("id") == "fadein" || newparam.attribute("id") == "fade_from_black") {
560 // Make sure duration is not longer than clip
563 pedit->setPosition(pos);
565 EffectsList::setParameter(newparam, "in", QString::number(m_in));
566 EffectsList::setParameter(newparam, "out", QString::number(m_in + pos));
568 } else if (newparam.attribute("id") == "fadeout" || newparam.attribute("id") == "fade_to_black") {
569 // Make sure duration is not longer than clip
572 pedit->setPosition(pos);
574 EffectsList::setParameter(newparam, "in", QString::number(m_out + m_in - pos));
575 EffectsList::setParameter(newparam, "out", QString::number(m_out + m_in));
578 } else if (type == "curve") {
579 KisCurveWidget *curve = ((KisCurveWidget*)m_valueItems.value(paramName));
580 QList<QPointF> points = curve->curve().points();
581 QString number = pa.attributes().namedItem("number").nodeValue();
582 QString inName = pa.attributes().namedItem("inpoints").nodeValue();
583 QString outName = pa.attributes().namedItem("outpoints").nodeValue();
584 int off = pa.attributes().namedItem("min").nodeValue().toInt();
585 int end = pa.attributes().namedItem("max").nodeValue().toInt();
586 EffectsList::setParameter(newparam, number, QString::number(points.count()));
587 for (int j = 0; (j < points.count() && j + off <= end); j++) {
589 in.replace("%i", QString::number(j + off));
590 QString out = outName;
591 out.replace("%i", QString::number(j + off));
592 EffectsList::setParameter(newparam, in, QString::number(points.at(j).x()));
593 EffectsList::setParameter(newparam, out, QString::number(points.at(j).y()));
595 } else if (type == "wipe") {
596 Wipeval *wp = (Wipeval*)m_valueItems.value(paramName);
598 if (wp->start_left->isChecked())
600 else if (wp->start_right->isChecked())
602 else if (wp->start_up->isChecked())
604 else if (wp->start_down->isChecked())
606 else if (wp->start_center->isChecked())
610 info.startTransparency = wp->start_transp->value();
612 if (wp->end_left->isChecked())
614 else if (wp->end_right->isChecked())
616 else if (wp->end_up->isChecked())
618 else if (wp->end_down->isChecked())
620 else if (wp->end_center->isChecked())
624 info.endTransparency = wp->end_transp->value();
626 setValue = getWipeString(info);
627 } else if ((type == "simplekeyframe" || type == "keyframe") && m_keyframeEditor) {
628 QString realName = i18n(na.toElement().text().toUtf8().data());
629 QString val = m_keyframeEditor->getValue(realName);
630 kDebug() << "SET VALUE: " << val;
631 namenode.item(i).toElement().setAttribute("keyframes", val);
632 } else if (type == "url") {
633 KUrlRequester *req = ((Urlval*)m_valueItems.value(paramName))->urlwidget;
634 setValue = req->url().path();
637 if (!setValue.isNull())
638 pa.attributes().namedItem("value").setNodeValue(setValue);
641 emit parameterChanged(oldparam, newparam);
644 void EffectStackEdit::createSliderItem(const QString& name, int val , int min, int max, const QString suffix)
646 QWidget* toFillin = new QWidget(m_baseWidget);
647 Constval *ctval = new Constval;
648 ctval->setupUi(toFillin);
649 ctval->horizontalSlider->setMinimum(min);
650 ctval->horizontalSlider->setMaximum(max);
651 if (!suffix.isEmpty()) ctval->spinBox->setSuffix(suffix);
652 ctval->spinBox->setMinimum(min);
653 ctval->spinBox->setMaximum(max);
654 ctval->horizontalSlider->setPageStep((int)(max - min) / 10);
655 ctval->horizontalSlider->setValue(val);
656 ctval->label->setText(name);
657 m_valueItems[name] = ctval;
658 m_uiItems.append(ctval);
659 connect(ctval->horizontalSlider, SIGNAL(valueChanged(int)) , this, SLOT(collectAllParameters()));
660 m_vbox->addWidget(toFillin);
663 void EffectStackEdit::slotSliderMoved(int)
665 collectAllParameters();
668 void EffectStackEdit::clearAllItems()
671 m_valueItems.clear();
673 /*while (!m_items.isEmpty()) {
674 QWidget *die = m_items.takeFirst();
678 //qDeleteAll(m_uiItems);
680 while ((child = m_vbox->takeAt(0)) != 0) {
681 QWidget *wid = child->widget();
685 m_keyframeEditor = NULL;