{"id":23488387,"url":"https://github.com/winsoft666/qwebview","last_synced_at":"2025-05-16T13:05:04.557Z","repository":{"id":49285828,"uuid":"272669486","full_name":"winsoft666/QWebView","owner":"winsoft666","description":"A Qt widget that render and interact with web, support CEF and Microsoft WebView2.","archived":false,"fork":false,"pushed_at":"2025-02-20T04:00:31.000Z","size":38611,"stargazers_count":274,"open_issues_count":1,"forks_count":62,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-04-12T09:18:44.618Z","etag":null,"topics":["cef","qt","webview2"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/winsoft666.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":null},"created_at":"2020-06-16T09:43:51.000Z","updated_at":"2025-03-29T08:06:01.000Z","dependencies_parsed_at":"2024-12-03T18:30:58.082Z","dependency_job_id":"3ba8a8be-ccbd-473b-a45b-6e7e35192e70","html_url":"https://github.com/winsoft666/QWebView","commit_stats":null,"previous_names":["winsoft666/qwebview"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winsoft666%2FQWebView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winsoft666%2FQWebView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winsoft666%2FQWebView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winsoft666%2FQWebView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/winsoft666","download_url":"https://codeload.github.com/winsoft666/QWebView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254535827,"owners_count":22087399,"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","qt","webview2"],"created_at":"2024-12-24T23:03:04.680Z","updated_at":"2025-05-16T13:05:01.490Z","avatar_url":"https://github.com/winsoft666.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿[[简体中文](README_zh.md)|English]\r\n\r\n\u003ch1 align=\"center\"\u003eQWebView\u003c/h1\u003e\r\n\r\nQWebView provides a Qt widget for displaying web pages and interacting with them, and supports the CEF and Microsoft WebView2 browser kernels.\r\n\r\n## Uniform Interface\r\nFor the two different browser kernels, QWebView provides a unified interface. See the [QWebView class](./include/QWebView/Core.h) for details.\r\n\r\n- Call the CreateCEF method to create a QWebView object with the CEF kernel.\r\n\r\n- Call the CreateWebView2 method to create a QWebView object with the Microsoft WebView2 kernel.\r\n\r\n## Non-Strong Dependency on Runtime\r\nQWebView does not strongly depend on the runtime files of CEF and Microsoft WebView2 (such as libcef.dll or EmbeddedBrowserWebView.dll).\r\n\r\nBased on this feature, we can dynamically switch the browser kernel according to the actual running environment of the software. For example, if the Microsoft WebView2 runtime is detected as installed on the user's system, the software will use the WebView2 kernel; otherwise, it will choose to download the CEF runtime or the Microsoft WebView2 runtime.\r\n\r\nSee the [dynamic_engine](./samples/dynamic_engine) example for details.\r\n\r\n## New CEF Integration Method\r\nThis repository was originally named QCefWidget (currently located in the [QCefWidget branch](https://github.com/winsoft666/QCefWidget/tree/QCefWidget)). \r\n\r\nThe original project only supported the CEF kernel, and in terms of implementation, it adopted the approach of implementing all CEF interfaces by itself. This approach may seem elegant, but it involves a large amount of work and has poor flexibility. Especially when adapting to different CEF versions, a large number of judgments and special treatments need to be done using precompiled macros.\r\n\r\n**No matter how the CEF version and its interfaces are updated, its official examples can always run correctly.**\r\n\r\nTherefore, in terms of the implementation of the CEF kernel, QWebView adopts a new approach by directly reusing the code of the cefclient official example, with only a few modifications on that basis. This ensures the stability of functions and facilitates adaptation to different CEF versions.\r\n\r\nCurrently, QWebView is only adapted to the Windows 32-bit version 74.1.19 of CEF. If it is necessary to support other CEF versions (not limited to operating systems and CEF versions), it is not difficult. Just download the corresponding cefclient example code from the [CEF official website](https://cef-builds.spotifycdn.com/index.html) and modify it by referring to the modification methods in this project.\r\n\r\n\u003e Search for \"winsoft666: [update-cefclient]\" in the dep\\cef_binary_74.1.19+gb62bacf+chromium-74.0.3729.157_windows32 directory to find all modifications.\r\n\r\n## Rich Examples\r\nThe abundant examples are not only for demonstrating the usage of QWebView but also for better testing its own functions.\r\n\r\nFor beginners, it is recommended to start with the single_cef or single_webview2 examples, and the comprehensive example is a comprehensive one, which is convenient for testing all functions of QWebView.\r\n\r\n![Screenshot of the Comprehensive Example](./screenshots/Comprehensive.png \"Screenshot of the Comprehensive Example\")\r\n\r\n## Precautions\r\nIn programs using QWebView, it is necessary to call the `QApplication::setQuitOnLastWindowClosed` method to set that the Qt application will not automatically exit when the last window is closed. \r\n\r\nUse the `QWebViewManager::allWebViewsClosed` signal to determine whether to exit the application.\r\n\r\nFor the host window of QWebView, the `Qt::WA_DeleteOnClose` attribute cannot be set, and for the top-level host window of QWebView, additional processing of the QCloseEvent event is required. \r\n\r\nSee the example program for details.\r\n\r\n## Sponsor\r\nThank you for using this project. It would be a great pleasure for me if this project can be of help to you.\r\n\r\n**You can go to my Github [homepage](https://github.com/winsoft666) to make a donation.**","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinsoft666%2Fqwebview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwinsoft666%2Fqwebview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinsoft666%2Fqwebview/lists"}