Skip to content

A package for adding a theme management window to any PySide6 applications using PyQtDarkTheme.

License

Notifications You must be signed in to change notification settings

MrSuspicious0/PyQtThemeSettings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PyQtThemeSettings

License Version Downloads

A package for adding a theme management window to any PySide6 applications using PyQtDarkTheme.

Support for PyQt may come at some point, but PySide6 is the official recommendation of Qt for Python, so it's not a priority for me.

Installation

PyQtThemeSettings can be installed using pip

pip install pyqtthemesettings

Usage

Without PyQtThemeSettings

if __name__ == "__main__":
    app = QApplication([]) # Initialise the App
    window = MainWindow() # Initialise Window
    window.show()
    exit(app.exec())

With PyQtThemeSettings

from PyQtThemeSettings import AppSettings

if __name__ == "__main__":
    app = QApplication([])
    app.setOrganizationName("MrSuspicious")
    app.setApplicationName("TestApp")
    settings = QSettings()
    appSettings = AppSettings(settings, app) # Pass in QSettings and QApplication
    window = MainWindow()
    window.show()
    exit(app.exec())

PyQtThemeSettings takes in a QSettings object, which controls where the persistent settings are stored, and a QApplication.

In order to access the settings window, connect whatever signal you wish to the AppSettings.openSettings slot.

To reset to default settings, connect whatever signal you wish to the AppSettings.resetToDefaults slot.

Contribution to the Project

If you have any feature suggestions please feel free to make a pull request!

Also if you happen to test this with a version other than python 3.11 and notice no issues, please let me know so i can change the entry on PyPi