<parameter type="list" name="Shape" default="0.0" paramlist="0.0,0.38,0.62,1.0"
- paramlistdisplay="Rectangle,Round,Triangle,Diamond">
+ paramlistdisplay="Rectangle,Ellipse,Triangle,Diamond">
<name>Shape</name>
</parameter>
GeometryWidget::~GeometryWidget()
{
- if (m_monitor)
- m_monitor->slotEffectScene(false);
- delete m_rect;
+ m_scene->removeItem(m_rect);
delete m_geometry;
+ m_monitor->slotEffectScene(false);
}
QString GeometryWidget::getValue() const
void GeometryWidget::slotCheckPosition(int renderPos)
{
+ qDebug() << m_clipPos << m_inPoint << m_outPoint;
if (renderPos >= m_clipPos && renderPos <= m_clipPos + m_outPoint - m_inPoint) {
if (!m_scene->views().at(0)->isVisible())
m_monitor->slotEffectScene(true);
m_view(NULL),
m_selectedItem(NULL),
m_resizeMode(NoResize),
- m_clickPoint(0, 0)
+ m_clickPoint(0, 0),
+ m_backgroundImage(QImage())
{
setBackgroundBrush(QBrush(QColor(KdenliveSettings::window_background().name())));
m_background->setPixmap(bg);
addItem(m_background);
- connect(m_renderer, SIGNAL(rendererPosition(int)), this, SLOT(slotUpdateBackground()));
- connect(m_renderer, SIGNAL(frameUpdated(int)), this, SLOT(slotUpdateBackground()));
+ //connect(m_renderer, SIGNAL(rendererPosition(int)), this, SLOT(slotUpdateBackground()));
+ connect(m_renderer, SIGNAL(frameUpdated(QImage)), this, SLOT(slotSetBackgroundImage(QImage)));
}
void MonitorScene::setUp()
m_view = views().at(0);
else
m_view = NULL;
- slotUpdateBackground();
+ slotUpdateBackground(true);
}
-void MonitorScene::slotUpdateBackground()
+void MonitorScene::slotUpdateBackground(bool fit)
{
if (m_view && m_view->isVisible()) {
if (m_lastUpdate.elapsed() > 200) {
- m_background->setPixmap(QPixmap::fromImage(m_renderer->extractFrame(m_renderer->seekFramePosition())));
- m_view->fitInView(m_frameBorder, Qt::KeepAspectRatio);
- m_view->centerOn(m_frameBorder);
+ m_background->setPixmap(QPixmap::fromImage(m_backgroundImage));
+ if (fit) {
+ m_view->fitInView(m_frameBorder, Qt::KeepAspectRatio);
+ m_view->centerOn(m_frameBorder);
+ }
m_lastUpdate.start();
}
}
}
+void MonitorScene::slotSetBackgroundImage(QImage image)
+{
+ m_backgroundImage = image;
+ slotUpdateBackground();
+}
+
resizeModes MonitorScene::getResizeMode(QGraphicsRectItem *item, QPoint pos)
{
if(!m_view)
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
public slots:
- void slotUpdateBackground();
+ void slotUpdateBackground(bool fit = false);
+
+private slots:
+ void slotSetBackgroundImage(QImage image);
private:
resizeModes getResizeMode(QGraphicsRectItem *item, QPoint pos);
QGraphicsItem *m_selectedItem;
resizeModes m_resizeMode;
QPointF m_clickPoint;
+ QImage m_backgroundImage;
signals:
void actionFinished();