{"id":21023452,"url":"https://github.com/quasarapp/doctorpill","last_synced_at":"2025-03-13T18:17:01.893Z","repository":{"id":83043151,"uuid":"447715754","full_name":"QuasarApp/DoctorPill","owner":"QuasarApp","description":"This is simple library for create productions fixes for your applications. ","archived":false,"fork":false,"pushed_at":"2023-12-31T09:09:14.000Z","size":437,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-20T13:40:18.073Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://quasarapp.ddns.net:3031/docs/QuasarApp/DoctorPill/latest/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/QuasarApp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-01-13T18:51:54.000Z","updated_at":"2022-01-14T16:57:55.000Z","dependencies_parsed_at":"2023-12-31T10:21:52.371Z","dependency_job_id":"69ad0969-5601-4695-84a5-5299c538bad2","html_url":"https://github.com/QuasarApp/DoctorPill","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":"QuasarApp/CMakeProject","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuasarApp%2FDoctorPill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuasarApp%2FDoctorPill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuasarApp%2FDoctorPill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuasarApp%2FDoctorPill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/QuasarApp","download_url":"https://codeload.github.com/QuasarApp/DoctorPill/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243456563,"owners_count":20293905,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-19T11:18:12.535Z","updated_at":"2025-03-13T18:17:01.866Z","avatar_url":"https://github.com/QuasarApp.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Doctor Pill\nThe Doctor pill is simple qt / qml library for fast develop fixes for applications that already released and working in production. \n\nThe library has c++ interface DP::iPill and QML view for diagnostic gui applications.\n\nFor Disable the gui part of the library use the DOCTOR_PILL_GUI option.\n\n\n![2022-01-18 17-50-20](https://user-images.githubusercontent.com/12465465/149961627-2f74d25d-f047-4176-913b-6d3f833603cf.gif)\n\n\n## BUILD OPTIONS\n\n``` cmake \noption(DOCTOR_PILL_GUI \"Enable gui qml model for build\" ON)\noption(DOCTOR_PILL_TESTS \"Enable tests of this library\" ON)\noption(DOCTOR_PILL_EXAMPLE \"Enable example app of this library\" ON)\n```\n\n\n## Include to cmake project\n\n1. add as a submodule this repo \n\n``` bash\n git submodule add https://github.com/QuasarApp/DoctorPill.git\n```\n\n2. Add to build the DoctorPill as a subdirectory\n\n``` cmake\nset(DOCTOR_PILL_GUI ON) # you may change it if you need.\nset(DOCTOR_PILL_TESTS OFF) you may change it if you need.\nset(DOCTOR_PILL_EXAMPLE OFF) you may change it if you need.\n\nadd_subdirectory(DoctorPill)\n```\n\n## Using \n\n### Wihout GUI\n\n\n#### Create a new pill object.\n\n```cpp\n#include \u003cdoctorpill.h\u003e\n\nclass MyPill: DP::iPill {\n    QString name() const override {\n        return \"My pill\";\n    };\n    \n    QString description() const override {\n        return \"Description of my pill\";\n    };\n    \nprotected:\n    bool diagnostic() const override {\n        // some code for search bug\n    };\n    \n    bool fix() const override {\n        // some code for fix found bug\n    };\n}; \n```\n\n#### Use your self created pills\n\n\n```cpp\n#include \u003cdoctorpill.h\u003e\n\n// ...\n\nDP::Doctor _doctor;\nif (_doctor.fix({QSharedPointer\u003cMyPill\u003e::create()})) {\n    // app fixed successfull\n} else {\n    // fail to fix app\n}\n\n// ...\n```\n\n\n\n### Use GUI QML wrapper\n\nFor working with gui wrapper you need to initialize this library before include gui module in to your qml file.\n\n\n#### initialize the library (main.cpp)\n\n\n```cpp\n#include \u003cdoctorpillgui.h\u003e\n\nint main(int argc, char *argv[]) {\n    QCoreApplication::setOrganizationName(\"QuasarApp\");\n    QCoreApplication::setApplicationName(\"DoctorPillExample\");\n\n    QGuiApplication app(argc, argv);\n    QQmlApplicationEngine engine;\n\n    if (!DP::init(\u0026engine)) {\n        return -1;\n    }\n\n    DP::DoctorModel model({QSharedPointer\u003cSomePill\u003e::create()});\n\n    // see next code view \n    engine.load(\"qrc:/Main.qml\");\n    if (engine.rootObjects().isEmpty())\n        return -2;\n\n    // Add new doctor pill model to view\n    QQmlContext* rootContext = engine.rootContext();\n    if (rootContext)\n        rootContext-\u003esetContextProperty(\"doctorPillModel\", \u0026model);\n\n    return app.exec();\n}\n\n\n```\n\n\n#### Using qml view (main.qml)\n\n\n```qml\n\nimport QtQuick 2.15\nimport QtQuick.Controls 2.15\nimport QtQuick.Controls.Material 2.15\nimport DoctorPillModule 1.0\n\nApplicationWindow {\n    width: 800\n    height: 600\n    visible: true\n\n    DoctorView {\n        anchors.fill: parent\n        // use added model in qml file.\n        model: (doctorPillModel)? doctorPillModel: null\n    }\n}\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquasarapp%2Fdoctorpill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquasarapp%2Fdoctorpill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquasarapp%2Fdoctorpill/lists"}