svn path=/trunk/kdenlive/; revision=4194
//grabMouse();
m_zoom = 1.0;
setBackgroundBrush(QBrush(Qt::transparent));
//grabMouse();
m_zoom = 1.0;
setBackgroundBrush(QBrush(Qt::transparent));
}
void GraphicsSceneRectMove::setSelectedItem(QGraphicsItem *item)
}
void GraphicsSceneRectMove::setSelectedItem(QGraphicsItem *item)
emit newText((QGraphicsTextItem *) m_selectedItem);
m_selectedItem->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
((QGraphicsTextItem *)m_selectedItem)->setTextInteractionFlags(Qt::TextEditorInteraction);
emit newText((QGraphicsTextItem *) m_selectedItem);
m_selectedItem->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
((QGraphicsTextItem *)m_selectedItem)->setTextInteractionFlags(Qt::TextEditorInteraction);
- m_selectedItem->setPos(e->scenePos());
+ m_selectedItem->setPos(e->scenePos() - QPointF(0, (int)(m_fontSize/2)));
QGraphicsScene::mousePressEvent(e);
}
QGraphicsScene::mousePressEvent(e);
}
else if (angle > 112.5 && angle <= 157.5)
setCursor(Qt::SizeBDiagCursor);
}
else if (angle > 112.5 && angle <= 157.5)
setCursor(Qt::SizeBDiagCursor);
}
+
+void GraphicsSceneRectMove::slotUpdateFontSize(int s)
+{
+ m_fontSize = s;
+}
+
+#include "graphicsscenerectmove.moc"
TITLETOOL tool();
void clearTextSelection();
TITLETOOL tool();
void clearTextSelection();
+public slots:
+ void slotUpdateFontSize(int s);
+
protected:
virtual void keyPressEvent(QKeyEvent * keyEvent);
virtual void mousePressEvent(QGraphicsSceneMouseEvent*);
protected:
virtual void keyPressEvent(QKeyEvent * keyEvent);
virtual void mousePressEvent(QGraphicsSceneMouseEvent*);
QPointF m_sceneClickPoint;
TITLETOOL m_tool;
QPoint m_clickPoint;
QPointF m_sceneClickPoint;
TITLETOOL m_tool;
QPoint m_clickPoint;
signals:
void itemMoved();
signals:
void itemMoved();
graphicsView->setScene(m_scene);
m_titledocument.setScene(m_scene, m_frameWidth, m_frameHeight);
connect(m_scene, SIGNAL(changed(QList<QRectF>)), this, SLOT(slotChanged()));
graphicsView->setScene(m_scene);
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)));
// a gradient background
/*QRadialGradient *gradient = new QRadialGradient(0, 0, 10);
// a gradient background
/*QRadialGradient *gradient = new QRadialGradient(0, 0, 10);
QFont font = i->font();
font_family->setCurrentFont(font);
font_size->setValue(font.pixelSize());
QFont font = i->font();
font_family->setCurrentFont(font);
font_size->setValue(font.pixelSize());
+ m_scene->slotUpdateFontSize(font.pixelSize());
buttonItalic->setChecked(font.italic());
buttonUnder->setChecked(font.underline());
setFontBoxWeight(font.weight());
buttonItalic->setChecked(font.italic());
buttonUnder->setChecked(font.underline());
setFontBoxWeight(font.weight());
// read the entries
font_family->setCurrentFont(titleConfig.readEntry("font_family", font_family->currentFont()));
font_size->setValue(titleConfig.readEntry("font_pixel_size", font_size->value()));
// read the entries
font_family->setCurrentFont(titleConfig.readEntry("font_family", font_family->currentFont()));
font_size->setValue(titleConfig.readEntry("font_pixel_size", font_size->value()));
+ m_scene->slotUpdateFontSize(font_size->value());
fontColorButton->setColor(titleConfig.readEntry("font_color", fontColorButton->color()));
textAlpha->setValue(titleConfig.readEntry("font_alpha", textAlpha->value()));
int weight;
fontColorButton->setColor(titleConfig.readEntry("font_color", fontColorButton->color()));
textAlpha->setValue(titleConfig.readEntry("font_alpha", textAlpha->value()));
int weight;