refactor: QML gui - #2566
Open
RobBuchananCompPhys wants to merge 32 commits into
Open
Conversation
RobBuchananCompPhys
force-pushed
the
dissolve2/gui2
branch
from
August 4, 2026 08:20
65e6f6d to
7b87d5d
Compare
RobBuchananCompPhys
marked this pull request as ready for review
August 7, 2026 09:16
Closed
12 tasks
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please read!
This has been an exercise in pushing the Dissolve2 QML GUI towards something we can use in a basic way, up to and including running graphs. Along the way I've also addressed some "beautification" issues, and just adding some essential utilities here and there. Build it and try it out!
#--PART-1----------------------------------------------------------------------#
(For this bit I basically threw away as much Dissolve1
guicode as possible, mainly model srcs/headers and other Qt6-related files. I wanted to get things down to a minimally "compilable" environment for our new QML gui. This inevitably led to some hanger-on models which I couldn't compile without, and couldn't be 100% sure we'd want to remove, but probably will at some point. They currently reside in a folder markedmodels/legacy. I know this name sounds a bit silly, but its just to keep them clearly grouped together so we know where they are. Also, you might notice the renaming of theguidir togui2andmodels2etc... This was just to aid in transferring things between folders and keeping CMake targets separate, and can be changed back toguiandmodelsif we decide to stick with this structure rather than resurrect the old one! Also, I've moved to designated QML modules, using CMake, for modularising the QML code. This is to give a suggestion as to how a module system could look, and probably doesn't strictly reflect the optimal way of dividing up the code.)#--PART-2----------------------------------------------------------------------#
(I then delved into the QML code for the node-graph and started to try and fit things together in such a way that they can be interacted with in a clean and clear way. After a quick clean up/slight enhancement of the main menu and tabs, I introduced a node search dialog ("Find Node"), accessible from the "Graph" menu. This uses our C++ node-name-by-wildcard to allow you to start typing and select a relevant node from the list, which goes directly in the graph. Also introduced a global
NodeRegistryModelto serve up info about all available nodes. I then refactored the QML forNodeBoxandGraphDelegateto space out components, and make them draggable etc.)#--PART-3----------------------------------------------------------------------#
(The code for controlling the rendering of edges was frankly quite confusing, and didn't seem to connect them to the exact locations of their endpoints. I basically started from scratch here, with a simple linear edge
ShapePath, and created a new C++ model (ParameterEndPointsModel) which belongs to every node in the UI, and records all the available inputs and ouputs and their corresponding QML items - the place where you actually drag/drop the edge. This model then stores direct references to pairs of QML components corresponding to edge-linked parameters between nodes, and updates the linear path whenever the position of those areas changes, and if either source/target node is deleted, they are automatically destroyed.)#--PART-4----------------------------------------------------------------------#
(Nodes have been made richer/ more "descriptive":
NodeRegistryModelof how many of each type of node is already in existenceInfo,Warning, andError, accessed from a popup menu inside the node. The presence of errors are indicated in the corner of the node. Graph process results are displayed in the message log of the node which was run.#--CHEAT-SHEET----#
To get things working
#---TODO----#
NodeRegistry, rather than something hardcoded into the UI, which is the current state.IterableGraphproxy I/O doesn't show up yet. Ideally, you should be able to make arbitrary connections to the proxy inputs, for instance. This will probably be a blocker on immediately using this code to run graphs will looping behaviour, unfortunately!