-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathLabelTrackAddOn.cpp
More file actions
43 lines (33 loc) · 1.38 KB
/
LabelTrackAddOn.cpp
File metadata and controls
43 lines (33 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "LabelTrackAddOn.h"
#include <QQmlComponent>
#include <CoreApi/runtimeinterface.h>
#include <QAKQuick/quickactioncontext.h>
#include <coreplugin/ProjectWindowInterface.h>
namespace VisualEditor::Internal {
LabelTrackAddOn::LabelTrackAddOn(QObject *parent) : WindowInterfaceAddOn(parent) {
}
LabelTrackAddOn::~LabelTrackAddOn() = default;
void LabelTrackAddOn::initialize() {
auto windowInterface = windowHandle()->cast<Core::ProjectWindowInterface>();
{
QQmlComponent component(Core::RuntimeInterface::qmlEngine(), "DiffScope.VisualEditor", "LabelTrack", this);
if (component.isError()) {
qFatal() << component.errorString();
}
auto o = component.createWithInitialProperties({
{"addOn", QVariant::fromValue(this)},
});
if (component.isError()) {
qFatal() << component.errorString();
}
o->setParent(this);
windowInterface->actionContext()->addAction("org.diffscope.visualeditor.arrangementPanel.additionalTracks.label", o->property("labelTrackComponent").value<QQmlComponent *>());
}
}
void LabelTrackAddOn::extensionsInitialized() {
}
bool LabelTrackAddOn::delayedInitialize() {
return WindowInterfaceAddOn::delayedInitialize();
}
}
#include "moc_LabelTrackAddOn.cpp"