Open
Conversation
Veratil
reviewed
Jan 19, 2026
| { | ||
| Q_OBJECT | ||
| public: | ||
| using signedSize = signed long long; |
Contributor
There was a problem hiding this comment.
From what I can find it looks like we can do something like this instead of creating our own type here:
#if defined(_MSC_VER)
#include <BaseTsd.h>
using ssize_t = SSIZE_T;
#endif
You can see all the types defined in this header here: https://learn.microsoft.com/en-us/windows/win32/winprog/windows-data-types
Contributor
Author
There was a problem hiding this comment.
I think it is fine to use signed long long in the code. Maybe I will remove this line and replace every 2 references of signedSize with long long.
Member
There was a problem hiding this comment.
We shouldn't include a Win32 header.
I'd recommend using either std::int64_t or this:
using ssize_t = std::make_signed_t<std::size_t>;
messmerd
reviewed
Mar 7, 2026
Comment on lines
+37
to
+38
| VectorGraphView::VectorGraphView(QWidget* parent, size_t cubeWidth, size_t cubeHeight) | ||
| : GridView{parent, new VectorGraphModel{10, 10, GRID_MAX_STEPS, GRID_MAX_STEPS, 200, nullptr, QString(), true}, cubeWidth, cubeHeight} |
Member
There was a problem hiding this comment.
The view shouldn't own the model. A non-owning pointer to the model should be passed to the view in the view's constructor.
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.
closes #7158
closes #4367
Grid Abstraction
This PR addresses a common pattern in lmms: grids. A grid is has regularly spaced horizontal and vertical lines forming squares where usually data is displayed. From this abstraction at least 2 widgets can benefit from:
AutomationEditorandPianoRollGridModel:GridModelis used to manage positions and movement on the grid. It is designed for storing below 10000 objects. For storage it uses 2 vectors, the storage structure is optimized for random access (logarithmic), adding or removing has polynomial complexity (not counting vector reallocation).GridModelcan't store custom data on its own, soGridModelTypedpairs custom data toGridModel.GridView: it draws a grid and implements selection (a functionality all grids should have).Vector Graph
An example widget is implemented using the grid abstraction, the same widget #7158 and #4367 implements.
Comparing this vector graph to #7158:
Comparing this vector graph to #4367:
How to test: