]> git.sesse.net Git - kdenlive/commitdiff
http://www.kdenlive.org/mantis/view.php?id=1610
authorSimon A. Eugster <simon.eu@gmail.com>
Sun, 6 Jun 2010 13:57:14 +0000 (13:57 +0000)
committerSimon A. Eugster <simon.eu@gmail.com>
Sun, 6 Jun 2010 13:57:14 +0000 (13:57 +0000)
* Rubberband selection mode added.

svn path=/trunk/kdenlive/; revision=4508

src/titlewidget.cpp

index 32b67eb2898696ab7a4aa6efb0d8a33544025a1f..212f99e1161ec4a02017128e31a73726d1a63387 100644 (file)
@@ -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<QRectF>)), 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;