Fix some qml startup warnings

parent a972c153
...@@ -130,7 +130,7 @@ GLWidget::GLWidget(int id, QObject *parent) ...@@ -130,7 +130,7 @@ GLWidget::GLWidget(int id, QObject *parent)
m_blackClip->set("out", 3); m_blackClip->set("out", 3);
connect(&m_refreshTimer, &QTimer::timeout, this, &GLWidget::refresh); connect(&m_refreshTimer, &QTimer::timeout, this, &GLWidget::refresh);
m_producer = m_blackClip; m_producer = m_blackClip;
rootContext()->setContextProperty("markersModel", 0);
if (!initGPUAccel()) { if (!initGPUAccel()) {
disableGPUAccel(); disableGPUAccel();
} }
...@@ -956,6 +956,8 @@ int GLWidget::setProducer(const std::shared_ptr<Mlt::Producer> &producer, bool i ...@@ -956,6 +956,8 @@ int GLWidget::setProducer(const std::shared_ptr<Mlt::Producer> &producer, bool i
removeAudioOverlay(); removeAudioOverlay();
} }
m_producer = m_blackClip; m_producer = m_blackClip;
// Reset markersModel
rootContext()->setContextProperty("markersModel", 0);
} }
// redundant check. postcondition of above is m_producer != null // redundant check. postcondition of above is m_producer != null
if (m_producer) { if (m_producer) {
......
...@@ -1353,7 +1353,6 @@ void Monitor::slotOpenClip(const std::shared_ptr<ProjectClip> &controller, int i ...@@ -1353,7 +1353,6 @@ void Monitor::slotOpenClip(const std::shared_ptr<ProjectClip> &controller, int i
disconnect(m_controller->getMarkerModel().get(), SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SLOT(checkOverlay())); disconnect(m_controller->getMarkerModel().get(), SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SLOT(checkOverlay()));
} }
m_controller = controller; m_controller = controller;
loadQmlScene(MonitorSceneDefault);
m_snaps.reset(new SnapModel()); m_snaps.reset(new SnapModel());
m_glMonitor->getControllerProxy()->resetZone(); m_glMonitor->getControllerProxy()->resetZone();
if (controller) { if (controller) {
...@@ -1367,6 +1366,7 @@ void Monitor::slotOpenClip(const std::shared_ptr<ProjectClip> &controller, int i ...@@ -1367,6 +1366,7 @@ void Monitor::slotOpenClip(const std::shared_ptr<ProjectClip> &controller, int i
return; return;
} }
m_glMonitor->setRulerInfo((int)m_controller->frameDuration(), controller->getMarkerModel()); m_glMonitor->setRulerInfo((int)m_controller->frameDuration(), controller->getMarkerModel());
loadQmlScene(MonitorSceneDefault);
m_timePos->setRange(0, (int)m_controller->frameDuration()); m_timePos->setRange(0, (int)m_controller->frameDuration());
updateMarkers(); updateMarkers();
connect(m_glMonitor->getControllerProxy(), &MonitorProxy::addSnap, this, &Monitor::addSnapPoint, Qt::DirectConnection); connect(m_glMonitor->getControllerProxy(), &MonitorProxy::addSnap, this, &Monitor::addSnapPoint, Qt::DirectConnection);
...@@ -1389,6 +1389,7 @@ void Monitor::slotOpenClip(const std::shared_ptr<ProjectClip> &controller, int i ...@@ -1389,6 +1389,7 @@ void Monitor::slotOpenClip(const std::shared_ptr<ProjectClip> &controller, int i
m_glMonitor->getControllerProxy()->setClipHasAV(controller->hasAudioAndVideo()); m_glMonitor->getControllerProxy()->setClipHasAV(controller->hasAudioAndVideo());
// hasEffects = controller->hasEffects(); // hasEffects = controller->hasEffects();
} else { } else {
loadQmlScene(MonitorSceneDefault);
m_glMonitor->setProducer(nullptr, isActive()); m_glMonitor->setProducer(nullptr, isActive());
m_glMonitor->setAudioThumb(); m_glMonitor->setAudioThumb();
m_audioMeterWidget->audioChannels = 0; m_audioMeterWidget->audioChannels = 0;
......
...@@ -62,6 +62,8 @@ void QmlManager::setScene(Kdenlive::MonitorId id, MonitorSceneType type, QSize p ...@@ -62,6 +62,8 @@ void QmlManager::setScene(Kdenlive::MonitorId id, MonitorSceneType type, QSize p
} }
m_sceneType = type; m_sceneType = type;
QQuickItem *root = nullptr; QQuickItem *root = nullptr;
const QFont ft = QFontDatabase::systemFont(QFontDatabase::FixedFont);
m_view->rootContext()->setContextProperty("fixedFont", ft);
switch (type) { switch (type) {
case MonitorSceneGeometry: case MonitorSceneGeometry:
m_view->setSource(QUrl(QStringLiteral("qrc:/qml/kdenlivemonitoreffectscene.qml"))); m_view->setSource(QUrl(QStringLiteral("qrc:/qml/kdenlivemonitoreffectscene.qml")));
...@@ -117,8 +119,6 @@ void QmlManager::setScene(Kdenlive::MonitorId id, MonitorSceneType type, QSize p ...@@ -117,8 +119,6 @@ void QmlManager::setScene(Kdenlive::MonitorId id, MonitorSceneType type, QSize p
if (root && duration > 0) { if (root && duration > 0) {
root->setProperty("duration", duration); root->setProperty("duration", duration);
} }
const QFont ft = QFontDatabase::systemFont(QFontDatabase::FixedFont);
m_view->rootContext()->setContextProperty("fixedFont", ft);
} }
void QmlManager::effectRectChanged() void QmlManager::effectRectChanged()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment