summaryrefslogtreecommitdiff
path: root/src/webenginewidgets/api/qwebengineview.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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-121-0/+38
| | | | | | | | | [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-291-0/+8
| | | | | | | 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>
* Use SPDX license identifiersLucie Gérard2022-06-221-38/+2
| | | | | | | | | | | 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-221-24/+20
| | | | | | | | | 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-191-0/+31
| | | | | | | | | | | | | | | | | 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-101-6/+6
| | | | | | | | | | | 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-091-54/+317
| | | | | | | | | | 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>
* Add convenience constructors to QWebEngineViewAllan Sandfeld Jensen2022-05-091-0/+34
| | | | | | | | 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-301-2/+7
| | | | | | Pick-to: 6.2 Change-Id: Ic1c25724ea2d6c2241ab2665703380002efae8c3 Reviewed-by: Kirill Burtsev <kirill.burtsev@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-091-50/+9
| | | | | | | | | 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-091-0/+14
| | | | | | | | | 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-131-1/+1
| | | | | | | 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-131-25/+29
| | | | | | 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>
* 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-241-6/+11
| | | | | | 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-221-6/+9
| | | | | | | 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-171-6/+6
| | | | | | 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-111-9/+45
| | | | | | | | | | | 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>
* Switch QWebEnginePage::findText() to std::functionAllan Sandfeld Jensen2021-06-101-1/+1
| | | | | | | | | 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>
* Drop printsupport dependency from coreSzabolcs David2021-06-031-1/+125
| | | | | | | | | Prevent linkage of core to widgets by moving printing API from QWebEnginePage to View and using QPagedPaintDevice (the QtGui ancestor of QPrinter) where it's needed. Change-Id: I6ea96edb495b0dcaaa584bbe72632fda025c18d3 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Move createWindow to a signalAllan Sandfeld Jensen2021-06-031-1/+1
| | | | | | | | | | | | | | Ports QQuickWebEngineNewViewRequest to QtWebEngineCore. [ChangeLog][QtWebEngineQuick][WebEngineView] WebEngineView::NewViewRequested is now handled with WebEngineView::acceptAsNewView() instead of with WebEngineNewViewRequest::openIn(). Task-number: QTBUG-74587 Change-Id: I9b27128948076e13f2c228458e1e7491df12153d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Add missing FileSelectionMode enum valueBalazs Egedi2021-05-311-1/+0
| | | | | | | FileSelectUploadFolder value is added. Change-Id: Ie69782234bcbf3460d2999ac08ee9f88dea190c7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add WebEngineWidgets, WebEngineQuick modules cmake buildMichal Klocek2021-05-191-2/+2
| | | | | | | | | Fix some library dependencies and make proper header includes in core. Task-number: QTBUG-91760 Change-Id: I415361dd42ef2cc39716ce3f5f56e6e8556ac4c8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Replace 0 pointer constants with nullptrAllan Sandfeld Jensen2021-03-221-1/+1
| | | | | Change-Id: I938b593deef66c782f5b0998948c0a7b2c32f656 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2021-03-161-1/+9
|\ | | | | | | Change-Id: I0dd7c64669f4b130047a4a3836f62f7ee5b5f8d9
| * Only disconnect QWebEnginePage signals that QWebEngineView connectedMichael Brüning2021-03-111-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | When the QWebEnginePage changed on a QWebEngineView, all signal connec- tions between the view and the previous page were removed as well, even those that the user connected themself. To prevent unexpected behavior, only disconnect the signals that the view connected to automatically and leave the rest of the connections intact when the page on the view is changed. Fixes: QTBUG-90509 Change-Id: Icac3e3be0b598dec8107e8fffdf7f25dd88a4b71 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | Drop dependency on QWebEngineView in pageMichal Klocek2020-11-241-4/+79
| | | | | | | | | | | | | | Introduce temporarily PageView interface and DummyDelegate. Change-Id: I3a3d57435c98b31a15fb6d777045e141d007486f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Move default notification presenter setter to viewMichal Klocek2020-11-241-0/+5
| | | | | | | | | | | | | | | | | | Default notification presenter depends on qsystemtryicon, so it depends on widgets, move setter when page is set on view. Change-Id: I379b083fe66a4b44e4b92e01a7e5270837fd645c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Move styled icons from page to viewMichal Klocek2020-11-231-0/+28
| | | | | | | | | | | | | | | | | | Styles are bound to widgets, add styled action's icon on QWebEngineView::pageAction(). Change-Id: Ica7b1688c34c51e746a3b4707a6181c0d45c882a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Move page's view and widget bindings to viewMichal Klocek2020-11-201-2/+89
| | | | | | | | | | Change-Id: Ia60a1b864bb173bfd12a94ac4791477a88ea0842 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Move dialogs from view to pageMichal Klocek2020-11-201-1/+147
| | | | | | | | | | Change-Id: Ib0f0ccca0d94c6c8f19d7d359bbf79110ba04f3e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Fix almost all deprecation warningsJüri Valdmann2020-08-131-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace QString::fromUtf16({const ushort * -> const char16_t}) QMap::{unite -> insert} Q{Hover,DragEnter,DragMove,Drop}Event::{posF() -> position()} Q{Hover,DragEnter,DragMove,Drop}Event::{pos() -> position().toPoint()} Q{DragEnter,Drop}Event::{mouseButtons -> buttons} Q{DragEnter,Drop}Event::{keyboardModifiers -> modifiers} QMouseEvent::{localPos -> position} QMouseEvent::{windowPos -> scenePosition} QMouseEvent::{screenPos -> globalPosition} These should all be just renames without any change in behavior (save for some floating point conversions). The one remaining issue concerns the deprecation of binary JSON in qtbase, which is recommended to be replaced with CBOR. Change-Id: I8f3b533242fe9a58c08c2b09ff5d0bdbbfa6dd17 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>