forked from qt-creator/qt-creator
QmlDesigner: Inline TimeLineContext
Change-Id: Ifa002d1c9100c28ac9a382c8fced3b834122ef85 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -1049,7 +1049,6 @@ extend_qtc_plugin(QmlDesigner
|
|||||||
timelineactions.cpp timelineactions.h
|
timelineactions.cpp timelineactions.h
|
||||||
timelineanimationform.cpp timelineanimationform.h
|
timelineanimationform.cpp timelineanimationform.h
|
||||||
timelineconstants.h
|
timelineconstants.h
|
||||||
timelinecontext.cpp timelinecontext.h
|
|
||||||
timelinecontrols.cpp timelinecontrols.h
|
timelinecontrols.cpp timelinecontrols.h
|
||||||
timelineform.cpp timelineform.h
|
timelineform.cpp timelineform.h
|
||||||
timelinegraphicslayout.cpp timelinegraphicslayout.h
|
timelinegraphicslayout.cpp timelinegraphicslayout.h
|
||||||
|
@@ -1,21 +0,0 @@
|
|||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
||||||
|
|
||||||
#include "timelinecontext.h"
|
|
||||||
#include "timelineconstants.h"
|
|
||||||
#include "timelinewidget.h"
|
|
||||||
|
|
||||||
namespace QmlDesigner {
|
|
||||||
|
|
||||||
TimelineContext::TimelineContext(QWidget *widget)
|
|
||||||
: IContext(widget)
|
|
||||||
{
|
|
||||||
setWidget(widget);
|
|
||||||
setContext(Core::Context(TimelineConstants::C_QMLTIMELINE));
|
|
||||||
setContextHelpProvider([this](const Core::IContext::HelpCallback &callback) {
|
|
||||||
if (auto *widget = qobject_cast<TimelineWidget *>(m_widget))
|
|
||||||
widget->contextHelp(callback);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace QmlDesigner
|
|
@@ -1,20 +0,0 @@
|
|||||||
// Copyright (C) 2018 The Qt Company Ltd.
|
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <coreplugin/icontext.h>
|
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
|
|
||||||
namespace QmlDesigner {
|
|
||||||
|
|
||||||
class TimelineContext : public Core::IContext
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit TimelineContext(QWidget *widget);
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace QmlDesigner
|
|
@@ -7,7 +7,6 @@
|
|||||||
#include "easingcurve.h"
|
#include "easingcurve.h"
|
||||||
#include "timelineactions.h"
|
#include "timelineactions.h"
|
||||||
#include "timelineconstants.h"
|
#include "timelineconstants.h"
|
||||||
#include "timelinecontext.h"
|
|
||||||
#include "timelinewidget.h"
|
#include "timelinewidget.h"
|
||||||
|
|
||||||
#include "timelinegraphicsscene.h"
|
#include "timelinegraphicsscene.h"
|
||||||
@@ -640,13 +639,9 @@ void TimelineView::registerActions()
|
|||||||
|
|
||||||
TimelineWidget *TimelineView::createWidget()
|
TimelineWidget *TimelineView::createWidget()
|
||||||
{
|
{
|
||||||
if (!m_timelineWidget) {
|
if (!m_timelineWidget)
|
||||||
m_timelineWidget = new TimelineWidget(this);
|
m_timelineWidget = new TimelineWidget(this);
|
||||||
|
|
||||||
auto *timelineContext = new TimelineContext(m_timelineWidget);
|
|
||||||
Core::ICore::addContextObject(timelineContext);
|
|
||||||
}
|
|
||||||
|
|
||||||
return m_timelineWidget;
|
return m_timelineWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2,9 +2,7 @@
|
|||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||||
|
|
||||||
#include "timelinewidget.h"
|
#include "timelinewidget.h"
|
||||||
#include "bindingproperty.h"
|
|
||||||
#include "curvesegment.h"
|
#include "curvesegment.h"
|
||||||
#include "easingcurve.h"
|
|
||||||
#include "easingcurvedialog.h"
|
#include "easingcurvedialog.h"
|
||||||
#include "timelineconstants.h"
|
#include "timelineconstants.h"
|
||||||
#include "timelinegraphicsscene.h"
|
#include "timelinegraphicsscene.h"
|
||||||
@@ -45,6 +43,8 @@
|
|||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
|
using namespace Core;
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
class Eventfilter : public QObject
|
class Eventfilter : public QObject
|
||||||
@@ -281,6 +281,9 @@ TimelineWidget::TimelineWidget(TimelineView *view)
|
|||||||
connect(m_playbackAnimation, &QVariantAnimation::finished, onFinish);
|
connect(m_playbackAnimation, &QVariantAnimation::finished, onFinish);
|
||||||
|
|
||||||
TimeLineNS::TimelineScrollAreaSupport::support(m_graphicsView, m_scrollbar);
|
TimeLineNS::TimelineScrollAreaSupport::support(m_graphicsView, m_scrollbar);
|
||||||
|
|
||||||
|
IContext::attach(this, Context(TimelineConstants::C_QMLTIMELINE),
|
||||||
|
[this](const IContext::HelpCallback &callback) { contextHelp(callback); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void TimelineWidget::connectToolbar()
|
void TimelineWidget::connectToolbar()
|
||||||
|
Reference in New Issue
Block a user