Package: tabler-qicon
Tabler QIconTabler QIconis a Python package that provides easy access toTabler Icons[Preview][GitHub]for PyQt and PySide applications. It uses SVGs from Tabler Icons and converts them into QIcon objects, which can be used in PyQt and PySide applications.This package also supports icon customization such as changing color, size, view box size, stroke width, opacity, and applying transformations like flip and flop.Tabler QIcon v0.2.3is currently synced withtabler-iconsversion 2.44.0. Please refer to theupdate.logfile for more details on the last sync.Preview icons🚀 FeaturesCustomizable Icons: Adjust color, size, view box size, stroke width, opacity, and apply transformations like flip and flop.Developer-Friendly: Python stubs enhance code autocompletion and type-checking in your IDE.
Code AutocompletionBroad Compatibility: Supports PyQt5, PyQt6, PySide2, and PySide6.Transformation Features: Flip and flop transformations can be applied to icons easily. (introduced in v0.2.2)📋 PrerequisitesPython 3.7 or laterOne of the following: PyQt5, PyQt6, PySide2, or PySide6💻 InstallationYou can installtabler-qiconfrom PyPI using pip:pipinstalltabler-qiconAlternatively, you can install it directly from the GitHub repository:pipinstallgit+https://github.com/promto-c/tabler-qicon.gitUsing PyQt5? Install it separately:pipinstallPyQt5🖌️ UsageSetting the BackendUsing Environment Variables (withqtpy)If you're usingqtpyto maintain compatibility across different PyQt/PySide backends, you'll need to specify the backend before importing other modules:importosos.environ['QT_API']='PyQt5'# Change 'PyQt5' to your desired backendfromtablerqiconimportTablerQIcon# ... Additional code ...Using theuse_backendmethodAlternatively, you can also set the backend directly using theuse_backendmethod:importtablerqicontablerqicon.use_backend('PyQt5')fromtablerqiconimportTablerQIcon# ... Additional code ...Default UsageDirectly access icons with default properties:fromPyQt5importQtWidgetsfromtablerqiconimportTablerQIcon# ... Additional code ...refresh_button=QtWidgets.QPushButton("Refresh")# Set the QIcon for the refresh_button using the 'refresh' icon name as an attributerefresh_button.setIcon(TablerQIcon.refresh)Customized IconsInstantiateTablerQIconwith your desired properties.Access icons using icon names.Utilizeflipandfloptransformations for versatile usage of icons.fromPyQt5importQtWidgetsfromtablerqiconimportTablerQIcon# ... Additional code ...# Example: Using a custom opacitytabler_icon=TablerQIcon(opacity=0.6)refresh_button=QtWidgets.QPushButton('Refresh')word_wrap_button=QtWidgets.QPushButton('Word Wrap')play_backward_button=QtWidgets.QPushButton('Play Backward')# Set the QIcon for the refresh_button using the 'refresh' icon name as an attributerefresh_button.setIcon(tabler_icon.refresh)# Set the QIcon for the word_wrap_button using the 'text_wrap' icon name as an attributeword_wrap_button.setIcon(tabler_icon.text_wrap)# Applying flip and flop transformations before setting the iconplay_backward_button.setIcon(tabler_icon.flip.flop.player_play)Retrieve All Icon Namesprint(TablerQIcon.get_icon_names())🛠️ DevelopmentSyncing IconsTo sync icons, we use a shell script that clones the icons from thetabler-iconsrepository and generates a.pyifile to facilitate type hints and autocompletion in IDEs.If you are a contributor or a developer working on this project and need to sync icons, follow the steps below:Run the Sync Script:./sync_tabler_icons.shThis script will:Clone the latest icons from thetabler-iconsrepository.Copy the icons to the target directory.Generate a.pyifile to facilitate type hints and autocompletion.Check the Update Log:After running the script, check theupdate.logfile in theiconsdirectory to ensure that the sync was successful and to view details of the sync.Commit Changes:After successfully syncing the icons and generating the.pyifile, commit these changes to the version control system.Note to ContributorsPlease do not edit the generated.pyifile directly. It is auto-generated by the sync script.Ensure that you have run the sync script and tested the changes locally before submitting a pull request.Running TestsRun the tests to ensure that your changes do not break existing functionality.pytesttests🖋️ Coding StyleAdhering to PEP 8 withflake8oversight. Auto-formatting viayapf. Our docstrings embrace theGoogle Python Style Guidefor clarity and consistency.📜 LicenseTabler QIconis licensed under theMIT License.Note:ThisREADME.mdfile was generated by ChatGPT.