{"id":18746345,"url":"https://github.com/hiitiger/qtcef","last_synced_at":"2025-04-12T21:33:46.432Z","repository":{"id":64001043,"uuid":"50017226","full_name":"hiitiger/QtCef","owner":"hiitiger","description":"A Cef Qt port , inject C++ API to Cef js context using reflection based on Qt's meta object system ","archived":false,"fork":false,"pushed_at":"2019-03-26T18:51:51.000Z","size":51831,"stargazers_count":87,"open_issues_count":2,"forks_count":19,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-26T16:21:22.731Z","etag":null,"topics":["cef","cef3","cplusplus","qt"],"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/hiitiger.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}},"created_at":"2016-01-20T08:51:38.000Z","updated_at":"2025-03-05T07:38:55.000Z","dependencies_parsed_at":"2023-01-14T18:15:26.395Z","dependency_job_id":null,"html_url":"https://github.com/hiitiger/QtCef","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiitiger%2FQtCef","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiitiger%2FQtCef/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiitiger%2FQtCef/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiitiger%2FQtCef/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hiitiger","download_url":"https://codeload.github.com/hiitiger/QtCef/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248636803,"owners_count":21137527,"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":["cef","cef3","cplusplus","qt"],"created_at":"2024-11-07T16:25:08.428Z","updated_at":"2025-04-12T21:33:41.425Z","avatar_url":"https://github.com/hiitiger.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QtCef\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/82b587014d2548db9724bb6db8fd5d43)](https://app.codacy.com/app/hiitiger/QtCef?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=hiitiger/QtCef\u0026utm_campaign=Badge_Grade_Dashboard)\n\nIntegrate CEF and Qt,  inject C++ API to CEF web page by utilizing reflection system based on Qt's MOC.\n\n\n## Note\n1. this is for Qt5, checkout qt4archive branch for Qt4\n2. need VS2015 or later\n\n ## Build\n1. download CEF 3.3538 to deps direcotry and unzip to dir cef3538\n2. build cef libcef_dll_wrapper with VS2015\n3. copy cef.lib and libcef_dll_wrapper.lib to common/lib/debug or common/lib/release, copy cef release dlls and resources to bin/debug or bin/release\n4. generator VS2015 solution with qmake -tp vc -r\n5. build all \n\n## Usage\n\nWith Qt's MOC based reflection, we can utilize it to inject C++ api into Cef web page without manually add every signle method and event for every single api.\n\n```c++\n    //main process\n    QCefOSWidget* webWidget = new QCefOSWidget();\n    MyAppApi* api = new MyAppApi(parent);\n    QCefApiAdapter* adapter = new QCefApiAdapter(webWidget, parent);\n    adpater-\u003einitApi(api, \"myapp\", \"app\");\n\n    MyToolApi* toolApi = new MyToolApi(parent);\n    QCefApiAdapter* toolApiAdapter = new QCefApiAdapter(webWidget, parent);\n    toolApiAdapter-\u003einitApi(toolApi, adapter-\u003eapiPath(), \"tool\");\n\n    //we are good to go\n    //webpage\n    a = {\"a\": 123};\n    myapp.app.apiFunc(a, data =\u003e console.log(data));\n    myapp.app.apiAsyncFunc(a).then( data =\u003e console.log(data));\n    myapp.app.someEvent.addListener( data =\u003e console.log(data));\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiitiger%2Fqtcef","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhiitiger%2Fqtcef","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiitiger%2Fqtcef/lists"}