Skip to content

Add a perDockWidget ContextMenu hook #742

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pylessard
Copy link

Add an overridable hook to extend the context menus.
Would allow someone to extend the CDockWidget class to add some custome feature.

Main goal is to add a "Rename" feature in my project.

@pylessard
Copy link
Author

Just a quick note of context. In my application, the user can build a "dashboard". Some CDockWidget can be instatiated at will, some other can only have a single isntance. I want the user to be able to rename his tabs, but not the apps one.

It's a debugger software. The variable list is in a app-wide widget. Use can have many watch/graph windows.

Implementing custom contextmenu with a factory in this case would be a bit clunky. I find this solution more elegant.

Cheers

@pylessard
Copy link
Author

pylessard commented May 1, 2025

I just realized that this may not be very friendly for the state save/reload feature. It would be useful to my application though.

I will leave it to you to decide wether you want the PR in or not. I can probably make it work with a custom factory

@githubuser0xFFFF
Copy link
Owner

Hi Pierre, thank you very much fpr your pull request, Please consider my review comments.

I like your solution and will merge it after you considered my review comments. If you would like to make your contribution perfekt, you could add a small example to the demo application that shows this features and can be used for testing. Also adding some lines to the documentation that explains this feature would be really nice - but I will also merge it without these additional improvements,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants