-
-
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
Allow renaming of FX mixer channels with the F2 and enter keys. #4348
Allow renaming of FX mixer channels with the F2 and enter keys. #4348
Conversation
C++ case statements are "fall through", meaning that once you jump into the body of a case, the program runs sequentially until you reach the end brace of the switch block.
This is a common enough idiom that you'd usually write it without the comments. |
Alright, I'll be sure to use that. Figured there must be a way. |
Now there's an issue where pressing enter to confirm the name doesn't work at all. I'm guessing this is because pressing enter causes the rename to trigger again. I'll look at this more tomorrow. |
include/FxMixerView.h
Outdated
@@ -100,6 +100,9 @@ class EXPORT FxMixerView : public QWidget, public ModelView, | |||
void moveChannelLeft(int index, int focusIndex); | |||
void moveChannelRight(int index); | |||
|
|||
// rename the channel |
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.
This comment is useless and should be removed.
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've run into a snag here, and I'd like to reach out for suggestions before I go off and subclass The short versionPressing enter after you've finished making your changes to the channel name does save your changes, but the event is not killed and it propagates after the edit is completed. My code that handles the enter key is called, causing it to go right back into edit mode. The longer version
connect( m_renameLineEdit, SIGNAL( editingFinished() ), this, SLOT( renameFinished() ) );
Based on this forum post, along with other sources, it would seem that I could be mistaken about something, but assuming all this is correct, it would seem that the only way to fix it is to subclass from Or I could use a global variable, but that seems like a bad idea 😝 |
@SecondFlight Are you familiar with event filters (scroll down half way)? I'm not sure they do what you want - I haven't really studied Qt much - but maybe they'd provide a way around your problem? |
@Wallacoloo I tried using those, but I think I may have been using them wrong. I have an idea to try with them that I think might work. |
Yep, I was blocking the event, but I wasn't actually handling it. This is definitely the right way to do it. |
…#4348) * Add f2 as a FX mixer rename shortcut. Enter doesn't work yet. * Add both enter keys, remove code duplication * Fix renaming with enter/return * Clean up
Will resolve #3157. Currently the enter key isn't being hit, and I have no idea why.
I don't like the code duplication here, but I don't believe there's a way to capture multiple cases in one case statement. It could be reasonable to change to an if/else block just to avoid that.