Fix some qml startup warnings

parent a972c153
......@@ -130,7 +130,7 @@ GLWidget::GLWidget(int id, QObject *parent)
m_blackClip->set("out", 3);
connect(&m_refreshTimer, &QTimer::timeout, this, &GLWidget::refresh);
m_producer = m_blackClip;
rootContext()->setContextProperty("markersModel", 0);
if (!initGPUAccel()) {
disableGPUAccel();
}
......@@ -956,6 +956,8 @@ int GLWidget::setProducer(const std::shared_ptr<Mlt::Producer> &producer, bool i
removeAudioOverlay();
}
m_producer = m_blackClip;
// Reset markersModel
rootContext()->setContextProperty("markersModel", 0);
}
// redundant check. postcondition of above is m_producer != null
if (m_producer) {
......
......@@ -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()));
}
m_controller = controller;
loadQmlScene(MonitorSceneDefault);
m_snaps.reset(new SnapModel());
m_glMonitor->getControllerProxy()->resetZone();
if (controller) {
......@@ -1367,6 +1366,7 @@ void Monitor::slotOpenClip(const std::shared_ptr<ProjectClip> &controller, int i
return;
}
m_glMonitor->setRulerInfo((int)m_controller->frameDuration(), controller->getMarkerModel());
loadQmlScene(MonitorSceneDefault);
m_timePos->setRange(0, (int)m_controller->frameDuration());
updateMarkers();
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
m_glMonitor->getControllerProxy()->setClipHasAV(controller->hasAudioAndVideo());
// hasEffects = controller->hasEffects();
} else {
loadQmlScene(MonitorSceneDefault);
m_glMonitor->setProducer(nullptr, isActive());
m_glMonitor->setAudioThumb();
m_audioMeterWidget->audioChannels = 0;
......
......@@ -62,6 +62,8 @@ void QmlManager::setScene(Kdenlive::MonitorId id, MonitorSceneType type, QSize p
}
m_sceneType = type;
QQuickItem *root = nullptr;
const QFont ft = QFontDatabase::systemFont(QFontDatabase::FixedFont);
m_view->rootContext()->setContextProperty("fixedFont", ft);
switch (type) {
case MonitorSceneGeometry:
m_view->setSource(QUrl(QStringLiteral("qrc:/qml/kdenlivemonitoreffectscene.qml")));
......@@ -117,8 +119,6 @@ void QmlManager::setScene(Kdenlive::MonitorId id, MonitorSceneType type, QSize p
if (root && duration > 0) {
root->setProperty("duration", duration);
}
const QFont ft = QFontDatabase::systemFont(QFontDatabase::FixedFont);
m_view->rootContext()->setContextProperty("fixedFont", ft);
}
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