1 /***************************************************************************
2 titlewidget.h - 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 ***************************************************************************/
20 #include <QGraphicsView>
21 #include <QDomDocument>
22 #include <QGraphicsItem>
23 #include <QGraphicsSvgItem>
30 #include <KGlobalSettings>
31 #include <KFileDialog>
33 #include "titlewidget.h"
34 #include "kdenlivesettings.h"
36 int settingUp = false;
38 TitleWidget::TitleWidget(KUrl url, QString projectPath, Render *render, QWidget *parent): QDialog(parent), m_render(render), m_count(0), m_projectPath(projectPath) {
41 setFont(KGlobalSettings::toolBarFont());
42 //toolBox->setFont(KGlobalSettings::toolBarFont());
43 frame_properties->setEnabled(false);
44 m_frameWidth = render->renderWidth();
45 m_frameHeight = render->renderHeight();
46 //connect(newTextButton, SIGNAL(clicked()), this, SLOT(slotNewText()));
47 //connect(newRectButton, SIGNAL(clicked()), this, SLOT(slotNewRect()));
48 connect(kcolorbutton, SIGNAL(clicked()), this, SLOT(slotChangeBackground())) ;
49 connect(horizontalSlider, SIGNAL(valueChanged(int)), this, SLOT(slotChangeBackground())) ;
50 //connect(ktextedit, SIGNAL(textChanged()), this , SLOT(textChanged()));
51 //connect (fontBold, SIGNAL ( clicked()), this, SLOT( setBold()) ) ;
54 //ktextedit->setHidden(true);
55 connect(fontColorButton, SIGNAL(clicked()), this, SLOT(slotUpdateText())) ;
56 connect(font_family, SIGNAL(currentFontChanged(const QFont &)), this, SLOT(slotUpdateText())) ;
57 connect(font_size, SIGNAL(valueChanged(int)), this, SLOT(slotUpdateText())) ;
58 connect(textAlpha, SIGNAL(valueChanged(int)), this, SLOT(slotUpdateText()));
59 //connect (ktextedit, SIGNAL(selectionChanged()), this , SLOT (textChanged()));
61 connect(rectFAlpha, SIGNAL(valueChanged(int)), this, SLOT(rectChanged()));
62 connect(rectBAlpha, SIGNAL(valueChanged(int)), this, SLOT(rectChanged()));
63 connect(rectFColor, SIGNAL(clicked()), this, SLOT(rectChanged()));
64 connect(rectBColor, SIGNAL(clicked()), this, SLOT(rectChanged()));
65 connect(rectLineWidth, SIGNAL(valueChanged(int)), this, SLOT(rectChanged()));
67 connect(startViewportX, SIGNAL(valueChanged(int)), this, SLOT(setupViewports()));
68 connect(startViewportY, SIGNAL(valueChanged(int)), this, SLOT(setupViewports()));
69 connect(startViewportSize, SIGNAL(valueChanged(int)), this, SLOT(setupViewports()));
70 connect(endViewportX, SIGNAL(valueChanged(int)), this, SLOT(setupViewports()));
71 connect(endViewportY, SIGNAL(valueChanged(int)), this, SLOT(setupViewports()));
72 connect(endViewportSize, SIGNAL(valueChanged(int)), this, SLOT(setupViewports()));
74 connect(zValue, SIGNAL(valueChanged(int)), this, SLOT(zIndexChanged(int)));
75 connect(svgfilename, SIGNAL(urlSelected(const KUrl&)), this, SLOT(svgSelected(const KUrl &)));
76 connect(itemzoom, SIGNAL(valueChanged(int)), this, SLOT(itemScaled(int)));
77 connect(itemrotate, SIGNAL(valueChanged(int)), this, SLOT(itemRotate(int)));
79 connect(value_x, SIGNAL(valueChanged(int)), this, SLOT(slotAdjustSelectedItem()));
80 connect(value_y, SIGNAL(valueChanged(int)), this, SLOT(slotAdjustSelectedItem()));
81 connect(value_w, SIGNAL(valueChanged(int)), this, SLOT(slotAdjustSelectedItem()));
82 connect(value_h, SIGNAL(valueChanged(int)), this, SLOT(slotAdjustSelectedItem()));
83 connect(buttonFitZoom, SIGNAL(clicked()), this, SLOT(slotAdjustZoom()));
84 connect(buttonRealSize, SIGNAL(clicked()), this, SLOT(slotZoomOneToOne()));
85 connect(buttonBold, SIGNAL(clicked()), this, SLOT(slotUpdateText()));
86 connect(buttonItalic, SIGNAL(clicked()), this, SLOT(slotUpdateText()));
87 connect(buttonUnder, SIGNAL(clicked()), this, SLOT(slotUpdateText()));
88 connect(displayBg, SIGNAL(stateChanged(int)), this, SLOT(displayBackgroundFrame()));
90 buttonFitZoom->setIcon(KIcon("zoom-fit-best"));
91 buttonRealSize->setIcon(KIcon("zoom-original"));
92 buttonBold->setIcon(KIcon("format-text-bold"));
93 buttonItalic->setIcon(KIcon("format-text-italic"));
94 buttonUnder->setIcon(KIcon("format-text-underline"));
96 QHBoxLayout *layout = new QHBoxLayout;
97 frame_toolbar->setLayout(layout);
99 QToolBar *m_toolbar = new QToolBar("titleToolBar", this);
101 m_buttonRect = m_toolbar->addAction(KIcon("insert-rect"), i18n("Add Rectangle"));
102 m_buttonRect->setCheckable(true);
103 connect(m_buttonRect, SIGNAL(triggered()), this, SLOT(slotRectTool()));
105 m_buttonText = m_toolbar->addAction(KIcon("insert-text"), i18n("Add Text"));
106 m_buttonText->setCheckable(true);
107 connect(m_buttonText, SIGNAL(triggered()), this, SLOT(slotTextTool()));
109 m_buttonImage = m_toolbar->addAction(KIcon("insert-image"), i18n("Add Image"));
110 m_buttonImage->setCheckable(true);
111 connect(m_buttonImage, SIGNAL(triggered()), this, SLOT(slotImageTool()));
113 m_buttonCursor = m_toolbar->addAction(KIcon("select-rectangular"), i18n("Selection Tool"));
114 m_buttonCursor->setCheckable(true);
115 connect(m_buttonCursor, SIGNAL(triggered()), this, SLOT(slotSelectTool()));
117 m_buttonLoad = m_toolbar->addAction(KIcon("document-open"), i18n("Open Document"));
118 m_buttonLoad->setCheckable(false);
119 connect(m_buttonLoad, SIGNAL(triggered()), this, SLOT(loadTitle()));
121 m_buttonSave = m_toolbar->addAction(KIcon("document-save-as"), i18n("Save As"));
122 m_buttonSave->setCheckable(false);
123 connect(m_buttonSave, SIGNAL(triggered()), this, SLOT(saveTitle()));
125 layout->addWidget(m_toolbar);
126 text_properties->setHidden(true);
128 // initialize graphic scene
129 m_scene = new GraphicsSceneRectMove(this);
130 graphicsView->setScene(m_scene);
131 m_titledocument.setScene(m_scene);
133 // a gradient background
134 QRadialGradient *gradient = new QRadialGradient(0, 0, 10);
135 gradient->setSpread(QGradient::ReflectSpread);
136 //scene->setBackgroundBrush(*gradient);
138 m_frameImage = new QGraphicsPixmapItem();
140 qtrans.scale(2.0, 2.0);
141 m_frameImage->setTransform(qtrans);
142 m_frameImage->setZValue(-1200);
143 m_frameImage->setFlags(QGraphicsItem::ItemClipsToShape);
144 displayBackgroundFrame();
145 graphicsView->scene()->addItem(m_frameImage);
147 connect(m_scene, SIGNAL(selectionChanged()), this , SLOT(selectionChanged()));
148 connect(m_scene, SIGNAL(itemMoved()), this , SLOT(selectionChanged()));
149 connect(m_scene, SIGNAL(sceneZoom(bool)), this , SLOT(slotZoom(bool)));
150 connect(m_scene, SIGNAL(actionFinished()), this , SLOT(slotSelectTool()));
151 connect(m_scene, SIGNAL(actionFinished()), this , SLOT(selectionChanged()));
152 connect(m_scene, SIGNAL(newRect(QGraphicsRectItem *)), this , SLOT(slotNewRect(QGraphicsRectItem *)));
153 connect(m_scene, SIGNAL(newText(QGraphicsTextItem *)), this , SLOT(slotNewText(QGraphicsTextItem *)));
154 connect(zoom_slider, SIGNAL(valueChanged(int)), this , SLOT(slotUpdateZoom(int)));
156 QPen framepen(Qt::DotLine);
157 framepen.setColor(Qt::red);
159 m_frameBorder = new QGraphicsRectItem(QRectF(0, 0, m_frameWidth, m_frameHeight));
160 m_frameBorder->setPen(framepen);
161 m_frameBorder->setZValue(-1100);
162 m_frameBorder->setBrush(QColor(0, 0, 0, 0));
163 m_frameBorder->setFlags(QGraphicsItem::ItemClipsToShape);
164 graphicsView->scene()->addItem(m_frameBorder);
168 graphicsView->show();
169 graphicsView->setRenderHint(QPainter::Antialiasing);
170 graphicsView->setInteractive(true);
171 QTimer::singleShot(500, this, SLOT(slotAdjustZoom()));
172 //graphicsView->resize(400, 300);
173 kDebug() << "// TITLE WIDGWT: " << graphicsView->viewport()->width() << "x" << graphicsView->viewport()->height();
174 toolBox->setItemEnabled(2, false);
175 toolBox->setItemEnabled(3, false);
176 if (!url.isEmpty()) {
177 m_count = m_titledocument.loadDocument(url, startViewport, endViewport) + 1;
179 } else slotRectTool();
184 void TitleWidget::resizeEvent(QResizeEvent * event) {
188 void TitleWidget::slotTextTool() {
189 rect_properties->setHidden(true);
190 text_properties->setHidden(false);
191 m_scene->setTool(TITLE_TEXT);
192 m_buttonRect->setChecked(false);
193 m_buttonCursor->setChecked(false);
194 m_buttonImage->setChecked(false);
197 void TitleWidget::slotRectTool() {
198 text_properties->setHidden(true);
199 rect_properties->setHidden(false);
200 m_scene->setTool(TITLE_RECTANGLE);
201 m_buttonText->setChecked(false);
202 m_buttonCursor->setChecked(false);
203 m_buttonImage->setChecked(false);
206 void TitleWidget::slotSelectTool() {
207 m_scene->setTool(TITLE_SELECT);
208 m_buttonCursor->setChecked(true);
209 m_buttonText->setChecked(false);
210 m_buttonRect->setChecked(false);
211 m_buttonImage->setChecked(false);
214 void TitleWidget::displayBackgroundFrame() {
215 if (!displayBg->isChecked()) {
216 QPixmap bg(m_frameWidth / 2, m_frameHeight / 2);
217 QPixmap pattern(20, 20);
221 p.fillRect(QRect(0, 0, 10, 10), QColor(210, 210, 210));
222 p.fillRect(QRect(10, 10, 20, 20), QColor(210, 210, 210));
227 p.fillRect(bg.rect(), br);
229 m_frameImage->setPixmap(bg);
231 m_frameImage->setPixmap(m_render->extractFrame((int) m_render->seekPosition().frames(m_render->fps()), m_frameWidth / 2, m_frameHeight / 2));
235 void TitleWidget::initViewports() {
236 startViewport = new QGraphicsPolygonItem(QPolygonF(QRectF(0, 0, 0, 0)));
237 endViewport = new QGraphicsPolygonItem(QPolygonF(QRectF(0, 0, 0, 0)));
239 QPen startpen(Qt::DotLine);
240 QPen endpen(Qt::DashDotLine);
241 startpen.setColor(QColor(100, 200, 100, 140));
242 endpen.setColor(QColor(200, 100, 100, 140));
244 startViewport->setPen(startpen);
245 endViewport->setPen(endpen);
247 startViewportSize->setValue(40);
248 endViewportSize->setValue(40);
250 startViewport->setZValue(-1000);
251 endViewport->setZValue(-1000);
253 startViewport->setFlags(/*QGraphicsItem::ItemIsMovable|*/QGraphicsItem::ItemIsSelectable);
254 endViewport->setFlags(/*QGraphicsItem::ItemIsMovable|*/QGraphicsItem::ItemIsSelectable);
256 graphicsView->scene()->addItem(startViewport);
257 graphicsView->scene()->addItem(endViewport);
260 void TitleWidget::slotUpdateZoom(int pos) {
261 m_scene->setZoom((double) pos / 7);
262 zoom_label->setText("x" + QString::number((double) pos / 7, 'g', 2));
265 void TitleWidget::slotZoom(bool up) {
266 int pos = zoom_slider->value();
269 zoom_slider->setValue(pos);
272 void TitleWidget::slotAdjustZoom() {
273 double scalex = graphicsView->width() / (double)(m_frameWidth * 1.2);
274 double scaley = graphicsView->height() / (double)(m_frameHeight * 1.2);
275 if (scalex > scaley) scalex = scaley;
276 int zoompos = (int)(scalex * 7 + 0.5);
277 zoom_slider->setValue(zoompos);
278 graphicsView->centerOn(m_frameBorder);
281 void TitleWidget::slotZoomOneToOne() {
282 zoom_slider->setValue(7);
283 graphicsView->centerOn(m_frameBorder);
286 void TitleWidget::slotNewRect(QGraphicsRectItem * rect) {
287 QColor f = rectFColor->color();
288 f.setAlpha(rectFAlpha->value());
290 penf.setWidth(rectLineWidth->value());
292 QColor b = rectBColor->color();
293 b.setAlpha(rectBAlpha->value());
294 rect->setBrush(QBrush(b));
295 rect->setZValue(m_count++);
296 //setCurrentItem(rect);
297 //graphicsView->setFocus();
300 void TitleWidget::slotNewText(QGraphicsTextItem *tt) {
301 QFont font = font_family->currentFont();
302 font.setPointSize(font_size->value());
304 QColor color = fontColorButton->color();
305 color.setAlpha(textAlpha->value());
306 tt->setDefaultTextColor(color);
307 tt->setZValue(m_count++);
311 void TitleWidget::setCurrentItem(QGraphicsItem *item) {
312 m_scene->setSelectedItem(item);
315 void TitleWidget::zIndexChanged(int v) {
316 QList<QGraphicsItem*> l = graphicsView->scene()->selectedItems();
322 void TitleWidget::selectionChanged() {
323 if (m_scene->tool() != TITLE_SELECT) return;
324 QList<QGraphicsItem*> l = graphicsView->scene()->selectedItems();
325 //toolBox->setItemEnabled(2, false);
326 //toolBox->setItemEnabled(3, false);
327 value_x->blockSignals(true);
328 value_y->blockSignals(true);
329 value_w->blockSignals(true);
330 value_h->blockSignals(true);
331 kDebug() << "//////// SELECTION CHANGED; ITEMS: " << l.size();
333 if ((l[0])->type() == 8) {
334 rect_properties->setHidden(true);
335 text_properties->setHidden(false);
336 QGraphicsTextItem* i = ((QGraphicsTextItem*)l[0]);
337 //if (l[0]->hasFocus())
338 //ktextedit->setHtml(i->toHtml());
339 toolBox->setCurrentIndex(0);
340 //toolBox->setItemEnabled(2, true);
341 font_size->blockSignals(true);
342 font_family->blockSignals(true);
343 buttonBold->blockSignals(true);
344 buttonItalic->blockSignals(true);
345 buttonUnder->blockSignals(true);
346 fontColorButton->blockSignals(true);
347 textAlpha->blockSignals(true);
349 QFont font = i->font();
350 font_family->setCurrentFont(font);
351 font_size->setValue(font.pointSize());
352 buttonBold->setChecked(font.bold());
353 buttonItalic->setChecked(font.italic());
354 buttonUnder->setChecked(font.underline());
356 QColor color = i->defaultTextColor();
357 fontColorButton->setColor(color);
358 textAlpha->setValue(color.alpha());
360 font_size->blockSignals(false);
361 font_family->blockSignals(false);
362 buttonBold->blockSignals(false);
363 buttonItalic->blockSignals(false);
364 buttonUnder->blockSignals(false);
365 fontColorButton->blockSignals(false);
366 textAlpha->blockSignals(false);
368 value_x->setValue((int) i->pos().x());
369 value_y->setValue((int) i->pos().y());
370 value_w->setValue((int) i->boundingRect().width());
371 value_h->setValue((int) i->boundingRect().height());
372 frame_properties->setEnabled(true);
373 value_w->setEnabled(false);
374 value_h->setEnabled(false);
375 } else if ((l[0])->type() == 3) {
376 rect_properties->setHidden(false);
377 text_properties->setHidden(true);
379 QGraphicsRectItem *rec = ((QGraphicsRectItem*)l[0]);
380 toolBox->setCurrentIndex(0);
381 //toolBox->setItemEnabled(3, true);
382 rectFAlpha->setValue(rec->pen().color().alpha());
383 rectBAlpha->setValue(rec->brush().color().alpha());
384 kDebug() << rec->brush().color().alpha();
385 QColor fcol = rec->pen().color();
386 QColor bcol = rec->brush().color();
387 //fcol.setAlpha(255);
388 //bcol.setAlpha(255);
389 rectFColor->setColor(fcol);
390 rectBColor->setColor(bcol);
392 rectLineWidth->setValue(rec->pen().width());
393 value_x->setValue((int) rec->pos().x());
394 value_y->setValue((int) rec->pos().y());
395 value_w->setValue((int) rec->rect().width());
396 value_h->setValue((int) rec->rect().height());
397 frame_properties->setEnabled(true);
398 value_w->setEnabled(true);
399 value_h->setEnabled(true);
401 //toolBox->setCurrentIndex(0);
402 frame_properties->setEnabled(false);
404 zValue->setValue((int)l[0]->zValue());
405 itemzoom->setValue((int)transformations[l[0]].scalex*100);
406 itemrotate->setValue((int)transformations[l[0]].rotate);
407 value_x->blockSignals(false);
408 value_y->blockSignals(false);
409 value_w->blockSignals(false);
410 value_h->blockSignals(false);
411 } else frame_properties->setEnabled(false);
414 void TitleWidget::slotAdjustSelectedItem() {
415 QList<QGraphicsItem*> l = graphicsView->scene()->selectedItems();
417 if (l[0]->type() == 3) {
419 QGraphicsRectItem *rec = ((QGraphicsRectItem*)l[0]);
420 rec->setPos(value_x->value(), value_y->value());
421 rec->setRect(QRect(0, 0, value_w->value(), value_h->value()));
422 } else if (l[0]->type() == 8) {
424 QGraphicsTextItem *rec = ((QGraphicsTextItem*)l[0]);
425 rec->setPos(value_x->value(), value_y->value());
430 void TitleWidget::slotChangeBackground() {
431 QColor color = kcolorbutton->color();
432 color.setAlpha(horizontalSlider->value());
433 m_frameBorder->setBrush(QBrush(color));
436 void TitleWidget::textChanged() {
437 QList<QGraphicsItem*> l = graphicsView->scene()->selectedItems();
438 if (l.size() == 1 && (l[0])->type() == 8 && !l[0]->hasFocus()) {
439 //kDebug() << ktextedit->document()->toHtml();
440 //((QGraphicsTextItem*)l[0])->setHtml(ktextedit->toHtml());
444 void TitleWidget::slotUpdateText() {
445 QFont font = font_family->currentFont();
446 font.setPointSize(font_size->value());
447 font.setBold(buttonBold->isChecked());
448 font.setItalic(buttonItalic->isChecked());
449 font.setUnderline(buttonUnder->isChecked());
450 QColor color = fontColorButton->color();
451 color.setAlpha(textAlpha->value());
453 QGraphicsTextItem* item = NULL;
454 QList<QGraphicsItem*> l = graphicsView->scene()->selectedItems();
455 if (l.size() == 1 && (l[0])->type() == 8) {
456 item = (QGraphicsTextItem*)l[0];
459 //if (item->textCursor().selection ().isEmpty())
462 item->setDefaultTextColor(color);
465 QTextDocumentFragment selec = item->textCursor().selection ();
468 //if (ktextedit->textCursor().selectedText().isEmpty()) ktextedit->selectAll();
470 //ktextedit->setCurrentFont(font);
471 //ktextedit->setTextColor(color);
472 /*QList<QGraphicsItem*> l = graphicsView->scene()->selectedItems();
473 if (l.size() == 1 && (l[0])->type() == 8 && l[0]->hasFocus()) {
474 QGraphicsTextItem* item = static_cast <QGraphicsTextItem*> (l[0]);
479 void TitleWidget::rectChanged() {
480 QList<QGraphicsItem*> l = graphicsView->scene()->selectedItems();
481 if (l.size() == 1 && (l[0])->type() == 3 && !settingUp) {
482 QGraphicsRectItem *rec = (QGraphicsRectItem*)l[0];
483 QColor f = rectFColor->color();
484 f.setAlpha(rectFAlpha->value());
486 penf.setWidth(rectLineWidth->value());
488 QColor b = rectBColor->color();
489 b.setAlpha(rectBAlpha->value());
490 rec->setBrush(QBrush(b));
494 void TitleWidget::fontBold() {
495 QList<QGraphicsItem*> l = graphicsView->scene()->selectedItems();
496 if (l.size() == 1 && (l[0])->type() == 8 && !l[0]->hasFocus()) {
497 //ktextedit->document()->setTextOption();
501 void TitleWidget::svgSelected(const KUrl& u) {
502 QGraphicsSvgItem *svg = new QGraphicsSvgItem(u.toLocalFile());
503 svg->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
504 graphicsView->scene()->addItem(svg);
507 void TitleWidget::itemScaled(int val) {
508 QList<QGraphicsItem*> l = graphicsView->scene()->selectedItems();
510 Transform x = transformations[l[0]];
511 x.scalex = (double)val / 100.0;
512 x.scaley = (double)val / 100.0;
514 qtrans.scale(x.scalex, x.scaley);
515 qtrans.rotate(x.rotate);
516 l[0]->setTransform(qtrans);
517 transformations[l[0]] = x;
521 void TitleWidget::itemRotate(int val) {
522 QList<QGraphicsItem*> l = graphicsView->scene()->selectedItems();
524 Transform x = transformations[l[0]];
525 x.rotate = (double)val;
527 qtrans.scale(x.scalex, x.scaley);
528 qtrans.rotate(x.rotate);
529 l[0]->setTransform(qtrans);
530 transformations[l[0]] = x;
535 void TitleWidget::setupViewports() {
536 double aspect_ratio = 4.0 / 3.0;//read from project
538 QRectF sp(0, 0, 0, 0);
539 QRectF ep(0, 0, 0, 0);
541 double sv_size = startViewportSize->value();
542 double ev_size = endViewportSize->value();
543 sp.adjust(-sv_size, -sv_size / aspect_ratio, sv_size, sv_size / aspect_ratio);
544 ep.adjust(-ev_size, -ev_size / aspect_ratio, ev_size, ev_size / aspect_ratio);
546 startViewport->setPos(startViewportX->value(), startViewportY->value());
547 endViewport->setPos(endViewportX->value(), endViewportY->value());
549 startViewport->setPolygon(QPolygonF(sp));
550 endViewport->setPolygon(QPolygonF(ep));
554 void TitleWidget::loadTitle() {
555 KUrl url = KFileDialog::getOpenUrl(KUrl(m_projectPath), "*.kdenlivetitle", this, tr("Save Title"));
556 if (!url.isEmpty()) {
557 QList<QGraphicsItem *> items = m_scene->items();
558 for (int i = 0; i < items.size(); i++) {
559 if (items.at(i)->zValue() > -1000) delete items.at(i);
561 m_count = m_titledocument.loadDocument(url, startViewport, endViewport) + 1;
566 void TitleWidget::saveTitle(KUrl url) {
567 if (url.isEmpty()) KUrl url = KFileDialog::getSaveUrl(KUrl(m_projectPath), "*.kdenlivetitle", this, tr("Save Title"));
568 if (!url.isEmpty()) m_titledocument.saveDocument(url, startViewport, endViewport);
571 QPixmap TitleWidget::renderedPixmap() {
572 QPixmap pix(m_frameWidth, m_frameHeight);
573 pix.fill(Qt::transparent);
574 QPainter painter(&pix);
576 m_scene->clearSelection();
577 QPen framepen = m_frameBorder->pen();
578 m_frameBorder->setPen(Qt::NoPen);
579 startViewport->setVisible(false);
580 endViewport->setVisible(false);
581 m_frameImage->setVisible(false);
583 m_scene->render(&painter, QRectF(), QRectF(0, 0, m_frameWidth, m_frameHeight));
584 m_frameBorder->setPen(framepen);
585 startViewport->setVisible(true);
586 endViewport->setVisible(true);
587 m_frameImage->setVisible(true);
591 #include "moc_titlewidget.cpp"