summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Fixup Back/Forward short-cutsAllan Sandfeld Jensen2016-07-222-4/+40
| | | | | | | | | | | Remove backspace short-cut, Chromium will already handle that if it is standard on the platform. Also we were not triggering on Back/Forward buttons due to those being mapped to prev/next tab item in Qt. Task-number: QTBUG-54546 Change-Id: I9a4f48c718c5685ca9ca1b032d8b04409ac622ca Reviewed-by: Jesus Fernandez <jesus.fernandez@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Remove infinite loop when loading history.Michael Bruning2016-06-202-4/+8
| | | | | | | | Add a flag to let checkForExpired remove the entries directly. Task-number: QTBUG-54222 Change-Id: Iddac9e50f645d74b95d0ea13ed76d7f858ddd137 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Make all examples high-dpi awareKai Koehne2016-06-2010-3/+20
| | | | | | | | | Setting the Qt::AA_EnableHighDpiScaling attribute makes sure that the scrollbars are scaled, and that the default zoom level is sensible. Task-number: QTBUG-54113 Change-Id: I0ae7eb97cb9e2824e7f9b92d77cf2986cac66685 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix build of webenginewidgets/simplebrowserJoerg Bornemann2016-06-101-0/+1
| | | | | | | | | Add missing include to fix error C2027: use of undefined type 'QDebug' on MSVC. Change-Id: Icc62cdf36f417f30691445ab4994b822c8e37db9 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Do not trigger find on slash keyAllan Sandfeld Jensen2016-06-031-1/+0
| | | | | | | | Application short-cuts override the passing the keys to WebCore, and makes it impossible to type '/' in form elements. Change-Id: I7df99547f99a3a0703d98d19d3ccdb23de0641ce Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Merge 5.6 into 5.6.1Oswald Buddenhagen2016-05-122-1/+6
|\ | | | | | | Change-Id: I96aa7487c341f40c74832f00bc72995d25969329
| * add missing example installOswald Buddenhagen2016-05-102-1/+6
| | | | | | | | | | Change-Id: Ifee9bb458de2c15760da21938b5e5bb598936161 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | [Simplebrowser] Fix command line option parsing.Alexandru Croitor2016-05-111-3/+15
|/ | | | | | | | | | | | | Passing just command line options to Chromium prevents loading of the initial startup url. This happens because the startup url is overridden by the last command line argument, which happens to be a Chromium option, thus an invalid URL. Fix consists in using the last command line argument as the loading url only if it can be parsed as valid url. Change-Id: I3615ef57b6eddc5098de79cba1b1ba6b6af193ef Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Quick fix for not working history in demobrowserMichal Klocek2016-05-044-50/+72
| | | | | | | | | | | | | | | | | | | | | | | Current implementation of history manager seems to be not straight forward. To display history we use QList to keep history items plus model adapter in form of HistoryModel (QAbstractTableModel) plus HistoryFilterModel to avoid duplication, plus HistoryTreeModel to make a tree view with split for dates, plus TreeProxyModel on top to enable sorting. This approach unfortunately falls apart when items should be deleted from the model by treeView. This ends badly with corrupted cached values. This fix removes history items using history manager. It also abandons HistoryTreeModel since frequent sourceReset calls make it unusable. If split for dates it desired the better approach would be to implement history tree model already at HistoryManager level to avoid unmaintainable code. Task-number: QTBUG-49913 Task-number: QTBUG-50255 Change-Id: Ic9cebb52b623bd453119e11b5e907eaa90609e34 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* [Demobrowser] Fix command line option parsing.Alexandru Croitor2016-05-042-9/+21
| | | | | | | | | | | | | | | Passing just command line options to Chromium prevents loading of the initial startup url. This happens because the startup url is overridden by the last command line argument, which happens to be a Chromium option, thus an invalid URL. Fix consists in iterating through the command line arguments, until a non-option argument is found (doesn't start with a dash), and use that as the startup URL. Change-Id: Ibe2946b25b2e023c094a85e50d2ccbd5bfce2977 Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Fix contextMenu handling in examplesMichal Klocek2016-04-212-5/+8
| | | | | | | | Adds missing deleteLater on close Change-Id: Id337856f138e0d38f0c72d3962ccac309d36c73e Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* demobrowser: Remove unused loadingUrlJoerg Bornemann2016-04-212-18/+0
| | | | | | | | | Remove the unused m_loadingUrl member. Remove the loadingUrl signal that was forwarded to urlChanged. QWebEngineView already emits urlChanged. There's no need to do this twice. Change-Id: Ib9734c5b1571745f7b82b4e5f2bc92c7f1d8f51c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* demobrowser: Fix HistoryManager::clearJoerg Bornemann2016-04-211-1/+1
| | | | | | | | Clear the model before saving. Otherwise the cleared history will appear again after restarting the demobrowser. Change-Id: I79f939c1f1e8ee993127d139cefe7f5818ce593c Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* demobrowser: Fix precision of progress bar renderingJoerg Bornemann2016-04-201-1/+1
| | | | | | | The progress bar never reached the 100% mark. Change-Id: Id87bdb27f882d0d77ed0ad590e2c2278ce6fba92 Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* SimpleBrowser: Fix loading iconKai Koehne2016-04-151-1/+1
| | | | | Change-Id: I008b649b43069978b6ce19b2faf5a557dd67c756 Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com>
* Demobrowser: Fix black screen after exiting fullscreen mode on OS X.Alexandru Croitor2016-04-151-3/+6
| | | | | | | | | | | | | | | | | | | | When exiting fullscreen while viewing a full screen video, the video is replaced with a black screen, and does not switch back to the initial page. This happens when hide() is called on a native window while being in fullscreen, which hides the window, but does not exit full screen mode, thus showing a black screen. The workaround fix consists of two parts: 1) Make sure to delete the fullscreen window object, to release the OS virtual screen it occupies (visible in mission control as a black rectangle). 2) Hide and show the main page window, to force exit fullscreen mode. Change-Id: I364d4427e84957ed97f57a14e2cfc2c95aed6f48 Task-number: QTBUG-52058 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Make MarkDownEditor example more usableKai Koehne2016-03-183-10/+20
| | | | | | | | - Use a fixed width font for the editor. - Accept .md file as command line argument. Change-Id: I97e3bb930569240e195ecc21ed4ce3d9acd3ff66 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
* Strip down demobrowser to become simplebrowserMichal Klocek2016-03-1632-1/+3440
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Demobrowser changes: * remove QLocalServer/Socket * remove AutoSaver * remove restoreLastSession * remove general QSettings * remove downloadManager * remove bookmarkManager * remove historyManager * remove searchBar * favor setStyleSheet over overriding paint methods * use lambdas where suitable * use QProgressBar instead of own painted widget * use QToolButton instead of own painted buttons * remove QStackWidget, use single UrlLineEdit per window instead of per tab * split files to keep own classes: webpage and webview * remove tracking windows by QPoiner * remove WebPageActionMapper, TabBar classes * remove QDrag dead code * remove special OS X close app handling * fix encapsulation, clean up application logic Change-Id: I4849b6a2de739dea4f01229abdb90418601a2397 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@theqtcompany.com>
* Doc: fix links in the minimal example docsLeena Miettinen2016-03-072-4/+4
| | | | | | | | ...to use the external link specified in qtbase\doc\global\externalsites\qt-webpages.qdoc Change-Id: Ieeade45440a5454ec7856230510f3914b1a56800 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Add minimal examplesKai Koehne2016-03-0110-1/+338
| | | | | | | | Task-number: QTBUG-51383 Change-Id: I872bdae7267e7dbf2a93a831d435517bcd4bad64 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Fix removal of left-over local socket in demobrowserJoerg Bornemann2016-02-161-6/+5
| | | | | | | | Use QLocalServer::removeServer instead of QFile::remove. The socket is usually not in the current directory. Change-Id: Ie5b20b8b02ec7f3065596ebd945a6639bb65a2c0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Prefix Markdown Editor example with "WebEngine"Kai Koehne2016-02-042-2/+2
| | | | | | | | | | Follow the example of the other examples, and always start with WebEngine. This makes also sure that Qt Creator attaches the 'webengine' tag to the example. Task-number: QTBUG-50582 Change-Id: If99ba9a23560abae61e4e2ef5a5b091b3c5473c2 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
* Doc: update Contentmanipulation example docsLeena Miettinen2016-01-284-90/+91
| | | | | | | | | | | | | | | | | | | - Update screenshot - Remove second \brief command - Fix grammar issues - Use standard phrasing for examples - Replace \snippet commands with \quotefromfile commands. This enables documenting each line of code separately - Replace occurrences of QWebView with QWebEngineView - Replace reference to the obsolete QWebEnginePage::evaluateJavaScript method with reference to QWebEnginePage::runJavaScript() that is used in the example code - Remove snippet markers from mainwindow.h and mainwindow.cpp - Move code comment from mainwindow.cpp to the documentation to make the code leaner Change-Id: If3346810c8aef67c15c9ec7ad4469a222e636cf2 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Add cookiebrowser exampleMichal Klocek2016-01-2612-0/+887
| | | | | | | | | A cookiebrowser shows collected cookies during browsing, users can view cookie content, delete and add new cookies. Change-Id: Ib9cdc29e7ca34c488dd249b44f9e32491517bd60 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Make all examples BSD licensedKai Koehne2016-01-2253-1529/+1477
| | | | | Change-Id: I98924e5f8754b7b2ed095abf00eb73fa26399b2d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Update logo of demobrowserKai Koehne2016-01-143-408/+22
| | | | | | Change-Id: I26b907d943ebd424087c54465608598aaf0d0013 Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com> Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* Fix namespaced build of markdowneditor exampleJoerg Bornemann2016-01-141-0/+2
| | | | | Change-Id: Iff50511b06962d02e2a69ee47f1f0df82425dc2d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* QuickNanoBrowser: Enable pepper plugins by defaultKai Koehne2016-01-071-1/+1
| | | | | | | | As a generic browser example it should pick up plugins automatically. This is the same behavior as the DemoBrowser. Change-Id: I45ea8f7cd8e92a291137fd488d7a6f29931a15b0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Do not use deprecated QStyleOptionFrameV2Joerg Bornemann2016-01-043-9/+9
| | | | | | | | | This fixes some warnings when building demobrowser. Change-Id: If895d794e216d9a5bab8d74b3bee370763ff1294 Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@theqtcompany.com> Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* Demobrowser: Add handling of middle click and double click on tab bar.Alexandru Croitor2015-12-222-0/+18
| | | | | | | | | Implement chromium-ish handling of tab bar handling. Middle clicking on a tab closes the tab. Double clicking on the tab bar opens a new tab. Change-Id: I75d559f09b94c4af2bc4fc8c32339d5c25b357e9 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Doc: Add docs for WebEngine Quick Nano Browser exampleLeena Miettinen2015-12-181-4/+102
| | | | | | Task-number: QTBUG-48640 Change-Id: Ie4fc076fb6e3a63ee1a7722cca5b28f240288bf0 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* rename fancybrowser to contentmanipulationJoerg Bornemann2015-12-179-17/+17
| | | | | | | | | | | The name "fancybrowser" tricks people into thinking that this is the reference browser example. But this example is a very simple browser with an additional fancy content manipulation feature. Rename this example to contentmanipulation to reflect reality. Change-Id: I200b701acdc4de1210b550b9f054753e5f1d1ea4 (cherry-pick from eb8eb72ec7e589eedd79143dc7c3fb241706f405) Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Fix fullscreen mode in qml apiMichal Klocek2015-12-171-13/+4
| | | | | | | | | | | | Current implementation was not working correctly for quicknanobrowser when entering and leaving fullscreen video, in cases where the browser itself was already fullscreen. Use ExitFullScreen to leave fullscreen in demo code. Use onFullScreenRequested handler to track if fullscreen mode is on. Change-Id: I022d5e830b189897d34a9a8747381d041101c692 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Fix namespaced build of demobrowserJoerg Bornemann2015-12-142-2/+6
| | | | | | Change-Id: I6f863676dabacbe193e148481178753f05bd2869 Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Fix unclosable tabs in demobrowserMichal Klocek2015-12-072-25/+36
| | | | | | | | | Switching to private profile back and forth brakes interactions with tabs. Connect signals every time new WebPage is created. Change-Id: I1765171116a3b9b9caba6ef2233289f50b315e62 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Add margin to downloadmanageritem uiMichal Klocek2015-12-071-1/+10
| | | | | | | | Improve look of downloadmanager window by adding left, right margins to downloadmanageritem.ui Change-Id: I89dbb4bd4290592dde8f6c85e4865037cd990f91 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-11-201-1/+1
|\ | | | | | | Change-Id: I20e36d0e18dd26365557a4093436e9660e30e173
| * fix "open download" in demo browserJoerg Bornemann2015-11-181-1/+1
| | | | | | | | | | | | | | | | Open the downloaded file, not the directory. Change-Id: I61b3a8e6788bf26b1a446459ce8b38774f8c28a0 Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com> Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Add 'markdowneditor' exampleKai Koehne2015-11-1719-1/+1595
| | | | | | | | | | | | | | | | | | | | | | | | | | This example shows the use of QWebEngineView in a hybrid application, and how one can leverage JavaScript libraries to provide functionality with minimal effort. QWebEngineView is used to preview a MarkDown document. The text is exposed to the view through QWebChannel. An off-the-self js library converts it to HTML. Change-Id: I24c38106da3ec18975c71c16f7f7a58e93142f9e Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Update DemoBrowser example imageKai Koehne2015-11-161-0/+0
| | | | | | | | | | Change-Id: I8eaf44ed98bbceac06bae9751cee1490d553db7c Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
* | use Q_ENUM instead of Q_ENUMSJoerg Bornemann2015-11-161-1/+1
| | | | | | | | | | | | | | | | This makes the enum values available as strings in qDebug, QCOMPARE and such. Change-Id: Id57a2002451337fcc8aedac673f834445913895c Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* | Make QWebEngineFullScreenRequest const correctKai Koehne2015-11-122-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | Let QWebEngineFullScreenRequest be logically const-correct. It feels weird to be allowed to call "accept()" or "reject()" on a constant object. Also allow the user to copy the request, but check whether the page is still valid in the implementations of accept(), reject(). Change-Id: Ibf139a126734fc8e2db68ec26dc8f24cd4438942 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Print JS console messages by defaultKai Koehne2015-11-062-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the behavior of QWebEnginePage/WebEngineView to print JavaScript console.warn and console.error messages by default in a 'js' logging category. This matches also the behavior for QtQml, where console messages end up in a 'qml' logging category by default. So far access to the JavaScript console required either use of the remote debugging functionality, subclassing of QWebEnginePage, or implementing a custom handler. Anyhow, even then writing a seamless forwarding of the data and metadata to the Qt message handler is difficult. This patches implements this forwarding by default. The behavior can be changed by either setting up rules for the 'js' category, e.g. setFilterRules("js.*=false"); or by implementing onJavaScriptConsoleMessage(), or overriding QWebEnginePage::javaScriptConsoleMessage. [ChangeLog] Unhandled JS console messages are now forwarded to to the Qt message handler inside a 'js' category. Change-Id: I5480383a80dcf7a122496f9b7915264ef9036db3 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Fullscreen notification popup for Widgets demobrowserSzabolcs David2015-10-305-3/+208
| | | | | | | | | | Change-Id: I3afc0399e4156cd17917103face68ca1945409f9 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Fix a typo in quicknanobrowserSzabolcs David2015-10-281-1/+1
| | | | | | | | | | Change-Id: I90082e7b95f1693d107a4655324d5544b2d5d29e Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Demobrowser: fix compiler warnings due to missing Q_DECL_OVERRIDE.Michael Bruning2015-10-281-2/+2
| | | | | | | | | | Change-Id: I7dbfeeb1a5ef91575d650bc10c7faf6ccb6b6c54 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Fullscreen notification popups for the Quick examplesSzabolcs David2015-10-274-2/+112
| | | | | | | | | | | | Change-Id: If1057d74b4fa2cb98565e6a0a6f569e24b520753 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Add Full Screen setting to quicknanobrowserPeter Varga2015-10-271-1/+9
| | | | | | | | | | Change-Id: I264a0317d46b79cce8481b3227307115f64520d8 Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* | Fix ABI breakage due to fullscreen featureAllan Sandfeld Jensen2015-10-192-9/+12
| | | | | | | | | | | | | | | | | | | | | | We can not add a new virtual method without breaking ABI on some platforms, instead we need to use a setter. The API now uses a request object, and a separate signal for canceling, since canceling can not be rejected. Change-Id: If8069c343e86926293c30e8de179bf4e3cbd5886 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | add RequestClose web actionJoerg Bornemann2015-10-093-14/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Web pages can set the onbeforeunload handler to let the user confirm whether to leave the page or not. Until now, only when leaving the page via a link, a confirmation was shown. Before actually closing a web page, applications can now trigger the RequestClose web action. This will give the use the chance to confirm or deny the close request. If the request is confirmed, the signal windowCloseRequested is emitted. Task-number: QTBUG-36155 Change-Id: Icc1fabc37a2ac537f674c2f00bc8966e4dc4e610 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>