Skip to content

Conversation

@MrStevns
Copy link

@MrStevns MrStevns commented Nov 9, 2019

Hey David

I've made some changes to the PR, mainly to fix some nasty inconsistent crashes I experienced, seemingly because you keep reference of keyframe and layer but at some point those references are not accessible in memory anymore. In general I didn't see the need to add that complexity for now and therefore removed those variables, we can optimise later if neccesary.

I've changed the text edit widget to a variation of QPlainTextEdit, mainly to get multiple lines but also by creating my own class derived from QPlainTextEdit, we can now update the fields based on its focus event. This means that the apply button becomes redundant because it will update whenever you leave the widget, eg. click no the canvas, change tool etc...

A few things to note:

  1. Unless you initialise a class object in the header eg. Keyframe keyframe and not KeyFrame* keyframe, you should use forward declaration and declare the include in the source file instead, this can make a big difference in compile time as the header has to recompile every time but the class can be cached.

  2. Avoid stuff like this:

comments.tagName().remove(0, 5).toInt();

it's hacky, instead create a tag and use that attribute, like you did previously.

  1. Unless you know a method should be accessible from another class, keep the method private. This makes it much easier to understand when to use what and where.

Thanks for taking the initiative to make this, I hope you find my comments helpful :)

+ Added new KeyFrameTextEdit class to make it possible to save on focus changes
  + Makes apply button redundant
  + Allows for multiple lines
+ No text limit.
+ Some refactoring
@davidlamhauge
Copy link
Owner

I made a branch yesterday, that used the QPlainTextEdit, and some other of the changes you suggest, so I see that as a good sign. My branch was not nearly you've presented here, so I merge your PR.
Thanks a lot!

@davidlamhauge davidlamhauge merged commit ec81770 into davidlamhauge:issue1288_comments_to_frames Nov 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants