From: Simon A. Eugster Date: Sun, 6 Jun 2010 13:57:14 +0000 (+0000) Subject: http://www.kdenlive.org/mantis/view.php?id=1610 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=8ef6284b4cf4fef311a46d123f407eade73ab987;p=kdenlive http://www.kdenlive.org/mantis/view.php?id=1610 * Rubberband selection mode added. svn path=/trunk/kdenlive/; revision=4508 --- diff --git a/src/titlewidget.cpp b/src/titlewidget.cpp index 32b67eb2..212f99e1 100644 --- a/src/titlewidget.cpp +++ b/src/titlewidget.cpp @@ -407,6 +407,8 @@ TitleWidget::TitleWidget(KUrl url, Timecode tc, QString projectTitlePath, Render m_scene = new GraphicsSceneRectMove(this); graphicsView->setScene(m_scene); graphicsView->setMouseTracking(true); + graphicsView->setDragMode(QGraphicsView::RubberBandDrag); + graphicsView->setRubberBandSelectionMode(Qt::ContainsItemBoundingRect); m_titledocument.setScene(m_scene, m_frameWidth, m_frameHeight); connect(m_scene, SIGNAL(changed(QList)), this, SLOT(slotChanged())); connect(font_size, SIGNAL(valueChanged(int)), m_scene, SLOT(slotUpdateFontSize(int))); @@ -630,11 +632,17 @@ void TitleWidget::slotRectTool() m_scene->setTool(TITLE_RECTANGLE); showToolbars(TITLE_RECTANGLE); checkButton(TITLE_RECTANGLE); + + // Disable dragging mode, would make dragging a rect impossible otherwise ;) + graphicsView->setDragMode(QGraphicsView::NoDrag); } void TitleWidget::slotSelectTool() { m_scene->setTool(TITLE_SELECT); + + // Enable rubberband selecting mode. + graphicsView->setDragMode(QGraphicsView::RubberBandDrag); // Find out which toolbars need to be shown, depending on selected item TITLETOOL t = TITLE_SELECT;