QmlDesigner: Add MetaInfo for functions for Connections and StateGroup

Change-Id: I61d6409d824747d373da4912ef2d894e70436014
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Thomas Hartmann
2022-09-20 16:22:48 +02:00
parent fb7f91ad79
commit c4dd20c64e
3 changed files with 26 additions and 1 deletions

View File

@@ -99,6 +99,8 @@ public:
NodeMetaInfo qtQuickTextMetaInfo() const;
NodeMetaInfo qtQuickTimelineKeyframeGroupMetaInfo() const;
NodeMetaInfo qtQuickTimelineTimelineMetaInfo() const;
NodeMetaInfo qtQuickConnectionsMetaInfo() const;
NodeMetaInfo qtQuickStateGroupMetaInfo() const;
void attachView(AbstractView *view);
void detachView(AbstractView *view, ViewNotification emitDetachNotify = NotifyView);

View File

@@ -55,7 +55,6 @@
All write access is running through this interface
The Model is the central place to access a qml files data (see e.g. rootNode() ) and meta data (see metaInfo() ).
Components that want to be informed about changes in the model can register a subclass of AbstractView via attachView().
\see QmlDesigner::ModelNode, QmlDesigner::AbstractProperty, QmlDesigner::AbstractView
@@ -1911,6 +1910,26 @@ NodeMetaInfo Model::qtQuickTimelineTimelineMetaInfo() const
}
}
NodeMetaInfo Model::qtQuickConnectionsMetaInfo() const
{
if constexpr (useProjectStorage()) {
using namespace Storage::Info;
return createNodeMetaInfo<QtQuick, Connections>();
} else {
return metaInfo("QtQuick.Connections");
}
}
NodeMetaInfo Model::qtQuickStateGroupMetaInfo() const
{
if constexpr (useProjectStorage()) {
using namespace Storage::Info;
return createNodeMetaInfo<QtQuick, StateGroup>();
} else {
return metaInfo("QtQuick.StateGroup");
}
}
NodeMetaInfo Model::qtQuickTimelineKeyframeGroupMetaInfo() const
{
if constexpr (useProjectStorage()) {

View File

@@ -29,6 +29,7 @@ inline constexpr char Buffer[] = "Buffer";
inline constexpr char Camera[] = "Camera";
inline constexpr char Command[] = "Command";
inline constexpr char Component[] = "Component";
inline constexpr char Connections[] = "Connections";
inline constexpr char DefaultMaterial[] = "DefaultMaterial";
inline constexpr char Dialog[] = "Dialog";
inline constexpr char DoubleType[] = "double";
@@ -97,6 +98,7 @@ inline constexpr char Shader[] = "Shader";
inline constexpr char SoundEffect[] = "SoundEffect";
inline constexpr char SplitView[] = "SplitView";
inline constexpr char SpriteParticle3D[] = "SpriteParticle3D";
inline constexpr char StateGroup[] = "StateGroup";
inline constexpr char State[] = "State";
inline constexpr char SwipeView[] = "SwipeView";
inline constexpr char TabBar[] = "TabBar";
@@ -155,6 +157,7 @@ class CommonTypeCache
CacheType<QML_cppnative, QQuickStateOperation>,
CacheType<QtMultimedia, SoundEffect>,
CacheType<QtQuick, BorderImage>,
CacheType<QtQuick, Connections>,
CacheType<QtQuick, GridView>,
CacheType<QtQuick, Image>,
CacheType<QtQuick, Item>,
@@ -169,6 +172,7 @@ class CommonTypeCache
CacheType<QtQuick, Rectangle>,
CacheType<QtQuick, Repeater>,
CacheType<QtQuick, State>,
CacheType<QtQuick, StateGroup>,
CacheType<QtQuick, Text>,
CacheType<QtQuick, TextEdit>,
CacheType<QtQuick, Transition>,