-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Center PianoView in resizeable plugins (SlicerT) #7731
base: master
Are you sure you want to change the base?
Conversation
@@ -264,9 +264,11 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) : | |||
m_tabWidget->addTab(m_tuningView, tr("Tuning and transposition"), "tuning_tab", 5); | |||
|
|||
// setup piano-widget | |||
auto pianoLayout = new QHBoxLayout(); | |||
m_pianoView = new PianoView( this ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@regulus79 wrote:
I would like to get someone's opinion on whether I am managing the layout pointer correctly. Passing this as the parent for the layout caused warnings, since that automatically tries to set the layout as the default layout for the parent. Should I leave it as is and add an explicit call to setParent(this) to make sure this is responsible for deleting the layout?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried calling setParent
but that resulted in more warnings, so I'm not sure how to let qt know that it needs to be deleted. Unless it automatically deletes sub-layouts?
About 4, the decision when i made it was to keep the background of the right portion, as it's pretty common for resizable instruments that keep graphs boxed to have empty space in between. Example, FL Limiter expanded, maybe slightly different cause of the shading, but same situation |
Linking #7513. Milestoning for 1.3. |
Related: #7513
Now that the instrument window for SlicerT is resizeable, one of the many issues is that the piano at the bottom of the window is not centered when you resize the window to be larger than the piano width. This PR attempts to fix that.
Before:
After:
Simply setting the alignment of the piano view to
Qt::AlignHCenter
did not work, since that broke the automatic resizing. However, putting the piano view into aQHBoxLayout
and putting that into the instrument window worked nicely.However, I would like to get someone's opinion on whether I am managing the layout pointer correctly. Passing
this
as the parent for the layout caused warnings, since that automatically tries to set the layout as the default layout for the parent. Should I leave it as is and add an explicit call tosetParent(this)
to make surethis
is responsible for deleting the layout?