]> git.sesse.net Git - kdenlive/commitdiff
text changes in other editor too
authorMarco Gittler <marco@gitma.de>
Tue, 26 Feb 2008 12:55:02 +0000 (12:55 +0000)
committerMarco Gittler <marco@gitma.de>
Tue, 26 Feb 2008 12:55:02 +0000 (12:55 +0000)
svn path=/branches/KDE4/; revision=1949

src/graphicsscenerectmove.cpp
src/titlewidget.cpp

index 62474765117cc62d9c1f4bf9613118b140604a4a..362956a3826b0b1f7c72ab7598f0a9dcfe0a6c6f 100644 (file)
@@ -51,7 +51,7 @@ void GraphicsSceneRectMove::mouseMoveEvent(QGraphicsSceneMouseEvent* e){
                gi->setRect(newrect);
                gi->setPos(selected->scenePos());
        }
-       kDebug() << "move";
+       
        QPointF p=e->scenePos();
        p+=QPoint(-2,-2);
        resizeMode=NoResize;
index 6633dd8b8088f33eec466d3e2ea52061ca497945..c6f79360eada55e5ad88c08d9743ccaf934245ac 100644 (file)
@@ -46,6 +46,7 @@ void TitleWidget::slotNewText(){
        QGraphicsTextItem *tt=graphicsView->scene()->addText("Text here");
        tt->setFlags(QGraphicsItem::ItemIsMovable|QGraphicsItem::ItemIsSelectable);
        tt->setTextInteractionFlags (Qt::TextEditorInteraction);
+       connect (tt->document(), SIGNAL (contentsChanged()), this, SLOT(selectionChanged()));
        kDebug() << tt->metaObject()->className();
        /*QGraphicsRectItem * ri=graphicsView->scene()->addRect(-50,-50,100,100);
        ri->setFlags(QGraphicsItem::ItemIsMovable|QGraphicsItem::ItemIsSelectable);*/
@@ -56,7 +57,8 @@ void TitleWidget::selectionChanged(){
        QList<QGraphicsItem*> l=graphicsView->scene()->selectedItems();
        if (l.size()>0){
                kDebug() << (l[0])->type();
-               if ((l[0])->type()==8){
+               if ((l[0])->type()==8  ){
+                       if (l[0]->hasFocus() )
                        ktextedit->setHtml(((QGraphicsTextItem*)l[0])->toHtml());
                        toolBox->setCurrentIndex(1);
                }else
@@ -77,7 +79,7 @@ void TitleWidget::slotChangeBackground(){
 
 void TitleWidget::textChanged(){
        QList<QGraphicsItem*> l=graphicsView->scene()->selectedItems();
-       if (l.size()>0 && (l[0])->type()==8 /*textitem*/){
+       if (l.size()>0 && (l[0])->type()==8 && ktextedit->hasFocus()/*textitem*/){
                
                ((QGraphicsTextItem*)l[0])->setHtml(ktextedit->toHtml());
        }