File tree Expand file tree Collapse file tree 4 files changed +10
-14
lines changed
Expand file tree Collapse file tree 4 files changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,9 @@ import Dissolve
77Dialog {
88 id: root
99
10+ required property variant graphModel
1011 required property int posx
1112 required property int posy
12- required property variant graphModel
1313
1414 standardButtons: Dialog .Ok | Dialog .Cancel
1515 title: " Define Forcefield: " + sp .name
@@ -21,14 +21,13 @@ Dialog {
2121 SimpleForcefieldModel {
2222 id: sp
2323
24- name: options .currentValue
25-
2624 graphModel: root .graphModel
25+ name: options .currentValue
2726 }
2827 ComboBox {
2928 id: options
30- editable: true
3129
32- model: sp .library
30+ editable: true
31+ model: sp .library
3332 }
3433}
Original file line number Diff line number Diff line change @@ -117,9 +117,9 @@ Pane {
117117 ForcefieldDialog {
118118 id: forcefieldDialog
119119
120+ graphModel: graphRoot .rootModel
120121 posx: Math .round (ctxMenuCatcher .mouseX )
121122 posy: Math .round (ctxMenuCatcher .mouseY )
122- graphModel: graphRoot .rootModel
123123 }
124124 }
125125 MenuItem {
Original file line number Diff line number Diff line change 88
99ForcefieldNode::ForcefieldNode (Graph *parentGraph) : Node(parentGraph)
1010{
11- addOutput<std::shared_ptr<Forcefield>>(" Forcefield" , " Created forcefield" , ff_);
11+ addOutput<std::shared_ptr<Forcefield>>(" Forcefield" , " Created forcefield" , ff_);
1212}
1313
1414std::string_view ForcefieldNode::type () const { return " Forcefield" ; }
@@ -21,13 +21,10 @@ std::shared_ptr<Forcefield> &ForcefieldNode::forcefield() { return ff_; }
2121const std::shared_ptr<Forcefield> &ForcefieldNode::forcefield () const { return ff_; }
2222
2323// Serialise any hidden content
24- void ForcefieldNode::serialiseInternal (SerialisedValue &target) const
25- {
26- target[" forcefield" ] = ff_->name ();
27- }
24+ void ForcefieldNode::serialiseInternal (SerialisedValue &target) const { target[" forcefield" ] = ff_->name (); }
2825
2926// Deserialise any hidden content
3027void ForcefieldNode::deserialiseInternal (const SerialisedValue &node)
3128{
32- ff_ = ForcefieldLibrary::forcefield (std::string_view (node.at (" forcefield" ).as_string ()));
29+ ff_ = ForcefieldLibrary::forcefield (std::string_view (node.at (" forcefield" ).as_string ()));
3330}
Original file line number Diff line number Diff line change 22// Copyright (c) 2026 Team Dissolve and contributors
33
44#include " data/ff/library.h"
5- #include " gui/models/simpleForcefieldModel.h"
65#include " gui/models/nodeGraph/graphModel.h"
6+ #include " gui/models/simpleForcefieldModel.h"
77#include " nodes/forcefield.h"
88#include < gtest/gtest.h>
99
@@ -24,7 +24,7 @@ TEST(ForcefieldModel, Basic)
2424 model.create (0 , 0 );
2525
2626 ASSERT_EQ (graph.nodes ().size (), 3 );
27- auto node = dynamic_cast <ForcefieldNode*>(graph.node (" Kulmala2010" ));
27+ auto node = dynamic_cast <ForcefieldNode *>(graph.node (" Kulmala2010" ));
2828 ASSERT_TRUE (node);
2929 EXPECT_EQ (node->forcefield ().get (), ForcefieldLibrary::forcefield (" Kulmala2010" ).get ());
3030}
You can’t perform that action at this time.
0 commit comments