summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
...
* Add Ctrl+R shortcut for reload.Zeno Albisser2014-02-061-0/+4
| | | | | Change-Id: Ia7bb688e3ace174da7fd5957a35f47f9b886952f Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Fix reload button in the QuickNanoBrowserAdam Kallai2014-01-281-1/+1
| | | | | Change-Id: I3670380d76d014a33e0112631bdb42927b67b9d9 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Get rid of tr1/functionalJocelyn Turcotte2014-01-272-20/+32
| | | | | | | | | | This header requires rtti in libstdc++ on Mac, which we can't recommend since Qt itself is usually built without rtti. Replace its uses with simpler hand-made template functors. Change-Id: Ic020dcceaf262f77d92b31a8318a513fa200428d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Implement QWebEnginePage::toHtml and toPlainTextJocelyn Turcotte2014-01-222-13/+25
| | | | | | | | | | | | | | | | Those methods are now made asynchronous and need to be given a callback to handle the result. Update the code in the browser and fancybrowser examples using std::bind when using C++11 or tr1::bind with C++03 (which should be available with compilers on platforms that we support). Add a (currently failing) earlyToHtml test to make sure that an empty page doesn't crash because of a possibly incomplete attachment of the QtRenderViewObserver. Change-Id: I3ab7cb6f25b91b584dd80df5e4e9ad1e3214348e Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Pave the way for our UI delegation strategy.Pierre Rossi2014-01-154-6/+71
| | | | | | | | | | | | | | | | | | | Starting with the context Menus for QtQuick. Add default UI delegates as a subproject. We allow ourselves to use Qt Quick Controls there for in order to get a nice "out of the box" experience for things like context menus, dialogs, etc while leaving the door open for system embedders to override this. Opting out of the deployment of these QML files is still very primitive but can be done by passing WEBENGINE_CONFIG+=no_ui_delegates at qmake time. Customization of context menus could be done via a qml component, which is probably best kept in experimental for now while we address its shortcomings. Change-Id: I0705b20d5ddd3bb010f9371b65a181c6b02a03e1 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Fix installation of most examplesSimon Hausmann2014-01-153-1/+6
| | | | | | | | | | * Make sure the example source code is installed * Make sure the installation path is consistent with the path within the module, to ensure that the sources end up next to the compiled binary. * Skip the widgets nano browser from the installation, as it's a developer tool. Change-Id: I35b421e12f8e6ddd3f2045e318b21543ff929cd8 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Disable currently unsupported features in browser example.Zeno Albisser2014-01-141-6/+24
| | | | | Change-Id: I09ce8ad0372a80a2f19b95a2ba0a6fa8635debea Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Disable viewSourceAction in fancybrowser for now.Zeno Albisser2014-01-141-0/+2
| | | | | | | | This should be enabled again as soon as we have toHtml() implemented. Change-Id: I843112aa2778c05bbac9ab51f5427850a862f247 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* quicknanobrowser: reset progress bar when reaching 100%Zeno Albisser2013-12-231-1/+1
| | | | | Change-Id: I146df83948017b5ad72e40d16a8cc7105691c309 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* createWindow QML API for QQuickWebEngineViewJocelyn Turcotte2013-12-232-18/+70
| | | | | | | | | | | | | | | | | | | | | | | | | This implements adoptNewWindow for QQuickWebEngineView. The API is only intended to be used through QML to avoid delegating the QQuickWebEngineViewHandle ownership through a signal parameter. Another limitation of the implementation is currently to fail the handle adoption unless it is done synchronously within the adoptNewWindow call. To support this we would need to delay the call to WebContentsAdapter::initialize which will leave the adapter without a client when returning to the event loop and would require putting null checks everywhere it is used. So I would prefer to keep the API limited and avoid potential crashes. If we want to support asynchronous Loader elements or QML files fetched from the network in the future, the API should be able to scale to the task once we've adjusted the implementation. This also adds basic tabs support in the quicknanobrowser example. The url property is now set imperatively to avoid overwriting the adopted WebContentsAdapter's loading URL. Change-Id: Iba5c5dc3ffa21045f356be131ca15c01b9aee7c8 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Fix the build with Qt 5.1Andras Becsi2013-11-261-0/+2
| | | | | | | | We are still able to build with Qt 5.1 if we disable the hardware acceleration codepaths. Change-Id: Ic748dac0a7f25bbd79f2f711a18431872cebd917 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Remove the need for application to set an RPATH.Jocelyn Turcotte2013-11-184-4/+4
| | | | | | | | | | | | | The WebEngineWidgets module and the WebEngine QtQuick plugin libraries already have the RPATH set properly in their headers and the application won't need to link any symbol directly to the Core library. Remove the RPATH directive for examples and tests and fix the build issue by making sure that the link directive isn't passed to dependencies through the prl or pkgconfig file. Change-Id: Id1f5efb8c9823613e804e8e6356d711d561d72ec Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Make fancybrowser build and linkPierre Rossi2013-11-124-44/+45
| | | | | | | Also update references in the doc. Change-Id: Ica4d77cb1db040b466c739e4fc1bfd37df544589 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Import fancybrowser examplePierre Rossi2013-11-129-0/+523
| | | | | Change-Id: Ia61fbe3ef6b76c7530d10d4a3305d4208b3469ef Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Delegated renderer: Put textures on those quads.Jocelyn Turcotte2013-11-112-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few changes are necessary to allow fetching textures provided by the render processes through IPC and bound to their respective GL context in the GPU process and use them in the QtQuick scene graph. - Remove the plain color test textures. - Allow setting the QtQuick QOpenGLContext's handle as the share context for all context set as shared in the Chromium GPU process. We do this by letting the GpuChannelManager ask us for a ShareGroup instance responsible for returning a sharing GL context handle. - Fetch texture IDs from the MailboxManager used by the GPU process using the Mailbox given to us in the DelegatedFrameData. This is the same mechanism used by Chromium to share textures between "client" GL contexts. - Keep the QtQuick scene graph threads and Chromium in-process GPU thread separate. The complicated part of merging those two rendering pipelines on the same thread is that it would force Qt to also use only one thread for rendering. For the moment we will try to synchronize those threads together instead. - Lock the Qt SG thread while waiting for resource sync points. Do so by posting a callback to the Chromium GPU thread and wait until the sync point of every resource has been retired by the producing contexts. - Acknowledge the delegated from once QtQuick swapped the GL buffers instead of right after we added the frame to the scene graph. This fixes some issues where the textures for the previous frame would already be released as Chromium was producing the new frame. There are still a few issues regarding synchronization that have to be fixed, especially when Qt triggers the rendering of a new frame while Chromium is starting to produce the next frame. Note: To enable it we still need to pass the following command switches: --enable-delegated-renderer --enable-threaded-compositing --in-process-gpu Change-Id: I2d4f7fac603b1808ed1495a8d689cb48e9ed41b9 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Give the demo browser prettier popupsPierre Rossi2013-10-291-4/+56
| | | | | Change-Id: Ia8052bffc7be18c4d8f81c3a89ac4a64b1c589af Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Pimp up our QtQuick browserPierre Rossi2013-10-111-10/+26
| | | | | Change-Id: I48c0ed54cd946f223dc050b8a1f26282b02964a2 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Fix typo in quickwindow.qmlArvid Nilsson2013-10-041-1/+1
| | | | | | | | | Set favicon image source to the value of the icon property, not the url. D'oh! Change-Id: I411f787f4f19fbeb2db9a61e4aada79b3527dcfb Reviewed-by: Arvid Nilsson <anilsson@blackberry.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Add loadProgress APIArvid Nilsson2013-10-041-26/+34
| | | | | | | | | | | | | | | | This exposes loadProgress in both widget and quick webengineviews. However, the progress will not change until we get an upstream change in Chromium where the content LoadProgressChanged API is exposed to all ports, not just Android. The upstream change is https://src.chromium.org/viewvc/chrome?revision=221010&view=revision Once we get that change, you'll see the widget example browser start to paint a blue progress rectangle in the background of the URL bar. Also, a progress bar was added to the quicknanobrowser, but it will be stuck at 0 for now. Change-Id: Icbaa01b86c013e0052b3abb7672c38e57128f44a Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Quick: Add Favicon APIArvid Nilsson2013-10-031-0/+5
| | | | | | | | | | | | | | | | | | | Adds a favicon API modelled after the WebKit2 QQuickWebView API, but using an http(s) URL instead of a custom protocol, because there's no icondatabase yet. The icon URL lingers even when a new load is committed, until the load finishes. It might be more prudent to clear the icon when committing a new load, but I opted to let the app take care of that detail if desired. Many browsers show a spinner instead of the favicon while loading, for example. There's no widget API implementation for favicons yet, because that API only makes sense if we have a full-fledged icon database (case in point: QWebEngineSettings::iconForUrl()). Change-Id: I1e7b85104c80de2ae46a5fe9a273104d43a5c71f Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Widgets: implement zoomFactorPierre Rossi2013-10-011-6/+0
| | | | | | Change-Id: I7ef26e4a2e6c9eb228bcf5542ad272b998f8c6a3 Reviewed-by: Michael Bruning <michael.bruning@digia.com> Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Add Qt namespace macros QtWebEngine classes.Michael BrĂ¼ning2013-09-172-1/+6
| | | | | | This should enable namespaced builds of Qt and QtWebEngine. Change-Id: I4c9d506d864b42a346026b980dcf3777b9680957 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Implement the basic parts of QWebEngineHistory.Jocelyn Turcotte2013-08-201-7/+0
| | | | | | | | | | | | | | Mark the remaining methods as not implemented to allow enabling most of the dependent code in the demo browser and in API tests. Add two new tests to cover cases that might be problematic with the index-based implementation. This also renames WebContentsAdapter::navigateHistory to navigateToOffset in order to avoid confusion with navigateToIndex. Change-Id: I7c5cb9f5f878e34206fdfe48334a2dc7d9d95a1d Reviewed-by: Zeno Albisser <zeno.albisser@digia.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Implement QWebEnginePage::action for basic navigation.Jocelyn Turcotte2013-08-202-8/+0
| | | | | | | | This imports code from qwebpage.cpp and QWebPageAdapter.cpp of WebKit into qwebenginepage.cpp and thus also restrict the license accordingly. Change-Id: Ic5da8f2b469109cb10132cbe6585f2d941b14403 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Let the application sanitize the URL.Jocelyn Turcotte2013-08-201-1/+1
| | | | | | | | | | Do like the QtQuick example and let the Widgets example use urlFromUserInput to add a missing http scheme instead of letting QtWebEngine do it. This is the same behavior as QtWebKit does. Change-Id: Iac1570523253126e059afb00c3a2ff844e177ff1 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* demo browser: Make it link.Jocelyn Turcotte2013-08-2011-16/+116
| | | | | | | | The ifdefs should later be removed along with the feature implementations. Change-Id: If73f4c4c02c00e90d6cf54c6a08bb37f43fa95bc Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* demo browser: Fix the compilation with QtWebEngine.Jocelyn Turcotte2013-08-2015-126/+127
| | | | | | | | | | | This makes the demo compile, but not link since most of the methods aren't implemented yet. Also disable downloads and printing since they require a bit more work to instead use the page directly. Change-Id: I59adfe07fda077c6909f70f12800a4cfa6a6dad2 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Import the demo browser into widget examples.Jocelyn Turcotte2013-08-2068-0/+13450
| | | | | | | | | Import the sources as-is, without adding it to the build, to allow performing diffs later on the changes that were needed to port it to use QtWebEngine and manage source compatibility issues. Change-Id: Icf8a284881ce2153e9b5a1ba97dbe77096f1b88d Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Import QtWebKit public headers.Jocelyn Turcotte2013-08-201-2/+4
| | | | | | | | | | | | | | | | | | | This is the first step toward re-implementing part of the QWebView API on top of QtWebEngine. The plan is to import the complete headers to facilitate diffs and progress tracking. Changes squashed in this commit: - Use the QWebEngine prefix for class names - Strip out non-public members and directives - Allow building using those headers by disabling the Q_PROPERTY macros and by adding a dummy implementation for virtual methods directly in the header - Update the widgetsnanobrowser example to comply with the slight changes from the previous API Change-Id: Ia7efa5430f775d09b493544430a04856cc7928f6 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Change "Contents" to "Engine" in API class names.Jocelyn Turcotte2013-08-194-15/+15
| | | | | Change-Id: I58d83f4f33728f92e4bf13b6be30b15528fdd033 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Detach common.pri from the nano browser examples.Jocelyn Turcotte2013-08-195-20/+8
| | | | | | | | | | | | | | Move common.pri to the root directory to be able to use it with tests. Remove nano browser specific logic (util.h include and common resources) from this file and use relative paths in the examples instead. This also remove unnecessary directives: - lib doesn't have to be added to INCLUDEPATH since proper modules are used - util.h doesn't need to be added to HEADERS, moc doesn't need to go through it - MOC_DIR doesn't have to be adjusted anymore Change-Id: Id706e7f2ef7c9607bdcd0ba63afecf5b5854262b Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Prepare the directories to have more examples included.Jocelyn Turcotte2013-08-1911-6/+6
| | | | | | | | | | | This also ajust the name to be consistent with other Qt examples. - Move nano browser one directory level down, also renaming them to match their target name - Remove the dashes from the target names - Rename the qtquick example directory to quick, matching the style in lib Change-Id: I4a5e31be0b919ae596eadbf731be52372ae61151 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* [Examples] Add Ctrl + L shortcut for testingPierre Rossi2013-07-312-0/+17
| | | | | | | It's quite convenient when one wants to test if navigating works. Change-Id: I89404df3a9a878701180fdd5b5144b46b3f68df5 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Split out the Widgets and QtQuick integrationPierre Rossi2013-07-315-11/+16
| | | | | | | | | | | | | | | This is the first step to making proper Qt Modules out of QtWebEngine. The Widgets integration becomes a proper C++ Qt Module while we make the QtQuick side a QML plugin for now (could probably be promoted if the need arises). Code-wise, this means the introduction of a WebContentsAdapterClient interface that is subclassed by the private implementation of our API classes for delegation of things that are UI specific. Functionality from WebContents and the like is exposed via the WebContentsAdapter. Change-Id: I4ca3395b9fe8502a24e36002cfd5af44067bb6e8 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Move the icons into common.Zeno Albisser2013-07-039-21/+18
| | | | | | | | Use the same icons for the widgets and qtquick example. Remove the styling as it does not work on all platforms anyway. Change-Id: Iff59455689619ae45823eb835768d7c4fc75bd93 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Adjust LIBPATH on Mac.Zeno Albisser2013-07-011-1/+2
| | | | | Change-Id: I1d8affaa797a61a71051b3a347ade4e589fd68a7 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Adding some missing license headersSergio Ahumada2013-06-251-0/+40
| | | | | Change-Id: If41e2991be7877060f7739877f756acf2679b688 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Include fix.Zeno Albisser2013-06-181-0/+1
|
* Disable the back/forward buttons when appropriate.Zeno Albisser2013-06-183-2/+8
|
* Startup URL from command line argsPierre Rossi2013-06-185-10/+84
|
* Use QQmlProperty::write instead of Binding item.Zeno Albisser2013-06-181-18/+0
|
* Add initial API layer for widgets.Zeno Albisser2013-06-182-1/+15
|
* Add initial API layer for QtQuick and connect the signals accordingly.Zeno Albisser2013-06-181-2/+3
|
* Qt Quick example: use a qrc filePierre Rossi2013-06-184-4/+16
|
* cleaner content margins for the nested layoutsPierre Rossi2013-06-181-1/+5
| | | | also remove QQUICKWEBENGINE env var
* Split out the example into two distinct onesPierre Rossi2013-06-1715-0/+507
Cleaner than deciding on startup with an env variable