Skip to content

Commit f35c640

Browse files
committed
Formatting fixes
1 parent 75d581a commit f35c640

File tree

4 files changed

+10
-14
lines changed

4 files changed

+10
-14
lines changed

src/gui/qml/nodeGraph/ForcefieldDialog.qml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import Dissolve
77
Dialog {
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
}

src/gui/qml/nodeGraph/GraphView.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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 {

src/nodes/forcefield.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
ForcefieldNode::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

1414
std::string_view ForcefieldNode::type() const { return "Forcefield"; }
@@ -21,13 +21,10 @@ std::shared_ptr<Forcefield> &ForcefieldNode::forcefield() { return ff_; }
2121
const 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
3027
void 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
}

tests/gui/forcefieldModel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
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
}

0 commit comments

Comments
 (0)