Skip to content
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

Feature/action manager qicon import #3

Open
wants to merge 11 commits into
base: 5.0.x_dev
Choose a base branch
from

Conversation

Ashwolaa
Copy link
Contributor

Qt6 comes with its own library for icons.

This patch now allow direct import of Qt's icon with the action manager either loaded it directly as icons or through their keyword

Syntax goes as:

self.add_action(short_name='refresh',name='Clear', icon_name='ViewRefresh', tip='Clear filter', checkable=False,)
self.add_action(short_name='delete',name='Delete', icon_name=QtGui.QIcon.fromTheme( QtGui.QIcon.ThemeIcon.WindowClose), tip='Delete filter', checkable=False,)

Copy link
Contributor

@seb5g seb5g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is still some cleaning to do and a try/except statement to add. Also could you modify the docstring to explain what are the options for the icon_name:

  • png file name in the icon_library
  • enum name from the QIcon.ThemeIcon (Qt>=6.7)
  • a Path to a png file

src/pymodaq_gui/managers/action_manager.py Outdated Show resolved Hide resolved
src/pymodaq_gui/managers/action_manager.py Outdated Show resolved Hide resolved
src/pymodaq_gui/managers/action_manager.py Outdated Show resolved Hide resolved
src/pymodaq_gui/managers/action_manager.py Show resolved Hide resolved
src/pymodaq_gui/managers/action_manager.py Outdated Show resolved Hide resolved
src/pymodaq_gui/managers/action_manager.py Outdated Show resolved Hide resolved
@Ashwolaa Ashwolaa requested a review from seb5g November 7, 2024 09:32
@seb5g
Copy link
Contributor

seb5g commented Nov 7, 2024

Well I did the review, there are things to do on your side ;-)
And you can add the QIcon as potential input. Make sure to create a test to try it please!

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