{"id":24876029,"url":"https://github.com/jomart02/qssstylemanager","last_synced_at":"2026-04-19T13:32:11.893Z","repository":{"id":275181185,"uuid":"925326865","full_name":"Jomart02/QssStyleManager","owner":"Jomart02","description":"StyleManager for dynamically setting qt qss styles and working with several styles simultaneously from different parts of the program (qt c++)","archived":false,"fork":false,"pushed_at":"2025-03-14T08:27:38.000Z","size":9,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T02:45:35.377Z","etag":null,"topics":["cpp","linux","qss","qss-design","qt","singleton","windows"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jomart02.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-31T17:03:38.000Z","updated_at":"2025-03-14T08:52:43.000Z","dependencies_parsed_at":"2025-01-31T18:25:51.448Z","dependency_job_id":"84168826-7cad-403f-b306-9410947dae0d","html_url":"https://github.com/Jomart02/QssStyleManager","commit_stats":null,"previous_names":["jomart02/qssstylemanager"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Jomart02/QssStyleManager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jomart02%2FQssStyleManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jomart02%2FQssStyleManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jomart02%2FQssStyleManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jomart02%2FQssStyleManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jomart02","download_url":"https://codeload.github.com/Jomart02/QssStyleManager/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jomart02%2FQssStyleManager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32009112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","linux","qss","qss-design","qt","singleton","windows"],"created_at":"2025-02-01T08:19:26.775Z","updated_at":"2026-04-19T13:32:11.876Z","avatar_url":"https://github.com/Jomart02.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Windows](https://github.com/barry-ran/QtScrcpy/workflows/Windows/badge.svg)\n![Ubuntu](https://github.com/barry-ran/QtScrcpy/workflows/Ubuntu/badge.svg)\n[![Qt](https://img.shields.io/badge/Qt-6.x-66cc00.svg)](https://www.qt.io/)\n[![C++](https://img.shields.io/badge/C%2B%2B-17.0-4c979e.svg)](https://isocpp.org/)\n\n# QssStyleManager\nStyleManager for dynamically setting qt qss styles and working with several styles simultaneously from different parts of the program (qt c++)\n\n# Feautures\n\n## Init QSS \n\nIn order to register your style file, you need to install it through this function\n``` c++ \n\n//example \nStyleManager::getInstance()-\u003esetQssFile(objectName(),\":/style/style\");\n\n// set QSS-file for owner\nvoid setQssFile(const OwnerStyle \u0026owner, const QString \u0026qssFilePath);\n```\n\nOwnerStyle - your key to working with your style\n\n## Init style settings \nIn order to add style settings, you must set them using the same key as follows\n\n```c++\n//example\nStyleManager::getInstance()-\u003eaddStyle(objectName(), \"day\", \":/style/day\");\nStyleManager::getInstance()-\u003eaddStyle(objectName(), \"night\", \":/style/night\");\n// add JSON-settings for style\n void addStyle(const OwnerStyle \u0026owner, const NameStyle \u0026styleName, const QString \u0026jsonFilePath);\n```\n## Get result style\n\nAfter that you can get your result\n```c++\n setStyleSheet(StyleManager::getInstance()-\u003egetStyle(objectName(), \"day\"));\n```\n\n## QSS structure \n\nFor this manager to work, you will need a style in which all fields for parsing must be wrapped in { }\n\n```css\n/* example */\nQComboBox, QAbstractSpinBox, QLineEdit , QDateTimeEdit , QTimeEdit, QDateEdit{\n    border: 1px solid {editWidgetBorder}; \n    padding-left: 2px;\n    font-weight: bold;\n    background-color:{editWidgetBackground};\n    border-radius: 8px;\n    color: {baseTextColor};\n}\n\nQCheckBox{\n    color: {baseTextColor};\n    font-weight: bold;\n    background-color: transparent;\n    height: 40px;\n}\nQCheckBox::indicator {\n    width: 40px;\n    height: 40px;\n    image: url({iconCheckBox});\n}\nQCheckBox::indicator:checked {\n    image: url({iconCheckBoxChecked});\n}\n\n```\n\nAnd the settings json file for these keys\n\n```json \n     day.json example\n\n    \"baseBackgroundColor\":\"#E9F8FF\",\n    \"labelDefault\":\"#7E7E7E\",\n    \"GroupBoxColor\": \"#FFFFFF\",\n    \"baseTextColor\": \"#000000\",\n\n    \"iconCombobox\": \":/style/ArrowPopup\",\n    \"iconCheckBox\": \":/style/unchecked\",\n    \"iconCheckBoxChecked\": \":/style/checked\",\n    \"iconRadioButton\": \":/style/radioNo\",\n    \"iconRadioButtonChecked\": \":/style/radioYes\",\n\n    \"editWidgetBorder\":\"#4150de\",\n    \"editWidgetBorderDisabled\":\"#F0F0F0\",\n    \"editWidgetDisabledText\":\"#CECECE\",\n     ...\n```\n```json \n     hight.json example\n     \n     \"baseBackgroundColor\":\"#485160\",\n     \"labelDefault\":\"#CECECE\",\n     \"GroupBoxColor\": \"#2B313A\",\n     \"baseTextColor\": \"#F0F0F0\",\n\n     \"iconCombobox\": \":/style/ArrowPopupNight\",\n     \"iconCheckBox\": \":/style/uncheckedNight\",\n     \"iconCheckBoxChecked\": \":/style/checkedNight\",\n     \"iconRadioButton\": \":/style/radioNoNight\",\n     \"iconRadioButtonChecked\": \":/style/radioYesNight\",\n\n     \"editWidgetBorder\":\"#4150de\",\n     \"editWidgetBorderDisabled\":\"#000000\",\n     \"editWidgetDisabledText\":\"#7E7E7E\",\n     ...\n```\n\n\n## Custom style\nTo set up a directory for custom styles, you must specify its directory\n\n```c++\n     StyleManager::getInstance()-\u003einit(CUSTOM_STYLES);\n```\n\nYou can check if there are custom styles and the directory itself\n```c++\n     StyleManager::getInstance()-\u003eisCustomStyles(CUSTOM_STYLES)\n```\n\n\nGet custom Styles\n```c++\n     // using CustomStyles = QList\u003cQPair\u003cQString, QString\u003e\u003e;\n     // first - name style(filename)\n     // second - path to file\n\n auto styles =  StyleManager::getInstance()-\u003egetCustomStyl(CUSTOM_STYLES);\n    if(!styles.empty()){\n        for(auto style : styles){\n            StyleManager::getInstance()-\u003eaddStyle(objectName(), style.first, style.second);\n        }\n    }\n```\n\nYou can use any key for your style \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjomart02%2Fqssstylemanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjomart02%2Fqssstylemanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjomart02%2Fqssstylemanager/lists"}