summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets/api
Commit message (Collapse)AuthorAgeFilesLines
* Add the missing _p suffix to the private header files in WebEngineQuick/WidgetsAlexey Edelev2024-04-251-1/+1
| | | | | | | Pick-to: 6.5 6.6 6.7 Change-Id: I4b64147cb70c3994ed054374c9047fe9274da777 Reviewed-by: Moss Heim <moss.heim@qt.io> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Retain focus while loading URLs into the pageAnu Aliyas2024-02-251-0/+3
| | | | | | | | | | | | | | While loading URLs, QtWebEngine will remove the old widget from the layout and then add the new widget. If the old widget is the focused widget, while deleting the widget, it will clear its focus, thereby causing QtWebEngine to lose focus. Therefore, if the old widget has focus, set focus to the new widget. Fixes: QTBUG-122153 Pick-to: 6.7 6.6 Change-Id: I095a654ae80ad8089758eb785d4186a9708064a3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Fix for view displaying blank content with transparent backgroundAnu Aliyas2024-02-121-1/+3
| | | | | | | | | | | | | | | | | For transparent background color, QtWebEngine will set the attribute Qt::WA_AlwaysStackOnTop to true. This change necessitates triggering an update on the top-level window. The code has been adjusted to invoke an update on the parent widget if one is present. Additionally, update is disabled while widget attributes are being updated, and re-enabled once all attributes are properly set. This prevents unnecessary updates and ensures the widget updates only after all values are set. Fixes: QTBUG-120273 Fixes: QTBUG-121227 Pick-to: 6.7 6.6 Change-Id: Id2a103a59e9dfeb98ac2245ec274360e3c65f239 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Moss Heim <moss.heim@qt.io>
* Fix text formatting in JS DialogsMartin Negyokru2024-01-101-9/+23
| | | | | | | | | | | | Use plain text instead of escaped html to match other browsers behavior. Also set the text format for qml dialogs. Pick-to: 6.6 6.7 Fixes: QTBUG-119245 Task-number: QTBUG-83338 Change-Id: Icb2c9fd21f27487418835372d6afda96a6812cc3 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Add default styled icons to actionsAnu Aliyas2024-01-062-29/+38
| | | | | | | | | - Added a default icon to action using the newly introduced QWebEngineViewPrivate::webActionIcon() Fixes: QTBUG-119722 Pick-to: 6.6 6.7 Change-Id: I4ee9b4380ead80d991756147bfef40f0f17c0849 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Forward unhandled mouse wheel events to the parent widgetAnu Aliyas2023-12-201-0/+16
| | | | | | | | | | | | | - All mouse wheel events are forwarded to Chromium. - Forward unhandled wheel events by Chromium to the parent widget. - Impersonated QSpontaneKeyEvent in Qt WebEngine to set spontaneous flag and forwarded the event as spontaneous. Fixes: QTBUG-118398 Pick-to: 6.7 6.6 6.5 Change-Id: I4ec831b0077edc3d833fdd7ae8d31a5535b0c05b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Include what you need: <QPointer>Marc Mutz2023-10-161-0/+2
| | | | | | | | | | | | | | | | | | | | | | | All these TUs relied on transitive includes of qpointer.h, maybe to a large extent via qevent.h, though, given that qevent.h is more or less the only public QtBase header that includes qpointer.h, something else seems to be at play here. Said qevent.h actually needs QPointer in-name-only, so a forward declaration would suffice. Prepare for qevent.h dropping the include. The algorithm I used was: If the TU mentions 'passiveGrabbers', the name of the QEvent function that returns QPointers, and the TU doesn't have qpointer.h included explicitly, include it. That may produce False Positives, but better safe than sorry. Otherwise, in src/, add an include to all source and header files which mention QPointer. Exception: if foo.h of a foo.cpp already includes it, don't include again. Task-number: QTBUG-117670 Change-Id: I7c18d8cfea4eb65eb7b518b03eedf3750dd45916 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Fix print button of PDF viewer pluginSzabolcs David2023-07-291-1/+2
| | | | | | | | | | | Do not try to start print preview automatically, just notify the embedder via printRequested signal instead of crashing. Also fix the signal name in WebEngineView docs. Pick-to: 6.6 Task-number: QTBUG-104610 Change-Id: I251e0b8f6f03a73236320a66a0d3c7690939d88b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Better handling of interrupted PDF printingSzabolcs David2023-04-051-0/+3
| | | | | | | | | | | | | | | | | | | | | - Document the fact Stop WebAction can interrupt the in-progress PDF generation. - Update PrintViewManagerQt::PrintPreviewDone(): Normally IsPrintRenderFrameConnected() implies IsRenderFrameLive(), but we have to check both to avoid crash when render process exits. (Like Chrome does.) - Update PrintViewManagerQt::RequestPrintPreview(): Handle that case when print preview params were sent between processes at the beginning, but it was interrupted before RequestPrintPreview() could start PDF generation. - Add a simple auto test to catch crashes Pick-to: 6.5 Task-number: QTBUG-108154 Change-Id: I8a4f9cc97ddcf9a165d66a5981d93a023858fbc1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix build with -no-accessibilityPeter Varga2023-01-091-1/+4
| | | | | | Pick-to: 6.5 Change-Id: I7128608467e4d0ce1b04efa9b82a98f78942d4db Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add touchSelectionMenu for widgetsMartin Negyokru2022-12-122-0/+44
| | | | | | | | | [ChangeLog][QWebEngineWidgets] Added touch selection menu. Task-number: QTBUG-100418 Task-number: QTBUG-91712 Change-Id: Iffb994e429b92389e64cd6a93a0b034d6aa07f66 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix bogus layouting of qwebengineviewMichal Klocek2022-10-171-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | We did not really change pointers for doing a widget and a item delegate binding. This at some point was blowing up as we did not remove the old widget before inserting the new widget into the internal webengineview layout. The issue could get unnoticed for a while as the old widget got eventually removed on a destruction. However, at times when on the qlayout activation call the old widget was considered, resize event was triggered which was setting viewport to false value (minimum size to hold two webcontents). Make sure we remove widget before adding the new widget. This fixes the widget and the item bind, however this logic should be rewritten for dev branch as is get more and more complex. Fixes: QTBUG-107529 Pick-to: 6.4 Change-Id: I31d180b54f52e38b3c335cfa2bf3afa61e449677 Reviewed-by: Martin Negyokru <negyokru@inf.u-szeged.hu> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Port from container::count() and length() to size() - V4Marc Mutz2022-10-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); a.k.a qt-port-to-std-compatible-api V4 with config Scope: 'Container'. Change-Id: I3e6fef8eca212da0c4f0b464545ba96183b4476f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-1/+1
| | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: I4b5f85df579532c2af938fe70db945ba273782fb Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Do not let print engine multiply number of copiesSzabolcs David2022-09-141-1/+6
| | | | | | | | | | | | | | We print multiple pages by repeatedly drawing in a loop, which works good for PDF targets, but fails for physical printing. PPK_CopyCount flag is provided to the printing backend which multiplies our effort in this case. Temporarily setting the print engine back to 1 seems to be more reliable than trying to distinguish between paper of PDF target. Task-number: QTBUG-104224 Change-Id: Ic1be15c6965e6a739bcd44c8d904ac19f67719b5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add touchHandles for widgetsMartin Negyokru2022-08-292-0/+11
| | | | | | | Task-number: QTBUG-100418 Task-number: QTBUG-91712 Change-Id: I69131d3c7c4511ea3114df7a9300bf6ff1a59fee Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix initial widget focusPeter Varga2022-08-241-1/+0
| | | | | | | | | | | | Avoid WebEngineQuickWidget::rootObject() to steal focus from the content item (RenderWidgetHostViewQtDelegateItem). The root object is supposed to keep the content item alive and not handling input events. Fixes: QTBUG-105072 Pick-to: 6.4 Change-Id: I18e8ff39bfe338b742416bc56f6937edcfd2bc21 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Various clean-upsPeter Varga2022-06-241-2/+0
| | | | | | Pick-to: 6.4 Change-Id: I53e04a247a25149d9f29135484c0528c706de7d8 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-226-228/+12
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I869ffda1080e283f231eb0dc4477b260f2054d99 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Remove widget from QWebEnginePagePrivateAllan Sandfeld Jensen2022-06-221-30/+18
| | | | | | | | | It is redundant with item->m_widgetDelegate, once a few inconsistencies were ironed out. Pick-to: 6.4 Change-Id: I18a90cc195e5854d8421aa8c0951872322b78d28 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Cleanup item delegate logicAllan Sandfeld Jensen2022-06-222-25/+21
| | | | | | | | | Remove two indirect values we can calculate without tracking, and clean up naming in webenginequick. Pick-to: 6.4 Change-Id: Ibfab7013f314b428dca707036fe5f027558dff72 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Do not use the native dialog to show the color picker on macOSMichael Brüning2022-06-191-0/+4
| | | | | | | | | | | With the native dialog, there were either problems with the modality when using it asynchronously or with the life cycle when using it synchronously. Not using the native dialog avoids these problems. Pick-to: 6.4 6.3 Task-number: QTBUG-102099 Change-Id: Icb9a9afda48c47558b8e8ecb6d89adc0961d5063 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Support HTML5 <datalist> elementPeter Varga2022-06-193-0/+45
| | | | | | | | | | | | | | | | | The datalist uses Chromium's autofill component to fetch and filter predefined options in the list and autocomplete the field with the selected option. Autofill component is added to build and bound to WebEngine. All the unnecessary autofill features for datalist are supposed to be disabled: payment/credit card support, password manager, save profile data, store suggestions in database etc. Custom popups for the dropdown are implemented for Widget and Quick. Scrolling in dropdown is not implemented in this change. Fixes: QTBUG-54433 Pick-to: 6.4 Change-Id: I155d02d6dbc9d88fbca4bc5f55b76c19d0ba7a9d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Avoid extra window after change of pageAllan Sandfeld Jensen2022-06-111-5/+21
| | | | | | | | | A widget created for an item in a viewless page, still needs to be tracked as a widget. Pick-to: 6.4 Change-Id: I9d571916b28b1cb2b8bd184d008255b9af105c33 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Switch from QT_NO macros to feature checksAllan Sandfeld Jensen2022-06-103-10/+10
| | | | | | | | | | | This is safer by ensuring we are checking for a feature that is defined. For some reason, the openssl feature is a private feature, so we need to include the private header to access it. Pick-to: 6.4 Change-Id: Idf7f3baba33e5188f206f5be1b8a0bfd75e79d03 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Create a RWHV delegate in coreAllan Sandfeld Jensen2022-06-092-77/+324
| | | | | | | | | | This is adapting the Quick code for shared use with widgets, and allows us to use it from QWebEnginePage. Pick-to: 6.4 Fixes: QTBUG-96377 Change-Id: I3f09c1a949eff86d80fbe6c513dc66e3f9f2f611 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Include moc filesAllan Sandfeld Jensen2022-05-311-0/+2
| | | | | | | | Faster to build and gives smaller binaries Fixes: QTBUG-103291 Change-Id: Iab52995e03c13a4c5b185750028c449a19d98d93 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Add convenience constructors to QWebEngineViewAllan Sandfeld Jensen2022-05-092-0/+36
| | | | | | | | Make it easier to use alternative profiles without having to use QWebEnginePage directly. Change-Id: I8406c9ee3b453f7ff45e64bb05d0f5ad57e389c4 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Support setting page to nullptr to unsetAllan Sandfeld Jensen2022-04-221-0/+3
| | | | | | | | Worked in 5.15, and now crashed. This patch returns 5.15 behavior. Pick-to: 6.3 6.2 Change-Id: Ib50dca96d9e90312cd2ee55aaf3205f5b848dd15 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Do not access accessibility from qt post routinesMichal Klocek2021-11-161-1/+4
| | | | | | | | | | | | | | | | | | | It seems accessing accessibility from qt post routines ends badly since caches are gone already. Add closingDown() function to web context, which is similar to QCoreApplication::closingDown(), however return true on post routine. Guard delete accessibility calls. Note the widget part is not necessary, but added for completeness, since only qml can release profiles due to garbage collection. Fixes: QTBUG-90904 Pick-to: 6.2 6.2.2 5.15 Change-Id: Ic0e7115cd17eb58f3d58f70fefbc197dfb7a6493 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Do not cancel custom tooltips by QWebEngineView custom tooltip handlerPeter Varga2021-11-051-12/+12
| | | | | | | | | | | | | | | | | | Tooltips should disappear when chromium requests it and it is done by an explicit call of QToolTip::hideText() (see QTBUG-64933). This, however would also hide a custom "global" tooltip because the custom tooltip event notifies QWebEngineView to remove its own tooltip to avoid more than one in a window. The QWebEngineView's tooltip handler was override and it resulted custom tooltips to hide themselves. As a fix, remove the custom tooltip handler from QWebEngineView and hide tooltips only if requested by Chromium. Fixes: QTBUG-97897 Pick-to: 6.2 Change-Id: I976e49218ec975b10e2f155096f6aec124270fdc Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Disconnect safelyAllan Sandfeld Jensen2021-09-302-2/+8
| | | | | | Pick-to: 6.2 Change-Id: Ic1c25724ea2d6c2241ab2665703380002efae8c3 Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* Clean up coding style in API header filesAllan Sandfeld Jensen2021-08-183-20/+27
| | | | | | Pick-to: 6.2 Change-Id: Ifa5892415a1e0b8ce9b6bfa10719aba618e3b799 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Update documentation notes for build with WebEngine modulesKirill Burtsev2021-08-171-1/+1
| | | | | | | | | | Add cmake usage snippets for module's libraries. Remove quick version from code snippets. Fix minor documentation warnings. Fixes: QTBUG-94937 Pick-to: 6.2 Change-Id: I2e5c8616ceeab495f604e135bb2aa2261c50c68d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Return printToPdf to QWebEnginePageAllan Sandfeld Jensen2021-08-092-55/+10
| | | | | | | | | It doesn't use QPrinter and can be done using QtGui classes only. Pick-to: 6.2 Change-Id: I0e14563c1bb5e93d9803bb1a807f702b1a2a5315 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* Add QWebEnginePage::view() replacementAllan Sandfeld Jensen2021-08-092-0/+16
| | | | | | | | | Make it a static getter in QWebEngineView Pick-to: 6.2 Fixes: QTBUG-95331 Change-Id: I552f0047343abd909c5cd521a7a7a01d62896b00 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Update parameters to findText callbackAllan Sandfeld Jensen2021-07-132-2/+2
| | | | | | | Pick-to: 6.2 Change-Id: I622ff55c1c9b6f9d4818228c75543c3deffa37be Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Various clean-ups around QWebEngineViewPeter Varga2021-07-133-37/+40
| | | | | | Pick-to: 6.2 Change-Id: I16f27054871f63526946101e07cb0dcf4aa3b390 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix build with printing disabledAllan Sandfeld Jensen2021-07-121-0/+1
| | | | | | Pick-to: 6.2 Change-Id: I11d3f61d1c916e6696a1cbf85bb0e0457fe52188 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Clean up includes, forward declarations and friends in core apiPeter Varga2021-07-081-0/+1
| | | | | | Pick-to: 6.2 Change-Id: I58e2dc2443bca75b0d315694c9f6503251a7be02 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Doc: Fix documentation issues for Qt WebEngineTopi Reinio2021-07-011-3/+7
| | | | | | | | | | API and documentation changes since 5.15 caused multiple warnings from QDoc; this change addresses most of them. Some warnings indicate missing documentation, those issues still remain. Pick-to: 6.2 Change-Id: I96be38b7daac37a7e35c149b4b3ec3f18c4415c9 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Fix docs since 6.0 references for new apisKirill Burtsev2021-07-011-1/+1
| | | | | | Pick-to: 6.2 Change-Id: I2d9cf4fffda1ad614388844781ac4fece15dde0d Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Switch printToPdf to std::functionAllan Sandfeld Jensen2021-06-243-10/+13
| | | | | | Pick-to: 6.2 Change-Id: I2660e60665542681bc9b0a479ce7fd9d93b896ae Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Fix some translated messagesFriedemann Kleint2021-06-231-1/+1
| | | | | | | | Give messages a context and use placeholders for arguments. Pick-to: 6.2 Change-Id: Ib07f74f6c9f0024c2851b3e4f2093f980115244d Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Add QPageRanges to PDF printingAllan Sandfeld Jensen2021-06-222-8/+16
| | | | | | | Pick-to: 6.2 Task-number: QTBUG-73497 Change-Id: I0a66c4f1767c54b0bcc9f9a3b61e29c43ec20177 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Switch QWebEngineCallbacks in QWebEnginePage to std::functionAllan Sandfeld Jensen2021-06-173-10/+14
| | | | | | Pick-to: 6.2 Change-Id: I5b0c1c7ef0966c3cff79184aa0733b59208d6890 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Add back the rest of the lost printing documentationAllan Sandfeld Jensen2021-06-111-2/+44
| | | | | | Pick-to: 6.2 Change-Id: I35a4857d873559403d0574a69c59b4fd1e9a952f Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Move printing finished callback to signalAllan Sandfeld Jensen2021-06-112-10/+47
| | | | | | | | | | | We can only have one printer active at a time anyway. At the same time restore some lost documentation. Pick-to: 6.2 Task-number: QTBUG-63235 Change-Id: I454ef3fb038712c832e73c661120fbbe77b3a90c Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Replace Q_NULLPTR and pointer 0 with nullptrAllan Sandfeld Jensen2021-06-101-1/+1
| | | | | | Pick-to: 6.2 Change-Id: Ifd7acf49b22be1532ba98371982af4b14f08e6fc Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Switch QWebEnginePage::findText() to std::functionAllan Sandfeld Jensen2021-06-102-2/+2
| | | | | | | | | Leaving further API modification for later Pick-to: 6.2 Task-number: QTBUG-63235 Change-Id: I75367ee5d4ce071abaeed361d2dc27c64fb6dd8a Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>