]> git.sesse.net Git - kdenlive/blob - src/renderwidget.cpp
Fix file dialog in render widget
[kdenlive] / src / renderwidget.cpp
1 /***************************************************************************
2  *   Copyright (C) 2008 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
3  *                                                                         *
4  *   This program is free software; you can redistribute it and/or modify  *
5  *   it under the terms of the GNU General Public License as published by  *
6  *   the Free Software Foundation; either version 2 of the License, or     *
7  *   (at your option) any later version.                                   *
8  *                                                                         *
9  *   This program is distributed in the hope that it will be useful,       *
10  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12  *   GNU General Public License for more details.                          *
13  *                                                                         *
14  *   You should have received a copy of the GNU General Public License     *
15  *   along with this program; if not, write to the                         *
16  *   Free Software Foundation, Inc.,                                       *
17  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
18  ***************************************************************************/
19
20
21 #include <QDomDocument>
22
23 #include <KStandardDirs>
24 #include <KDebug>
25 #include <KMessageBox>
26 #include <KComboBox>
27
28 #include "kdenlivesettings.h"
29 #include "renderwidget.h"
30 #include "ui_saveprofile_ui.h"
31
32 const int GroupRole = Qt::UserRole;
33 const int ExtensionRole = GroupRole + 1;
34 const int StandardRole = GroupRole + 2;
35 const int RenderRole = GroupRole + 3;
36 const int ParamsRole = GroupRole + 4;
37 const int EditableRole = GroupRole + 5;
38
39 RenderWidget::RenderWidget(QWidget * parent): QDialog(parent) {
40     m_view.setupUi(this);
41     m_view.buttonDelete->setIcon(KIcon("trash-empty"));
42     m_view.buttonDelete->setToolTip(i18n("Delete profile"));
43     m_view.buttonDelete->setEnabled(false);
44
45     m_view.buttonEdit->setIcon(KIcon("document-properties"));
46     m_view.buttonEdit->setToolTip(i18n("Edit profile"));
47     m_view.buttonEdit->setEnabled(false);
48
49     m_view.buttonSave->setIcon(KIcon("document-new"));
50     m_view.buttonSave->setToolTip(i18n("Create new profile"));
51
52     m_view.buttonInfo->setIcon(KIcon("help-about"));
53
54     if (KdenliveSettings::showrenderparams()) {
55         m_view.buttonInfo->setDown(true);
56     } else m_view.advanced_params->hide();
57
58     m_view.experimentalrender->setChecked(KdenliveSettings::experimentalrender());
59
60     m_view.experimentalrender->setToolTip(i18n("Changing the size of video when rendering\nis not fully supported, you may have problems\nwith some effects or title clips, so the export\nprofiles that resize your video are marked as\nexperimental"));
61
62     connect(m_view.buttonInfo, SIGNAL(clicked()), this, SLOT(showInfoPanel()));
63
64     connect(m_view.buttonSave, SIGNAL(clicked()), this, SLOT(slotSaveProfile()));
65     connect(m_view.buttonEdit, SIGNAL(clicked()), this, SLOT(slotEditProfile()));
66     connect(m_view.buttonDelete, SIGNAL(clicked()), this, SLOT(slotDeleteProfile()));
67     connect(m_view.buttonStart, SIGNAL(clicked()), this, SLOT(slotExport()));
68     connect(m_view.out_file, SIGNAL(textChanged(const QString &)), this, SLOT(slotUpdateButtons()));
69     connect(m_view.format_list, SIGNAL(currentRowChanged(int)), this, SLOT(refreshView()));
70     connect(m_view.size_list, SIGNAL(currentRowChanged(int)), this, SLOT(refreshParams()));
71
72     connect(m_view.render_guide, SIGNAL(clicked(bool)), this, SLOT(slotUpdateGuideBox()));
73     connect(m_view.render_zone, SIGNAL(clicked(bool)), this, SLOT(slotUpdateGuideBox()));
74     connect(m_view.render_full, SIGNAL(clicked(bool)), this, SLOT(slotUpdateGuideBox()));
75
76     connect(m_view.guide_end, SIGNAL(activated(int)), this, SLOT(slotCheckStartGuidePosition()));
77     connect(m_view.guide_start, SIGNAL(activated(int)), this, SLOT(slotCheckEndGuidePosition()));
78
79     connect(m_view.format_selection, SIGNAL(activated(int)), this, SLOT(refreshView()));
80     connect(m_view.experimentalrender, SIGNAL(stateChanged(int)), this, SLOT(slotUpdateExperimentalRendering()));
81
82     m_view.buttonStart->setEnabled(false);
83     m_view.guides_box->setVisible(false);
84     parseProfiles();
85     m_view.splitter->setStretchFactor(1, 5);
86     m_view.splitter->setStretchFactor(0, 2);
87
88     m_view.out_file->setMode(KFile::File);
89     focusFirstVisibleItem();
90 }
91
92 void RenderWidget::slotUpdateExperimentalRendering() {
93     KdenliveSettings::setExperimentalrender(m_view.experimentalrender->isChecked());
94     refreshView();
95 }
96
97
98 void RenderWidget::showInfoPanel() {
99     if (m_view.advanced_params->isVisible()) {
100         m_view.advanced_params->setVisible(false);
101         m_view.buttonInfo->setDown(false);
102         KdenliveSettings::setShowrenderparams(false);
103     } else {
104         m_view.advanced_params->setVisible(true);
105         m_view.buttonInfo->setDown(true);
106         KdenliveSettings::setShowrenderparams(true);
107     }
108 }
109
110 void RenderWidget::slotUpdateGuideBox() {
111     m_view.guides_box->setVisible(m_view.render_guide->isChecked());
112 }
113
114 void RenderWidget::slotCheckStartGuidePosition() {
115     if (m_view.guide_start->currentIndex() > m_view.guide_end->currentIndex())
116         m_view.guide_start->setCurrentIndex(m_view.guide_end->currentIndex());
117 }
118
119 void RenderWidget::slotCheckEndGuidePosition() {
120     if (m_view.guide_end->currentIndex() < m_view.guide_start->currentIndex())
121         m_view.guide_end->setCurrentIndex(m_view.guide_start->currentIndex());
122 }
123
124 void RenderWidget::setGuides(QDomElement guidesxml, double duration) {
125     m_view.guide_start->clear();
126     m_view.guide_end->clear();
127     QDomNodeList nodes = guidesxml.elementsByTagName("guide");
128     if (nodes.count() > 0) {
129         m_view.guide_start->addItem(i18n("Render"), "0");
130         m_view.render_guide->setEnabled(true);
131     } else m_view.render_guide->setEnabled(false);
132     for (int i = 0; i < nodes.count(); i++) {
133         QDomElement e = nodes.item(i).toElement();
134         if (!e.isNull()) {
135             m_view.guide_start->addItem(e.attribute("comment"), e.attribute("time").toDouble());
136             m_view.guide_end->addItem(e.attribute("comment"), e.attribute("time").toDouble());
137         }
138     }
139     if (nodes.count() > 0)
140         m_view.guide_end->addItem(i18n("End"), QString::number(duration));
141 }
142
143 void RenderWidget::slotUpdateButtons() {
144     if (m_view.out_file->url().isEmpty()) m_view.buttonStart->setEnabled(false);
145     else m_view.buttonStart->setEnabled(true);
146 }
147
148 void RenderWidget::slotSaveProfile() {
149     Ui::SaveProfile_UI ui;
150     QDialog *d = new QDialog(this);
151     ui.setupUi(d);
152     QString customGroup = i18n("Custom");
153     QStringList groupNames;
154     for (int i = 0; i < m_view.format_list->count(); i++)
155         groupNames.append(m_view.format_list->item(i)->text());
156     if (!groupNames.contains(customGroup)) groupNames.prepend(customGroup);
157     ui.group_name->addItems(groupNames);
158     int pos = ui.group_name->findText(customGroup);
159     ui.group_name->setCurrentIndex(pos);
160
161     ui.parameters->setText(m_view.advanced_params->toPlainText());
162     ui.extension->setText(m_view.size_list->currentItem()->data(ExtensionRole).toString());
163     ui.profile_name->setFocus();
164     if (d->exec() == QDialog::Accepted && !ui.profile_name->text().simplified().isEmpty()) {
165         QString exportFile = KStandardDirs::locateLocal("appdata", "export/customprofiles.xml");
166         QDomDocument doc;
167         QFile file(exportFile);
168         doc.setContent(&file, false);
169         file.close();
170
171         QDomElement documentElement;
172         bool groupExists = false;
173         QString groupName;
174         QString newProfileName = ui.profile_name->text().simplified();
175         QString newGroupName = ui.group_name->currentText();
176         QDomNodeList groups = doc.elementsByTagName("group");
177         int i = 0;
178         if (groups.count() == 0) {
179             QDomElement profiles = doc.createElement("profiles");
180             doc.appendChild(profiles);
181         } else while (!groups.item(i).isNull()) {
182                 documentElement = groups.item(i).toElement();
183                 groupName = documentElement.attribute("name");
184                 kDebug() << "// SAVE, PARSING FROUP: " << i << ", name: " << groupName << ", LOOK FR: " << newGroupName;
185                 if (groupName == newGroupName) {
186                     groupExists = true;
187                     break;
188                 }
189                 i++;
190             }
191         if (!groupExists) {
192             documentElement = doc.createElement("group");
193             documentElement.setAttribute("name", ui.group_name->currentText());
194             documentElement.setAttribute("renderer", "avformat");
195             doc.documentElement().appendChild(documentElement);
196         }
197         QDomElement profileElement = doc.createElement("profile");
198         profileElement.setAttribute("name", newProfileName);
199         profileElement.setAttribute("extension", ui.extension->text().simplified());
200         profileElement.setAttribute("args", ui.parameters->toPlainText().simplified());
201         documentElement.appendChild(profileElement);
202
203         //QCString save = doc.toString().utf8();
204
205         if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
206             KMessageBox::sorry(this, i18n("Unable to write to file %1", exportFile));
207             delete d;
208             return;
209         }
210         QTextStream out(&file);
211         out << doc.toString();
212         file.close();
213         parseProfiles(newGroupName, newProfileName);
214     }
215     delete d;
216 }
217
218 void RenderWidget::slotEditProfile() {
219     QListWidgetItem *item = m_view.size_list->currentItem();
220     if (!item) return;
221     QString currentGroup = m_view.format_list->currentItem()->text();
222
223     QString params = item->data(ParamsRole).toString();
224     QString extension = item->data(ExtensionRole).toString();
225     QString currentProfile = item->text();
226
227     Ui::SaveProfile_UI ui;
228     QDialog *d = new QDialog(this);
229     ui.setupUi(d);
230     QStringList groupNames;
231     for (int i = 0; i < m_view.format_list->count(); i++)
232         groupNames.append(m_view.format_list->item(i)->text());
233     if (!groupNames.contains(currentGroup)) groupNames.prepend(currentGroup);
234     ui.group_name->addItems(groupNames);
235     int pos = ui.group_name->findText(currentGroup);
236     ui.group_name->setCurrentIndex(pos);
237     ui.profile_name->setText(currentProfile);
238     ui.extension->setText(extension);
239     ui.parameters->setText(params);
240     ui.profile_name->setFocus();
241
242     if (d->exec() == QDialog::Accepted) {
243         slotDeleteProfile();
244         QString exportFile = KStandardDirs::locateLocal("appdata", "export/customprofiles.xml");
245         QDomDocument doc;
246         QFile file(exportFile);
247         doc.setContent(&file, false);
248         file.close();
249
250         QDomElement documentElement;
251         bool groupExists = false;
252         QString groupName;
253         QString newProfileName = ui.profile_name->text();
254         QString newGroupName = ui.group_name->currentText();
255         QDomNodeList groups = doc.elementsByTagName("group");
256         int i = 0;
257         if (groups.count() == 0) {
258             QDomElement profiles = doc.createElement("profiles");
259             doc.appendChild(profiles);
260         } else while (!groups.item(i).isNull()) {
261                 documentElement = groups.item(i).toElement();
262                 groupName = documentElement.attribute("name");
263                 kDebug() << "// SAVE, PARSING FROUP: " << i << ", name: " << groupName << ", LOOK FR: " << newGroupName;
264                 if (groupName == newGroupName) {
265                     groupExists = true;
266                     break;
267                 }
268                 i++;
269             }
270         if (!groupExists) {
271             documentElement = doc.createElement("group");
272             documentElement.setAttribute("name", ui.group_name->currentText());
273             documentElement.setAttribute("renderer", "avformat");
274             doc.documentElement().appendChild(documentElement);
275         }
276         QDomElement profileElement = doc.createElement("profile");
277         profileElement.setAttribute("name", newProfileName);
278         profileElement.setAttribute("extension", ui.extension->text().simplified());
279         profileElement.setAttribute("args", ui.parameters->toPlainText().simplified());
280         documentElement.appendChild(profileElement);
281
282         //QCString save = doc.toString().utf8();
283
284         if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
285             KMessageBox::sorry(this, i18n("Unable to write to file %1", exportFile));
286             delete d;
287             return;
288         }
289         QTextStream out(&file);
290         out << doc.toString();
291         file.close();
292         parseProfiles(newGroupName, newProfileName);
293     }
294     delete d;
295 }
296
297 void RenderWidget::slotDeleteProfile() {
298     QString currentGroup = m_view.format_list->currentItem()->text();
299     QString currentProfile = m_view.size_list->currentItem()->text();
300
301     QString exportFile = KStandardDirs::locateLocal("appdata", "export/customprofiles.xml");
302     QDomDocument doc;
303     QFile file(exportFile);
304     doc.setContent(&file, false);
305     file.close();
306
307     QDomElement documentElement;
308     bool groupExists = false;
309     QString groupName;
310     QDomNodeList groups = doc.elementsByTagName("group");
311     int i = 0;
312
313     while (!groups.item(i).isNull()) {
314         documentElement = groups.item(i).toElement();
315         groupName = documentElement.attribute("name");
316         if (groupName == currentGroup) {
317             QDomNodeList children = documentElement.childNodes();
318             for (int j = 0; j < children.count(); j++) {
319                 QDomElement pro = children.at(j).toElement();
320                 if (pro.attribute("name") == currentProfile) {
321                     groups.item(i).removeChild(children.at(j));
322                     if (groups.item(i).childNodes().isEmpty())
323                         doc.documentElement().removeChild(groups.item(i));
324                     break;
325                 }
326             }
327             break;
328         }
329         i++;
330     }
331
332     if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
333         KMessageBox::sorry(this, i18n("Unable to write to file %1", exportFile));
334         return;
335     }
336     QTextStream out(&file);
337     out << doc.toString();
338     file.close();
339     parseProfiles(currentGroup);
340     focusFirstVisibleItem();
341 }
342
343 void RenderWidget::updateButtons() {
344     if (!m_view.size_list->currentItem() || m_view.size_list->currentItem()->isHidden()) {
345         m_view.buttonSave->setEnabled(false);
346         m_view.buttonDelete->setEnabled(false);
347         m_view.buttonEdit->setEnabled(false);
348     } else {
349         m_view.buttonSave->setEnabled(true);
350         if (m_view.size_list->currentItem()->data(EditableRole).toString().isEmpty()) {
351             m_view.buttonDelete->setEnabled(false);
352             m_view.buttonEdit->setEnabled(false);
353         } else {
354             m_view.buttonDelete->setEnabled(true);
355             m_view.buttonEdit->setEnabled(true);
356         }
357     }
358 }
359
360
361 void RenderWidget::focusFirstVisibleItem() {
362     if (m_view.size_list->currentItem() && !m_view.size_list->currentItem()->isHidden()) {
363         updateButtons();
364         return;
365     }
366     for (uint ix = 0; ix < m_view.size_list->count(); ix++) {
367         QListWidgetItem *item = m_view.size_list->item(ix);
368         if (item && !item->isHidden()) {
369             m_view.size_list->setCurrentRow(ix);
370             break;
371         }
372     }
373     if (!m_view.size_list->currentItem()) m_view.size_list->setCurrentRow(0);
374     updateButtons();
375 }
376
377 void RenderWidget::slotExport() {
378     QListWidgetItem *item = m_view.size_list->currentItem();
379     if (!item) return;
380     QFile f(m_view.out_file->url().path());
381     if (f.exists()) {
382         if (KMessageBox::warningYesNo(this, i18n("File already exists. Do you want to overwrite it ?")) != KMessageBox::Yes)
383             return;
384     }
385     QStringList overlayargs;
386     if (m_view.tc_overlay->isChecked()) {
387         QString filterFile = KStandardDirs::locate("appdata", "metadata.properties");
388         overlayargs << "meta.attr.timecode=1" << "meta.attr.timecode.markup=#timecode";
389         overlayargs << "-attach" << "data_feed:attr_check" << "-attach";
390         overlayargs << "data_show:" + filterFile << "_fezzik=1" << "dynamic=1";
391     }
392     double startPos = -1;
393     double endPos = -1;
394     if (m_view.render_guide->isChecked()) {
395         startPos = m_view.guide_start->itemData(m_view.guide_start->currentIndex()).toDouble();
396         endPos = m_view.guide_end->itemData(m_view.guide_end->currentIndex()).toDouble();
397     }
398     QString renderArgs = m_view.advanced_params->toPlainText();
399     renderArgs.replace("%width", QString::number(m_profile.width));
400     renderArgs.replace("%height", QString::number(m_profile.height));
401     renderArgs.replace("%dar", "@" + QString::number(m_profile.display_aspect_num) + "/" + QString::number(m_profile.display_aspect_den));
402     if (m_view.force_progressive->checkState() == Qt::Checked) renderArgs.append(" progressive=1");
403     else if (m_view.force_progressive->checkState() == Qt::Unchecked) renderArgs.append(" progressive=0");
404     emit doRender(m_view.out_file->url().path(), item->data(RenderRole).toString(), overlayargs, renderArgs.simplified().split(' '), m_view.render_zone->isChecked(), m_view.play_after->isChecked(), startPos, endPos);
405 }
406
407 void RenderWidget::setProfile(MltVideoProfile profile) {
408     m_profile = profile;
409     //WARNING: this way to tell the video standard is a bit hackish...
410     if (m_profile.description.contains("pal", Qt::CaseInsensitive) || m_profile.description.contains("25", Qt::CaseInsensitive) || m_profile.description.contains("50", Qt::CaseInsensitive)) m_view.format_selection->setCurrentIndex(0);
411     else m_view.format_selection->setCurrentIndex(1);
412     m_view.force_progressive->setCheckState(Qt::PartiallyChecked);
413     refreshView();
414 }
415
416 void RenderWidget::refreshView() {
417     m_view.size_list->blockSignals(true);
418     QListWidgetItem *item = m_view.format_list->currentItem();
419     if (!item) {
420         m_view.format_list->setCurrentRow(0);
421         item = m_view.format_list->currentItem();
422     }
423     if (!item) return;
424     QString std;
425     QString group = item->text();
426     QListWidgetItem *sizeItem;
427     bool firstSelected = false;
428     for (int i = 0; i < m_view.size_list->count(); i++) {
429         sizeItem = m_view.size_list->item(i);
430         if (sizeItem->data(GroupRole) == group) {
431             std = sizeItem->data(StandardRole).toString();
432             if (!std.isEmpty()) {
433                 if (std.contains("PAL", Qt::CaseInsensitive)) sizeItem->setHidden(m_view.format_selection->currentIndex() != 0);
434                 else if (std.contains("NTSC", Qt::CaseInsensitive)) sizeItem->setHidden(m_view.format_selection->currentIndex() != 1);
435             } else {
436                 sizeItem->setHidden(false);
437                 if (!firstSelected) m_view.size_list->setCurrentItem(sizeItem);
438                 firstSelected = true;
439             }
440             if (!KdenliveSettings::experimentalrender() && !sizeItem->isHidden()) {
441                 // hide experimental codecs (which do resize the video)
442                 std = sizeItem->data(ParamsRole).toString();
443                 if (std.contains(" s=")) {
444                     QString subsize = std.section(" s=", 1, 1);
445                     subsize = subsize.section(' ', 0, 0).toLower();
446                     if (subsize != "%widthx%height") {
447                         const QString currentSize = QString::number(m_profile.width) + 'x' + QString::number(m_profile.height);
448                         if (subsize != currentSize) sizeItem->setHidden(true);
449                     }
450                 }
451             }
452         } else sizeItem->setHidden(true);
453     }
454     focusFirstVisibleItem();
455     m_view.size_list->blockSignals(false);
456     refreshParams();
457 }
458
459 void RenderWidget::refreshParams() {
460     QListWidgetItem *item = m_view.size_list->currentItem();
461     if (!item || item->isHidden()) {
462         m_view.advanced_params->clear();
463         m_view.buttonStart->setEnabled(false);
464         return;
465     }
466     QString params = item->data(ParamsRole).toString();
467     QString extension = item->data(ExtensionRole).toString();
468     m_view.advanced_params->setPlainText(params);
469     m_view.advanced_params->setToolTip(params);
470     KUrl url = m_view.out_file->url();
471     if (!url.isEmpty()) {
472         QString path = url.path();
473         int pos = path.lastIndexOf('.') + 1;
474         if (pos == 0) path.append('.') + extension;
475         else path = path.left(pos) + extension;
476         m_view.out_file->setUrl(KUrl(path));
477     } else {
478         m_view.out_file->setUrl(KUrl(QDir::homePath() + "/untitled." + extension));
479     }
480     m_view.out_file->setFilter("*." + extension);
481
482     if (item->data(EditableRole).toString().isEmpty()) {
483         m_view.buttonDelete->setEnabled(false);
484         m_view.buttonEdit->setEnabled(false);
485     } else {
486         m_view.buttonDelete->setEnabled(true);
487         m_view.buttonEdit->setEnabled(true);
488     }
489     m_view.buttonStart->setEnabled(true);
490 }
491
492 void RenderWidget::parseProfiles(QString group, QString profile) {
493     m_view.size_list->clear();
494     m_view.format_list->clear();
495     QString exportFile = KStandardDirs::locate("appdata", "export/profiles.xml");
496     parseFile(exportFile, false);
497     exportFile = KStandardDirs::locateLocal("appdata", "export/customprofiles.xml");
498     if (QFile::exists(exportFile)) parseFile(exportFile, true);
499     refreshView();
500     QList<QListWidgetItem *> child;
501     child = m_view.format_list->findItems(group, Qt::MatchExactly);
502     if (!child.isEmpty()) m_view.format_list->setCurrentItem(child.at(0));
503     child = m_view.size_list->findItems(profile, Qt::MatchExactly);
504     if (!child.isEmpty()) m_view.size_list->setCurrentItem(child.at(0));
505 }
506
507 void RenderWidget::parseFile(QString exportFile, bool editable) {
508     QDomDocument doc;
509     QFile file(exportFile);
510     doc.setContent(&file, false);
511     file.close();
512     QDomElement documentElement;
513     QDomElement profileElement;
514     QDomNodeList groups = doc.elementsByTagName("group");
515
516     if (groups.count() == 0) {
517         kDebug() << "// Export file: " << exportFile << " IS BROKEN";
518         return;
519     }
520
521     int i = 0;
522     QString groupName;
523     QString profileName;
524     QString extension;
525     QString prof_extension;
526     QString renderer;
527     QString params;
528     QString standard;
529     QListWidgetItem *item;
530     while (!groups.item(i).isNull()) {
531         documentElement = groups.item(i).toElement();
532         groupName = documentElement.attribute("name", QString::null);
533         extension = documentElement.attribute("extension", QString::null);
534         renderer = documentElement.attribute("renderer", QString::null);
535         if (m_view.format_list->findItems(groupName, Qt::MatchExactly).isEmpty())
536             new QListWidgetItem(groupName, m_view.format_list);
537
538         QDomNode n = groups.item(i).firstChild();
539         while (!n.isNull()) {
540             profileElement = n.toElement();
541             profileName = profileElement.attribute("name");
542             standard = profileElement.attribute("standard");
543             params = profileElement.attribute("args");
544             prof_extension = profileElement.attribute("extension");
545             if (!prof_extension.isEmpty()) extension = prof_extension;
546             item = new QListWidgetItem(profileName, m_view.size_list);
547             item->setData(GroupRole, groupName);
548             item->setData(ExtensionRole, extension);
549             item->setData(RenderRole, renderer);
550             item->setData(StandardRole, standard);
551             item->setData(ParamsRole, params);
552             if (editable) item->setData(EditableRole, "true");
553             n = n.nextSibling();
554         }
555
556         i++;
557     }
558 }
559
560
561
562 #include "renderwidget.moc"
563
564