├── .tag ├── examples ├── webkitwidgets │ ├── embedded │ │ ├── anomaly │ │ │ ├── README.TXT │ │ │ ├── src │ │ │ │ ├── images │ │ │ │ │ ├── go-next.png │ │ │ │ │ ├── list-add.png │ │ │ │ │ ├── edit-find.png │ │ │ │ │ ├── go-previous.png │ │ │ │ │ ├── list-remove.png │ │ │ │ │ └── button-close.png │ │ │ │ ├── anomaly.qrc │ │ │ │ ├── webview.h │ │ │ │ ├── BookmarksView.h │ │ │ │ ├── Main.cpp │ │ │ │ ├── ZoomStrip.h │ │ │ │ ├── TitleBar.h │ │ │ │ ├── flickcharm.h │ │ │ │ ├── AddressBar.h │ │ │ │ ├── HomeView.h │ │ │ │ ├── ControlStrip.h │ │ │ │ ├── BookmarksView.cpp │ │ │ │ ├── HomeView.cpp │ │ │ │ ├── ZoomStrip.cpp │ │ │ │ ├── webview.cpp │ │ │ │ ├── BrowserWindow.h │ │ │ │ ├── BrowserView.h │ │ │ │ └── AddressBar.cpp │ │ │ └── anomaly.pro │ │ └── embedded.pro │ ├── scroller │ │ ├── scroller.pro │ │ ├── wheel │ │ │ ├── doc │ │ │ │ └── images │ │ │ │ │ └── wheel-example.png │ │ │ └── wheel.pro │ │ └── plot │ │ │ ├── plot.pro │ │ │ └── plotwidget.h │ ├── xmlpatterns │ │ ├── xmlpatterns.pro │ │ ├── doc │ │ │ └── images │ │ │ │ └── qobjectxmlmodel-example.png │ │ └── qobjectxmlmodel │ │ │ ├── queries │ │ │ ├── wholeTree.xq │ │ │ └── statisticsInHTML.xq │ │ │ ├── queries.qrc │ │ │ ├── qobjectxmlmodel.pro │ │ │ ├── main.cpp │ │ │ ├── mainwindow.h │ │ │ └── xmlsyntaxhighlighter.h │ ├── browser │ │ ├── browser.rc │ │ ├── browser.icns │ │ ├── browser.ico │ │ ├── data │ │ │ ├── addtab.png │ │ │ ├── closetab.png │ │ │ ├── history.png │ │ │ ├── loading.gif │ │ │ ├── defaulticon.png │ │ │ ├── data.qrc │ │ │ └── defaultbookmarks.xbel │ │ ├── htmls │ │ │ ├── htmls.qrc │ │ │ └── notfound.html │ │ ├── doc │ │ │ ├── images │ │ │ │ └── browser-demo.png │ │ │ └── src │ │ │ │ └── browser.qdoc │ │ ├── Info_mac.plist │ │ ├── squeezelabel.h │ │ ├── main.cpp │ │ ├── edittreeview.h │ │ ├── edittableview.h │ │ ├── squeezelabel.cpp │ │ ├── browser.pro │ │ ├── downloads.ui │ │ ├── settings.h │ │ ├── autosaver.h │ │ ├── edittreeview.cpp │ │ ├── toolbarsearch.h │ │ ├── addbookmarkdialog.ui │ │ ├── chasewidget.h │ │ ├── edittableview.cpp │ │ ├── networkaccessmanager.h │ │ ├── autosaver.cpp │ │ ├── cookies.ui │ │ ├── history.ui │ │ ├── bookmarks.ui │ │ ├── proxy.ui │ │ └── searchlineedit.h │ ├── imageanalyzer │ │ ├── resources │ │ │ ├── images │ │ │ │ ├── README │ │ │ │ ├── trees.jpg │ │ │ │ ├── flower.jpg │ │ │ │ ├── seaShell.jpg │ │ │ │ ├── bellaCoola.jpg │ │ │ │ └── mtRainier.jpg │ │ │ └── imageanalyzer.qrc │ │ ├── doc │ │ │ └── images │ │ │ │ ├── webkit-imageanalyzer-complete.png │ │ │ │ ├── webkit-imageanalyzer-progress.png │ │ │ │ └── webkit-imageanalyzer-screenshot.png │ │ ├── imageanalyzer.pro │ │ ├── README │ │ ├── main.cpp │ │ └── mainwindow.h │ ├── fancybrowser │ │ ├── jquery.qrc │ │ ├── doc │ │ │ └── images │ │ │ │ └── fancybrowser-example.png │ │ ├── fancybrowser.pro │ │ └── mainwindow.h │ ├── formextractor │ │ ├── formextractor.qrc │ │ ├── doc │ │ │ ├── images │ │ │ │ └── formextractor-example.png │ │ │ └── src │ │ │ │ └── formextractor.qdoc │ │ ├── formextractor.pro │ │ ├── form.html │ │ ├── main.cpp │ │ ├── formextractor.h │ │ └── mainwindow.h │ ├── previewer │ │ ├── doc │ │ │ └── images │ │ │ │ ├── previewer-ui.png │ │ │ │ └── previewer-example.png │ │ ├── previewer.pro │ │ ├── main.cpp │ │ ├── previewer.h │ │ ├── previewer.cpp │ │ ├── mainwindow.h │ │ └── previewer.ui │ ├── domtraversal │ │ ├── doc │ │ │ └── images │ │ │ │ └── webkit-domtraversal.png │ │ ├── domtraversal.pro │ │ ├── main.cpp │ │ ├── window.ui │ │ └── window.h │ ├── framecapture │ │ ├── doc │ │ │ ├── images │ │ │ │ └── framecapture-example.png │ │ │ └── src │ │ │ │ └── webkit-framecapture.qdoc │ │ ├── framecapture.pro │ │ └── framecapture.h │ ├── simpleselector │ │ ├── doc │ │ │ └── images │ │ │ │ └── webkit-simpleselector.png │ │ ├── simpleselector.pro │ │ ├── window.ui │ │ ├── main.cpp │ │ ├── window.h │ │ └── window.cpp │ └── webkitwidgets.pro ├── webkitqml │ ├── shared │ │ ├── qmldir │ │ ├── images │ │ │ ├── busy.png │ │ │ ├── less.png │ │ │ ├── more.png │ │ │ └── arrow.png │ │ ├── shared.pro │ │ ├── shared.qrc │ │ ├── main.cpp │ │ └── LoadIndicator.qml │ ├── webkitqml.pro │ ├── flickrview │ │ ├── images │ │ │ └── flickr.png │ │ ├── doc │ │ │ ├── images │ │ │ │ └── flickrview-example.png │ │ │ └── src │ │ │ │ └── flickrview.qdoc │ │ ├── flickrview.qrc │ │ └── flickrview.pro │ └── youtubeview │ │ ├── doc │ │ ├── images │ │ │ ├── youtubeview-example.png │ │ │ └── youtubeview-example-preset.png │ │ └── src │ │ │ └── youtubeview.qdoc │ │ ├── youtubeview.qrc │ │ ├── youtubeview.pro │ │ └── content │ │ └── player.html └── examples.pro ├── sync.profile ├── .qmake.conf ├── doc ├── doc.pro ├── images │ └── webkit-examples.png ├── qtwebkitexamples.qdocconf └── src │ └── qtwebkit-examples.qdoc ├── qtwebkit-examples.pro ├── tests └── auto │ └── guiapplauncher │ ├── README.txt │ └── examples.txt └── dist ├── changes-5.0.1 ├── changes-5.0.2 ├── changes-5.1.1 └── changes-5.1.0 /.tag: -------------------------------------------------------------------------------- 1 | 2d68492004bf4ba49cf58c9bd72706cb282cf59b 2 | -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/anomaly/README.TXT: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sync.profile: -------------------------------------------------------------------------------- 1 | %modules = ( # path to module name map 2 | ); 3 | -------------------------------------------------------------------------------- /.qmake.conf: -------------------------------------------------------------------------------- 1 | load(qt_build_config) 2 | 3 | MODULE_VERSION = 5.10.0 4 | -------------------------------------------------------------------------------- /doc/doc.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = aux 2 | QMAKE_DOCS = $$PWD/qtwebkitexamples.qdocconf 3 | -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/embedded.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | SUBDIRS += anomaly 3 | -------------------------------------------------------------------------------- /examples/webkitqml/shared/qmldir: -------------------------------------------------------------------------------- 1 | Button 2.0 Button.qml 2 | LoadIndicator 2.0 LoadIndicator.qml 3 | -------------------------------------------------------------------------------- /examples/webkitwidgets/scroller/scroller.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | SUBDIRS += plot wheel 3 | -------------------------------------------------------------------------------- /examples/webkitwidgets/xmlpatterns/xmlpatterns.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | SUBDIRS += qobjectxmlmodel 3 | -------------------------------------------------------------------------------- /qtwebkit-examples.pro: -------------------------------------------------------------------------------- 1 | requires(qtHaveModule(webkit)) 2 | 3 | load(qt_parts) 4 | 5 | SUBDIRS += doc 6 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/browser.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "browser.ico" 2 | 3 | -------------------------------------------------------------------------------- /doc/images/webkit-examples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/doc/images/webkit-examples.png -------------------------------------------------------------------------------- /examples/webkitqml/webkitqml.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | SUBDIRS += shared \ 3 | flickrview \ 4 | youtubeview 5 | -------------------------------------------------------------------------------- /examples/webkitqml/shared/images/busy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitqml/shared/images/busy.png -------------------------------------------------------------------------------- /examples/webkitqml/shared/images/less.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitqml/shared/images/less.png -------------------------------------------------------------------------------- /examples/webkitqml/shared/images/more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitqml/shared/images/more.png -------------------------------------------------------------------------------- /examples/webkitqml/shared/images/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitqml/shared/images/arrow.png -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/browser.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/browser/browser.icns -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/browser.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/browser/browser.ico -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/data/addtab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/browser/data/addtab.png -------------------------------------------------------------------------------- /examples/examples.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | qtHaveModule(quick): SUBDIRS += webkitqml 3 | qtHaveModule(webkitwidgets): SUBDIRS += webkitwidgets 4 | -------------------------------------------------------------------------------- /examples/webkitqml/flickrview/images/flickr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitqml/flickrview/images/flickr.png -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/data/closetab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/browser/data/closetab.png -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/data/history.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/browser/data/history.png -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/data/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/browser/data/loading.gif -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/data/defaulticon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/browser/data/defaulticon.png -------------------------------------------------------------------------------- /examples/webkitwidgets/imageanalyzer/resources/images/README: -------------------------------------------------------------------------------- 1 | The images are under public domain and were obtained from 2 | http://publicdomainpictures.net 3 | -------------------------------------------------------------------------------- /tests/auto/guiapplauncher/README.txt: -------------------------------------------------------------------------------- 1 | The guiapplauncher from the qtqa repository uses the data in this 2 | directory to do its testing for this module. 3 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/htmls/htmls.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | notfound.html 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/webkitwidgets/fancybrowser/jquery.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | jquery.min.js 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/webkitwidgets/formextractor/formextractor.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | form.html 4 | 5 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/doc/images/browser-demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/browser/doc/images/browser-demo.png -------------------------------------------------------------------------------- /examples/webkitwidgets/previewer/doc/images/previewer-ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/previewer/doc/images/previewer-ui.png -------------------------------------------------------------------------------- /examples/webkitqml/flickrview/doc/images/flickrview-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitqml/flickrview/doc/images/flickrview-example.png -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/anomaly/src/images/go-next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/embedded/anomaly/src/images/go-next.png -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/anomaly/src/images/list-add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/embedded/anomaly/src/images/list-add.png -------------------------------------------------------------------------------- /examples/webkitwidgets/imageanalyzer/resources/images/trees.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/imageanalyzer/resources/images/trees.jpg -------------------------------------------------------------------------------- /examples/webkitqml/youtubeview/doc/images/youtubeview-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitqml/youtubeview/doc/images/youtubeview-example.png -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/anomaly/src/images/edit-find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/embedded/anomaly/src/images/edit-find.png -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/anomaly/src/images/go-previous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/embedded/anomaly/src/images/go-previous.png -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/anomaly/src/images/list-remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/embedded/anomaly/src/images/list-remove.png -------------------------------------------------------------------------------- /examples/webkitwidgets/imageanalyzer/resources/images/flower.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/imageanalyzer/resources/images/flower.jpg -------------------------------------------------------------------------------- /examples/webkitwidgets/imageanalyzer/resources/images/seaShell.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/imageanalyzer/resources/images/seaShell.jpg -------------------------------------------------------------------------------- /examples/webkitwidgets/previewer/doc/images/previewer-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/previewer/doc/images/previewer-example.png -------------------------------------------------------------------------------- /examples/webkitwidgets/scroller/wheel/doc/images/wheel-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/scroller/wheel/doc/images/wheel-example.png -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/anomaly/src/images/button-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/embedded/anomaly/src/images/button-close.png -------------------------------------------------------------------------------- /examples/webkitwidgets/imageanalyzer/resources/images/bellaCoola.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/imageanalyzer/resources/images/bellaCoola.jpg -------------------------------------------------------------------------------- /examples/webkitwidgets/imageanalyzer/resources/images/mtRainier.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/imageanalyzer/resources/images/mtRainier.jpg -------------------------------------------------------------------------------- /tests/auto/guiapplauncher/examples.txt: -------------------------------------------------------------------------------- 1 | "webkit/browser Example", "examples/browser", "browser", 0, 0000 2 | "webkit/fancybrowser Example", "examples/fancybrowser", "fancybrowser", 0, 7000 3 | -------------------------------------------------------------------------------- /examples/webkitwidgets/domtraversal/doc/images/webkit-domtraversal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/domtraversal/doc/images/webkit-domtraversal.png -------------------------------------------------------------------------------- /examples/webkitwidgets/fancybrowser/doc/images/fancybrowser-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/fancybrowser/doc/images/fancybrowser-example.png -------------------------------------------------------------------------------- /examples/webkitwidgets/framecapture/doc/images/framecapture-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/framecapture/doc/images/framecapture-example.png -------------------------------------------------------------------------------- /examples/webkitqml/flickrview/flickrview.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | flickrview.qml 4 | images/flickr.png 5 | 6 | 7 | -------------------------------------------------------------------------------- /examples/webkitqml/youtubeview/doc/images/youtubeview-example-preset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitqml/youtubeview/doc/images/youtubeview-example-preset.png -------------------------------------------------------------------------------- /examples/webkitwidgets/formextractor/doc/images/formextractor-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/formextractor/doc/images/formextractor-example.png -------------------------------------------------------------------------------- /examples/webkitwidgets/xmlpatterns/doc/images/qobjectxmlmodel-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/xmlpatterns/doc/images/qobjectxmlmodel-example.png -------------------------------------------------------------------------------- /examples/webkitwidgets/xmlpatterns/qobjectxmlmodel/queries/wholeTree.xq: -------------------------------------------------------------------------------- 1 | , 2 | $root/preceding-sibling::metaObjects, 3 | $root 4 | -------------------------------------------------------------------------------- /examples/webkitwidgets/simpleselector/doc/images/webkit-simpleselector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/simpleselector/doc/images/webkit-simpleselector.png -------------------------------------------------------------------------------- /examples/webkitwidgets/imageanalyzer/doc/images/webkit-imageanalyzer-complete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/imageanalyzer/doc/images/webkit-imageanalyzer-complete.png -------------------------------------------------------------------------------- /examples/webkitwidgets/imageanalyzer/doc/images/webkit-imageanalyzer-progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/imageanalyzer/doc/images/webkit-imageanalyzer-progress.png -------------------------------------------------------------------------------- /examples/webkitwidgets/imageanalyzer/doc/images/webkit-imageanalyzer-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtwebkit-examples/HEAD/examples/webkitwidgets/imageanalyzer/doc/images/webkit-imageanalyzer-screenshot.png -------------------------------------------------------------------------------- /examples/webkitwidgets/xmlpatterns/qobjectxmlmodel/queries.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | queries/wholeTree.xq 5 | queries/statisticsInHTML.xq 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/webkitqml/youtubeview/youtubeview.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | content/YouTubeDialog.qml 4 | content/player.html 5 | youtubeview.qml 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/webkitwidgets/framecapture/framecapture.pro: -------------------------------------------------------------------------------- 1 | QT += webkitwidgets network widgets 2 | 3 | HEADERS = framecapture.h 4 | SOURCES = main.cpp \ 5 | framecapture.cpp 6 | 7 | # install 8 | target.path = $$[QT_INSTALL_EXAMPLES]/webkitwidgets/framecapture 9 | INSTALLS += target 10 | -------------------------------------------------------------------------------- /examples/webkitwidgets/scroller/wheel/wheel.pro: -------------------------------------------------------------------------------- 1 | HEADERS = wheelwidget.h 2 | SOURCES = wheelwidget.cpp \ 3 | main.cpp 4 | 5 | QT += webkitwidgets widgets 6 | 7 | # install 8 | target.path = $$[QT_INSTALL_EXAMPLES]/webkitwidgets/scroller/wheel 9 | INSTALLS += target 10 | -------------------------------------------------------------------------------- /examples/webkitqml/shared/shared.pro: -------------------------------------------------------------------------------- 1 | #just install the files 2 | TEMPLATE = aux 3 | 4 | qml.files = images \ 5 | LoadIndicator.qml \ 6 | Button.qml \ 7 | main.cpp \ 8 | qmldir 9 | 10 | qml.path = $$[QT_INSTALL_EXAMPLES]/webkitqml/shared 11 | INSTALLS = qml 12 | -------------------------------------------------------------------------------- /examples/webkitwidgets/domtraversal/domtraversal.pro: -------------------------------------------------------------------------------- 1 | QT += webkitwidgets network widgets 2 | FORMS = window.ui 3 | HEADERS = window.h 4 | SOURCES = main.cpp \ 5 | window.cpp 6 | 7 | # install 8 | target.path = $$[QT_INSTALL_EXAMPLES]/webkitwidgets/domtraversal 9 | INSTALLS += target 10 | -------------------------------------------------------------------------------- /examples/webkitwidgets/fancybrowser/fancybrowser.pro: -------------------------------------------------------------------------------- 1 | QT += webkitwidgets network widgets 2 | HEADERS = mainwindow.h 3 | SOURCES = main.cpp \ 4 | mainwindow.cpp 5 | RESOURCES = jquery.qrc 6 | 7 | # install 8 | target.path = $$[QT_INSTALL_EXAMPLES]/webkitwidgets/fancybrowser 9 | INSTALLS += target 10 | -------------------------------------------------------------------------------- /examples/webkitwidgets/simpleselector/simpleselector.pro: -------------------------------------------------------------------------------- 1 | QT += webkitwidgets network widgets 2 | FORMS = window.ui 3 | HEADERS = window.h 4 | SOURCES = main.cpp \ 5 | window.cpp 6 | 7 | # install 8 | target.path = $$[QT_INSTALL_EXAMPLES]/webkitwidgets/simpleselector 9 | INSTALLS += target 10 | -------------------------------------------------------------------------------- /examples/webkitqml/shared/shared.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/arrow.png 4 | images/busy.png 5 | images/less.png 6 | images/more.png 7 | Button.qml 8 | LoadIndicator.qml 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/webkitwidgets/imageanalyzer/resources/imageanalyzer.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | index.html 4 | images/mtRainier.jpg 5 | images/bellaCoola.jpg 6 | images/trees.jpg 7 | images/flower.jpg 8 | images/seaShell.jpg 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/data/data.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | addtab.png 4 | closetab.png 5 | history.png 6 | browser.svg 7 | defaultbookmarks.xbel 8 | loading.gif 9 | defaulticon.png 10 | 11 | 12 | -------------------------------------------------------------------------------- /examples/webkitwidgets/scroller/plot/plot.pro: -------------------------------------------------------------------------------- 1 | HEADERS = settingswidget.h \ 2 | plotwidget.h 3 | SOURCES = settingswidget.cpp \ 4 | plotwidget.cpp \ 5 | main.cpp 6 | 7 | QT += webkitwidgets widgets 8 | 9 | # install 10 | target.path = $$[QT_INSTALL_EXAMPLES]/webkitwidgets/scroller/plot 11 | INSTALLS += target 12 | -------------------------------------------------------------------------------- /examples/webkitwidgets/previewer/previewer.pro: -------------------------------------------------------------------------------- 1 | QT += webkitwidgets network widgets 2 | HEADERS = previewer.h \ 3 | mainwindow.h 4 | SOURCES = main.cpp \ 5 | previewer.cpp \ 6 | mainwindow.cpp 7 | FORMS = previewer.ui 8 | 9 | # install 10 | target.path = $$[QT_INSTALL_EXAMPLES]/webkitwidgets/previewer 11 | INSTALLS += target 12 | -------------------------------------------------------------------------------- /examples/webkitqml/flickrview/flickrview.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | 3 | DEFINES += QWEBKIT_EXAMPLE_NAME=\\\"flickrview\\\" 4 | 5 | QT += quick qml webkit 6 | SOURCES += ../shared/main.cpp 7 | 8 | mac: CONFIG -= app_bundle 9 | 10 | RESOURCES += flickrview.qrc \ 11 | ../shared/shared.qrc 12 | 13 | target.path = $$[QT_INSTALL_EXAMPLES]/webkitqml/flickrview 14 | INSTALLS += target 15 | -------------------------------------------------------------------------------- /examples/webkitwidgets/webkitwidgets.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | SUBDIRS += domtraversal \ 3 | formextractor \ 4 | previewer \ 5 | fancybrowser \ 6 | simpleselector \ 7 | imageanalyzer \ 8 | framecapture \ 9 | browser \ 10 | embedded \ 11 | scroller \ 12 | xmlpatterns 13 | -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/anomaly/src/anomaly.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/go-next.png 4 | images/go-previous.png 5 | images/edit-find.png 6 | images/list-add.png 7 | images/list-remove.png 8 | images/button-close.png 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/webkitwidgets/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.pro: -------------------------------------------------------------------------------- 1 | 2 | FORMS += forms/mainwindow.ui 3 | QT += xmlpatterns webkitwidgets widgets 4 | SOURCES += qobjectxmlmodel.cpp main.cpp mainwindow.cpp xmlsyntaxhighlighter.cpp 5 | HEADERS += qobjectxmlmodel.h mainwindow.h xmlsyntaxhighlighter.h 6 | RESOURCES = queries.qrc 7 | 8 | # install 9 | target.path = $$[QT_INSTALL_EXAMPLES]/webkitwidgets/xmlpatterns/qobjectxmlmodel 10 | INSTALLS += target 11 | -------------------------------------------------------------------------------- /examples/webkitwidgets/imageanalyzer/imageanalyzer.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | HEADERS = imageanalyzer.h \ 3 | mainwindow.h 4 | SOURCES = imageanalyzer.cpp \ 5 | main.cpp \ 6 | mainwindow.cpp 7 | 8 | QT += network webkitwidgets widgets concurrent 9 | 10 | RESOURCES = resources/imageanalyzer.qrc 11 | 12 | EXAMPLE_FILES += html/index.html ../webkit-bridge-tutorial.qdoc outline.txt 13 | 14 | target.path = $$[QT_INSTALL_EXAMPLES]/webkitwidgets/imageanalyzer 15 | INSTALLS += target 16 | -------------------------------------------------------------------------------- /examples/webkitwidgets/imageanalyzer/README: -------------------------------------------------------------------------------- 1 | This example demonstrates the use of Qt WebKit to make a hybrid application. 2 | 3 | Build instructions: 4 | 5 | On Mac OS X: 6 | In this directory: 7 | qmake -spec macx-g++ 8 | make clean all 9 | open imageanalyzer.app 10 | On Linux/Unix: 11 | In this directory: 12 | qmake 13 | make clean all 14 | ./imageanalyzer 15 | 16 | On Windows: 17 | In this directory: 18 | qmake 19 | nmake clean all 20 | debug\imageanalyzer.exe 21 | -------------------------------------------------------------------------------- /examples/webkitwidgets/formextractor/formextractor.pro: -------------------------------------------------------------------------------- 1 | QT += webkitwidgets network widgets 2 | TARGET = formextractor 3 | TEMPLATE = app 4 | SOURCES += main.cpp \ 5 | formextractor.cpp \ 6 | mainwindow.cpp 7 | HEADERS += formextractor.h \ 8 | mainwindow.h 9 | FORMS += formextractor.ui 10 | RESOURCES += formextractor.qrc 11 | 12 | # install 13 | target.path = $$[QT_INSTALL_EXAMPLES]/webkitwidgets/formextractor 14 | INSTALLS += target 15 | -------------------------------------------------------------------------------- /examples/webkitqml/youtubeview/youtubeview.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | 3 | DEFINES += QWEBKIT_EXAMPLE_NAME=\\\"youtubeview\\\" 4 | 5 | QT += quick qml webkit 6 | SOURCES += ../shared/main.cpp 7 | 8 | mac: CONFIG -= app_bundle 9 | 10 | target.path = $$[QT_INSTALL_EXAMPLES]/webkitqml/youtubeview 11 | qml.files = youtubeview.qml content 12 | qml.path = $$[QT_INSTALL_EXAMPLES]/webkitqml/youtubeview 13 | INSTALLS += target qml 14 | 15 | OTHER_FILES += \ 16 | player.html 17 | 18 | RESOURCES += youtubeview.qrc \ 19 | ../shared/shared.qrc 20 | -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/anomaly/anomaly.pro: -------------------------------------------------------------------------------- 1 | QT += network \ 2 | webkitwidgets \ 3 | widgets 4 | HEADERS += src/BrowserWindow.h \ 5 | src/BrowserView.h \ 6 | src/TitleBar.h \ 7 | src/HomeView.h \ 8 | src/AddressBar.h \ 9 | src/BookmarksView.h \ 10 | src/flickcharm.h \ 11 | src/ZoomStrip.h \ 12 | src/ControlStrip.h \ 13 | src/webview.h 14 | SOURCES += src/Main.cpp \ 15 | src/BrowserWindow.cpp \ 16 | src/BrowserView.cpp \ 17 | src/TitleBar.cpp \ 18 | src/HomeView.cpp \ 19 | src/AddressBar.cpp \ 20 | src/BookmarksView.cpp \ 21 | src/flickcharm.cpp \ 22 | src/ZoomStrip.cpp \ 23 | src/ControlStrip.cpp \ 24 | src/webview.cpp 25 | RESOURCES += src/anomaly.qrc 26 | 27 | target.path = $$[QT_INSTALL_EXAMPLES]/webkitwidgets/embedded/anomaly 28 | INSTALLS += target 29 | -------------------------------------------------------------------------------- /dist/changes-5.0.1: -------------------------------------------------------------------------------- 1 | Qt 5.0.1 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.0.0. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | http://qt-project.org/doc/qt-5.0/ 8 | 9 | Some of the changes listed in this file include issue tracking numbers 10 | corresponding to tasks in the Qt Bug Tracker: 11 | 12 | http://bugreports.qt-project.org/ 13 | 14 | Each of these identifiers can be entered in the bug tracker to obtain more 15 | information about a particular change. 16 | 17 | 18 | **************************************************************************** 19 | * General * 20 | **************************************************************************** 21 | 22 | - This release contains only minor code improvements. 23 | -------------------------------------------------------------------------------- /dist/changes-5.0.2: -------------------------------------------------------------------------------- 1 | Qt 5.0.2 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.0.0 and 5.0.1. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | http://qt-project.org/doc/qt-5.0/ 8 | 9 | Some of the changes listed in this file include issue tracking numbers 10 | corresponding to tasks in the Qt Bug Tracker: 11 | 12 | http://bugreports.qt-project.org/ 13 | 14 | Each of these identifiers can be entered in the bug tracker to obtain more 15 | information about a particular change. 16 | 17 | 18 | **************************************************************************** 19 | * General * 20 | **************************************************************************** 21 | 22 | General Improvements 23 | -------------------- 24 | 25 | - This release contains only minor code improvements. 26 | -------------------------------------------------------------------------------- /dist/changes-5.1.1: -------------------------------------------------------------------------------- 1 | Qt 5.1 introduces many new features and improvements as well as bugfixes 2 | over the 5.0.x series. For more details, refer to the online documentation 3 | included in this distribution. The documentation is also available online: 4 | 5 | http://qt-project.org/doc/qt-5.1 6 | 7 | The Qt version 5.1 series is binary compatible with the 5.0.x series. 8 | Applications compiled for 5.0 will continue to run with 5.1. 9 | 10 | Some of the changes listed in this file include issue tracking numbers 11 | corresponding to tasks in the Qt Bug Tracker: 12 | 13 | http://bugreports.qt-project.org/ 14 | 15 | Each of these identifiers can be entered in the bug tracker to obtain more 16 | information about a particular change. 17 | 18 | **************************************************************************** 19 | * General * 20 | **************************************************************************** 21 | 22 | - This release contains only minor code improvements. 23 | -------------------------------------------------------------------------------- /dist/changes-5.1.0: -------------------------------------------------------------------------------- 1 | Qt 5.1 introduces many new features and improvements as well as bugfixes 2 | over the 5.0.x series. For more details, refer to the online documentation 3 | included in this distribution. The documentation is also available online: 4 | 5 | http://qt-project.org/doc/qt-5.1 6 | 7 | The Qt version 5.1 series is binary compatible with the 5.0.x series. 8 | Applications compiled for 5.0 will continue to run with 5.1. 9 | 10 | Some of the changes listed in this file include issue tracking numbers 11 | corresponding to tasks in the Qt Bug Tracker: 12 | 13 | http://bugreports.qt-project.org/ 14 | 15 | Each of these identifiers can be entered in the bug tracker to obtain more 16 | information about a particular change. 17 | 18 | **************************************************************************** 19 | * General * 20 | **************************************************************************** 21 | 22 | - Rename QtWebKit Examples and Demos to QtWebKit Examples 23 | -------------------------------------------------------------------------------- /examples/webkitwidgets/formextractor/form.html: -------------------------------------------------------------------------------- 1 | 2 |

3 | The Green People Book Club 4 |

5 | 6 |

7 | Welcome to The Green People Book Club. Please register to obtain a membership with us. 8 |

9 |
10 | 11 | 12 | 15 | 18 | 19 | 20 | 23 | 26 | 27 | 28 | 31 | 35 | 36 | 37 | 41 | 42 |
13 | First name: 14 | 16 | 17 |
21 | Last name: 22 | 24 | 25 |
29 | Gender: 30 | 32 | Male 33 | Female 34 |
38 | 39 | Check here if you would like to receive regular updates from us: 40 |
43 | 44 |
45 | 46 | 47 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/htmls/notfound.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | %1 4 | 45 | 46 | 47 |
48 | 49 |

%2

50 |

When connecting to: %3.

51 | 60 |

61 |
62 | 63 | 64 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/data/defaultbookmarks.xbel: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Bookmarks Bar 6 | 7 | Qt Home Page 8 | 9 | 10 | Qt Documentation 11 | 12 | 13 | Qt Blog 14 | 15 | 16 | Qt Centre 17 | 18 | 19 | Qt-Apps.org 20 | 21 | 22 | Online Communities 23 | 24 | 25 | WebKit.org 26 | 27 | 28 | xkcd 29 | 30 | 31 | Twitter 32 | 33 | 34 | 35 | Bookmarks Menu 36 | 37 | reddit.com: what's new online! 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /doc/qtwebkitexamples.qdocconf: -------------------------------------------------------------------------------- 1 | include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) 2 | 3 | project = QtWebKitExamples 4 | description = "Qt WebKit Examples Documentation" 5 | version = $QT_VERSION 6 | 7 | # Defines the name of the project. You cannot use operators (+, =, -) in 8 | # the name. Properties for this project are set using a qhp..property 9 | # format. 10 | 11 | qhp.projects = QtWebKitExamples 12 | 13 | qhp.QtWebKitExamples.file = qtwebkitexamples.qhp 14 | qhp.QtWebKitExamples.namespace = org.qt-project.qtwebkitexamples.$QT_VERSION_TAG 15 | qhp.QtWebKitExamples.indexTitle = Qt WebKit Examples 16 | qhp.QtWebKitExamples.virtualFolder = qtwebkitexamples 17 | qhp.QtWebKitExamples.indexRoot = 18 | qhp.QtWebKitExamples.filterAttributes = qtwebkitexamples $QT_VERSION qtrefdoc 19 | qhp.QtWebKitExamples.customFilters.Qt.name = QtWebKitExamples $QT_VERSION 20 | qhp.QtWebKitExamples.customFilters.Qt.filterAttributes = qtwebkitexamples $QT_VERSION 21 | 22 | qhp.QtWebKitExamples.subprojects = manual 23 | qhp.QtWebKitExamples.subprojects.manual.title = Qt WebKit Examples 24 | qhp.QtWebKitExamples.subprojects.manual.indexTitle = Qt WebKit Examples 25 | qhp.QtWebKitExamples.subprojects.manual.type = manual 26 | 27 | outputdir = $QT_INSTALL_DOCS/qtwebkitexamples 28 | 29 | depends += qtcore qtconcurrent qtdesigner qtqml qtnetwork qtwidgets qtquick qtgui qtscript qtdoc qtxml qtwebkit qtxmlpatterns 30 | 31 | exampledirs = ../examples 32 | 33 | examples.fileextensions += "*.html *.plist *.rc *.xbel" 34 | 35 | sourcedirs = src 36 | 37 | imagedirs = images 38 | 39 | navigation.landingpage = "Qt WebKit Examples" 40 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/Info_mac.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIconFile 6 | @ICON@ 7 | CFBundlePackageType 8 | APPL 9 | CFBundleGetInfoString 10 | Created by Qt/QMake 11 | CFBundleIdentifier 12 | com.trolltech.DemoBrowser 13 | CFBundleSignature 14 | ttxt 15 | CFBundleExecutable 16 | @EXECUTABLE@ 17 | CFBundleDocumentTypes 18 | 19 | 20 | CFBundleTypeExtensions 21 | 22 | html 23 | htm 24 | shtml 25 | xht 26 | xhtml 27 | 28 | CFBundleTypeIconFile 29 | @ICON@ 30 | CFBundleTypeName 31 | HTML Document 32 | CFBundleTypeOSTypes 33 | 34 | HTML 35 | 36 | CFBundleTypeRole 37 | Viewer 38 | 39 | 40 | NOTE 41 | DemoBrowser by The Qt Company Ltd. 42 | 43 | 44 | -------------------------------------------------------------------------------- /examples/webkitwidgets/formextractor/doc/src/formextractor.qdoc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the documentation of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:FDL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Free Documentation License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Free 19 | ** Documentation License version 1.3 as published by the Free Software 20 | ** Foundation and appearing in the file included in the packaging of 21 | ** this file. Please review the following information to ensure 22 | ** the GNU Free Documentation License version 1.3 requirements 23 | ** will be met: http://www.gnu.org/copyleft/fdl.html. 24 | ** $QT_END_LICENSE$ 25 | ** 26 | ****************************************************************************/ 27 | 28 | /*! 29 | \example webkitwidgets/formextractor 30 | \title Form Extractor Example 31 | \brief Demonstrates how to read form data using JavaScript 32 | \ingroup webkit-widgetexamples 33 | 34 | \brief The Form Extractor example shows how to use QWebFrame with JavaScript to 35 | extract form data. 36 | 37 | \image formextractor-example.png 38 | 39 | */ 40 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/doc/src/browser.qdoc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the documentation of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:FDL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Free Documentation License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Free 19 | ** Documentation License version 1.3 as published by the Free Software 20 | ** Foundation and appearing in the file included in the packaging of 21 | ** this file. Please review the following information to ensure 22 | ** the GNU Free Documentation License version 1.3 requirements 23 | ** will be met: http://www.gnu.org/copyleft/fdl.html. 24 | ** $QT_END_LICENSE$ 25 | ** 26 | ****************************************************************************/ 27 | 28 | /*! 29 | \example webkitwidgets/browser 30 | \title Tab Browser 31 | \brief Demonstrates a complete web browsing experience 32 | \ingroup webkit-widgetexamples 33 | 34 | The Tab Browser example shows \l{Qt WebKit} module in action, 35 | providing a little Web browser application with support for tabs. 36 | 37 | \image browser-demo.png 38 | 39 | This browser is the foundation for the \l{Arora Browser}, a simple cross-platform 40 | Web browser. 41 | */ 42 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/squeezelabel.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the demonstration applications of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef SQUEEZELABEL_H 35 | #define SQUEEZELABEL_H 36 | 37 | #include 38 | 39 | class SqueezeLabel : public QLabel 40 | { 41 | Q_OBJECT 42 | 43 | public: 44 | SqueezeLabel(QWidget *parent = 0); 45 | 46 | protected: 47 | void paintEvent(QPaintEvent *event); 48 | 49 | }; 50 | 51 | #endif // SQUEEZELABEL_H 52 | 53 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/main.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the demonstration applications of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #include "browserapplication.h" 35 | 36 | int main(int argc, char **argv) 37 | { 38 | Q_INIT_RESOURCE(data); 39 | BrowserApplication application(argc, argv); 40 | if (!application.isTheOnlyBrowser() || !application.isCorrectlyInitialized()) 41 | return 0; 42 | application.newMainWindow(); 43 | return application.exec(); 44 | } 45 | 46 | -------------------------------------------------------------------------------- /examples/webkitqml/youtubeview/content/player.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -1 4 | 5 | 6 | 7 | 8 |
9 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/edittreeview.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the demonstration applications of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef EDITTREEVIEW_H 35 | #define EDITTREEVIEW_H 36 | 37 | #include 38 | 39 | class EditTreeView : public QTreeView 40 | { 41 | Q_OBJECT 42 | 43 | public: 44 | EditTreeView(QWidget *parent = 0); 45 | void keyPressEvent(QKeyEvent *event); 46 | 47 | public slots: 48 | void removeOne(); 49 | void removeAll(); 50 | }; 51 | 52 | #endif // EDITTREEVIEW_H 53 | 54 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/edittableview.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the demonstration applications of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef EDITTABLEVIEW_H 35 | #define EDITTABLEVIEW_H 36 | 37 | #include 38 | 39 | class EditTableView : public QTableView 40 | { 41 | Q_OBJECT 42 | 43 | public: 44 | EditTableView(QWidget *parent = 0); 45 | void keyPressEvent(QKeyEvent *event); 46 | 47 | public slots: 48 | void removeOne(); 49 | void removeAll(); 50 | }; 51 | 52 | #endif // EDITTABLEVIEW_H 53 | 54 | -------------------------------------------------------------------------------- /examples/webkitwidgets/framecapture/doc/src/webkit-framecapture.qdoc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the documentation of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:FDL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Free Documentation License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Free 19 | ** Documentation License version 1.3 as published by the Free Software 20 | ** Foundation and appearing in the file included in the packaging of 21 | ** this file. Please review the following information to ensure 22 | ** the GNU Free Documentation License version 1.3 requirements 23 | ** will be met: http://www.gnu.org/copyleft/fdl.html. 24 | ** $QT_END_LICENSE$ 25 | ** 26 | ****************************************************************************/ 27 | 28 | /*! 29 | \example webkitwidgets/framecapture 30 | \title WebKit Frame Capture Example 31 | \brief Demonstrates how to capture frame in the web page 32 | \ingroup webkit-widgetexamples 33 | 34 | The Frame Capture example shows how to use the WebKit browser engine to 35 | obtain images of frames in a Web page. 36 | 37 | This example is designed to be run from the command-line. Run the 38 | example with a URL and the output file name as arguments. The application 39 | captures the frame contents in a PNG image with the file name your 40 | specified. 41 | 42 | The following output image is generated by the application, if you pass the 43 | URL, www.qt-project.org. 44 | 45 | \image framecapture-example.png 46 | */ 47 | -------------------------------------------------------------------------------- /examples/webkitwidgets/simpleselector/window.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Window 4 | 5 | 6 | 7 | 0 8 | 0 9 | 640 10 | 480 11 | 12 | 13 | 14 | Web Element Selector 15 | 16 | 17 | 18 | 19 | 20 | 21 | http://webkit.org/ 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | QFormLayout::ExpandingFieldsGrow 32 | 33 | 34 | 35 | 36 | &Element: 37 | 38 | 39 | elementLineEdit 40 | 41 | 42 | 43 | 44 | 45 | 46 | li a 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | &Highlight 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | QWebView 66 | QWidget 67 |
QtWebKit/QWebView
68 |
69 |
70 | 71 | 72 |
73 | -------------------------------------------------------------------------------- /examples/webkitwidgets/xmlpatterns/qobjectxmlmodel/queries/statisticsInHTML.xq: -------------------------------------------------------------------------------- 1 | 2 | 3 | Generated statistics 4 | 5 | 6 |

In total the tree has {count($root//QObject)} QObject instances.

7 |

Order by occurrence, the QObjects are:

8 | 9 |
    10 | { 11 | for $i in $root/preceding-sibling::metaObjects/metaObject 12 | let $count := count($root//QObject[@className eq $i/@className]) 13 | stable order by $count descending 14 | return if($count > 1) 15 | then
  1. {string($i/@className), $count} occurrences
  2. 16 | else () 17 | } 18 |
19 | 20 |

Properties

21 | { 22 | (: For each QObject, we create a table listing 23 | : the properties of that object. :) 24 | for $object in $root//QObject 25 | return (

{let $name := string($object/@objectName) 26 | return if(string-length($name)) 27 | then $name 28 | else "[no name]", 29 | '(', string($object/@className), ')'}

, 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | { 39 | $object/@*/ 40 | 45 | 52 | 53 | } 54 | 55 |
Property NameValue
41 | { 42 | name() 43 | } 44 | 46 | { 47 | if(data(.)) 48 | then string(.) 49 | else "N/A" 50 | } 51 |
) 56 | } 57 | 58 | 59 | -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/anomaly/src/webview.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef WEBVIEW_H 35 | #define WEBVIEW_H 36 | 37 | #include 38 | #include 39 | 40 | class WebView : public QWebView 41 | { 42 | Q_OBJECT 43 | public: 44 | WebView(QWidget *parent = 0); 45 | 46 | protected: 47 | void paintEvent(QPaintEvent *event); 48 | 49 | private slots: 50 | void newPageLoading(); 51 | void pageLoaded(bool ok); 52 | 53 | private: 54 | QTime loadingTime; 55 | bool inLoading; 56 | }; 57 | 58 | #endif // WEBVIEW_H 59 | -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/anomaly/src/BookmarksView.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef BOOKMARKSVIEW_H 35 | #define BOOKMARKSVIEW_H 36 | 37 | #include 38 | 39 | QT_BEGIN_NAMESPACE 40 | class QListWidgetItem; 41 | class QUrl; 42 | QT_END_NAMESPACE 43 | 44 | class BookmarksView : public QWidget 45 | { 46 | Q_OBJECT 47 | 48 | public: 49 | BookmarksView(QWidget *parent = 0); 50 | 51 | signals: 52 | void urlSelected(const QUrl &url); 53 | 54 | private slots: 55 | void activate(QListWidgetItem *item); 56 | }; 57 | 58 | #endif // BOOKMARKSVIEW_H 59 | -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/anomaly/src/Main.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | #include "BrowserWindow.h" 39 | 40 | int main(int argc, char *argv[]) 41 | { 42 | QApplication app(argc, argv); 43 | 44 | app.setApplicationName("Anomaly"); 45 | app.setApplicationVersion("0.0.0"); 46 | 47 | BrowserWindow window; 48 | window.resize(360, 640); 49 | window.show(); 50 | app.setStyle("windows"); 51 | 52 | #ifdef QT_KEYPAD_NAVIGATION 53 | QApplication::setNavigationMode(Qt::NavigationModeCursorAuto); 54 | #endif 55 | return app.exec(); 56 | } 57 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/squeezelabel.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the demonstration applications of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #include "squeezelabel.h" 35 | 36 | SqueezeLabel::SqueezeLabel(QWidget *parent) : QLabel(parent) 37 | { 38 | } 39 | 40 | void SqueezeLabel::paintEvent(QPaintEvent *event) 41 | { 42 | QFontMetrics fm = fontMetrics(); 43 | if (fm.width(text()) > contentsRect().width()) { 44 | QString elided = fm.elidedText(text(), Qt::ElideMiddle, width()); 45 | QString oldText = text(); 46 | setText(elided); 47 | QLabel::paintEvent(event); 48 | setText(oldText); 49 | } else { 50 | QLabel::paintEvent(event); 51 | } 52 | } 53 | 54 | -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/anomaly/src/ZoomStrip.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef ZOOMSTRIP_H 35 | #define ZOOMSTRIP_H 36 | 37 | #include 38 | 39 | class ZoomStrip : public QWidget 40 | { 41 | Q_OBJECT 42 | 43 | public: 44 | ZoomStrip(QWidget *parent = 0); 45 | 46 | QSize sizeHint() const; 47 | QSize minimumSizeHint() const; 48 | 49 | signals: 50 | void zoomInClicked(); 51 | void zoomOutClicked(); 52 | 53 | protected: 54 | void paintEvent(QPaintEvent *event); 55 | void mousePressEvent(QMouseEvent *event); 56 | 57 | private: 58 | QPixmap zoomInPixmap; 59 | QPixmap zoomOutPixmap; 60 | }; 61 | 62 | #endif // ZOOMSTRIP_H 63 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/browser.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | TARGET = browser 3 | QT += webkitwidgets network widgets printsupport 4 | 5 | qtHaveModule(uitools):!embedded: QT += uitools 6 | else: DEFINES += QT_NO_UITOOLS 7 | 8 | FORMS += \ 9 | addbookmarkdialog.ui \ 10 | bookmarks.ui \ 11 | cookies.ui \ 12 | cookiesexceptions.ui \ 13 | downloaditem.ui \ 14 | downloads.ui \ 15 | history.ui \ 16 | passworddialog.ui \ 17 | proxy.ui \ 18 | settings.ui 19 | 20 | HEADERS += \ 21 | autosaver.h \ 22 | bookmarks.h \ 23 | browserapplication.h \ 24 | browsermainwindow.h \ 25 | chasewidget.h \ 26 | cookiejar.h \ 27 | downloadmanager.h \ 28 | edittableview.h \ 29 | edittreeview.h \ 30 | history.h \ 31 | modelmenu.h \ 32 | networkaccessmanager.h \ 33 | searchlineedit.h \ 34 | settings.h \ 35 | squeezelabel.h \ 36 | tabwidget.h \ 37 | toolbarsearch.h \ 38 | urllineedit.h \ 39 | webview.h \ 40 | xbel.h 41 | 42 | SOURCES += \ 43 | autosaver.cpp \ 44 | bookmarks.cpp \ 45 | browserapplication.cpp \ 46 | browsermainwindow.cpp \ 47 | chasewidget.cpp \ 48 | cookiejar.cpp \ 49 | downloadmanager.cpp \ 50 | edittableview.cpp \ 51 | edittreeview.cpp \ 52 | history.cpp \ 53 | modelmenu.cpp \ 54 | networkaccessmanager.cpp \ 55 | searchlineedit.cpp \ 56 | settings.cpp \ 57 | squeezelabel.cpp \ 58 | tabwidget.cpp \ 59 | toolbarsearch.cpp \ 60 | urllineedit.cpp \ 61 | webview.cpp \ 62 | xbel.cpp \ 63 | main.cpp 64 | 65 | RESOURCES += data/data.qrc htmls/htmls.qrc 66 | 67 | build_all:!build_pass { 68 | CONFIG -= build_all 69 | CONFIG += release 70 | } 71 | 72 | win32 { 73 | RC_FILE = browser.rc 74 | } 75 | 76 | mac { 77 | ICON = browser.icns 78 | QMAKE_INFO_PLIST = Info_mac.plist 79 | TARGET = Browser 80 | 81 | # No 64-bit Flash on Mac, so build the browser 32-bit 82 | contains(QT_CONFIG, x86) { 83 | CONFIG -= x86_64 84 | CONFIG += x86 85 | } 86 | contains(QT_CONFIG, ppc) { 87 | CONFIG -= ppc64 88 | CONFIG += ppc 89 | } 90 | } 91 | 92 | EXAMPLE_FILES = Info_mac.plist browser.icns browser.ico browser.rc 93 | 94 | # install 95 | target.path = $$[QT_INSTALL_EXAMPLES]/webkitwidgets/browser 96 | INSTALLS += target 97 | -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/anomaly/src/TitleBar.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef TITLEBAR_H 35 | #define TITLEBAR_H 36 | 37 | #include 38 | 39 | class TitleBar : public QWidget 40 | { 41 | Q_OBJECT 42 | 43 | public: 44 | TitleBar(QWidget *parent = 0); 45 | 46 | void setHost(const QString &host); 47 | void setTitle(const QString &title); 48 | void setProgress(int percent); 49 | 50 | QSize sizeHint() const; 51 | QSize minimumSizeHint() const; 52 | 53 | protected: 54 | void paintEvent(QPaintEvent *event); 55 | 56 | private: 57 | QString m_host; 58 | QString m_title; 59 | int m_progress; 60 | }; 61 | 62 | #endif // TITLEBAR_H 63 | -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/anomaly/src/flickcharm.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef FLICKCHARM_H 35 | #define FLICKCHARM_H 36 | 37 | #include 38 | 39 | QT_BEGIN_NAMESPACE 40 | class QWidget; 41 | QT_END_NAMESPACE 42 | 43 | class FlickCharmPrivate; 44 | 45 | class FlickCharm: public QObject 46 | { 47 | Q_OBJECT 48 | public: 49 | FlickCharm(QObject *parent = 0); 50 | ~FlickCharm(); 51 | void activateOn(QWidget *widget); 52 | void deactivateFrom(QWidget *widget); 53 | bool eventFilter(QObject *object, QEvent *event); 54 | 55 | protected: 56 | void timerEvent(QTimerEvent *event); 57 | 58 | private: 59 | FlickCharmPrivate *d; 60 | }; 61 | 62 | #endif // FLICKCHARM_H 63 | -------------------------------------------------------------------------------- /examples/webkitwidgets/imageanalyzer/main.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | 42 | #include "imageanalyzer.h" 43 | #include "mainwindow.h" 44 | 45 | int main(int argc, char* argv[]) 46 | { 47 | QApplication app(argc, argv); 48 | 49 | MainWin win; 50 | win.show(); 51 | return app.exec(); 52 | } 53 | 54 | -------------------------------------------------------------------------------- /examples/webkitwidgets/previewer/main.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | #include 42 | #include "mainwindow.h" 43 | 44 | //! [0] 45 | int main(int argc, char * argv[]) 46 | { 47 | QApplication app(argc, argv); 48 | MainWindow mainWindow; 49 | mainWindow.show(); 50 | return app.exec(); 51 | } 52 | //! [0] 53 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/downloads.ui: -------------------------------------------------------------------------------- 1 | 2 | DownloadDialog 3 | 4 | 5 | 6 | 0 7 | 0 8 | 332 9 | 252 10 | 11 | 12 | 13 | Downloads 14 | 15 | 16 | 17 | 0 18 | 19 | 20 | 0 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | false 31 | 32 | 33 | Clean up 34 | 35 | 36 | 37 | 38 | 39 | 40 | Qt::Horizontal 41 | 42 | 43 | 44 | 58 45 | 24 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 0 Items 56 | 57 | 58 | 59 | 60 | 61 | 62 | Qt::Horizontal 63 | 64 | 65 | 66 | 148 67 | 20 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | EditTableView 77 | QTableView 78 |
edittableview.h
79 |
80 |
81 | 82 | 83 |
84 | -------------------------------------------------------------------------------- /examples/webkitwidgets/xmlpatterns/qobjectxmlmodel/main.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | #include 42 | 43 | #include "mainwindow.h" 44 | 45 | int main(int argc, char* argv[]) 46 | { 47 | Q_INIT_RESOURCE(queries); 48 | QApplication app(argc, argv); 49 | MainWindow mainWindow; 50 | mainWindow.show(); 51 | return app.exec(); 52 | } 53 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/settings.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the demonstration applications of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef SETTINGS_H 35 | #define SETTINGS_H 36 | 37 | #include 38 | #include "ui_settings.h" 39 | 40 | class SettingsDialog : public QDialog, public Ui_Settings 41 | { 42 | Q_OBJECT 43 | 44 | public: 45 | SettingsDialog(QWidget *parent = 0); 46 | void accept(); 47 | 48 | private slots: 49 | void loadDefaults(); 50 | void loadFromSettings(); 51 | void saveToSettings(); 52 | 53 | void setHomeToCurrentPage(); 54 | void showCookies(); 55 | void showExceptions(); 56 | 57 | void chooseFont(); 58 | void chooseFixedFont(); 59 | 60 | private: 61 | QFont standardFont; 62 | QFont fixedFont; 63 | }; 64 | 65 | #endif // SETTINGS_H 66 | 67 | -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/anomaly/src/AddressBar.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef ADDRESSBAR_H 35 | #define ADDRESSBAR_H 36 | 37 | #include 38 | 39 | QT_BEGIN_NAMESPACE 40 | class QLineEdit; 41 | class QToolButton; 42 | QT_END_NAMESPACE 43 | 44 | class AddressBar : public QWidget 45 | { 46 | Q_OBJECT 47 | 48 | public: 49 | AddressBar(QWidget *parent = 0); 50 | QSize sizeHint() const; 51 | 52 | protected: 53 | void resizeEvent(QResizeEvent *event); 54 | void focusInEvent(QFocusEvent *event); 55 | 56 | signals: 57 | void addressEntered(const QString &address); 58 | 59 | private slots: 60 | void processAddress(); 61 | 62 | private: 63 | QLineEdit *m_lineEdit; 64 | QToolButton *m_toolButton; 65 | }; 66 | 67 | #endif // ADDRESSBAR_H 68 | -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/anomaly/src/HomeView.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef HOMEVIEW_H 35 | #define HOMEVIEW_H 36 | 37 | #include 38 | 39 | QT_BEGIN_NAMESPACE 40 | class QUrl; 41 | QT_END_NAMESPACE 42 | 43 | class AddressBar; 44 | class BookmarksView; 45 | 46 | class HomeView : public QWidget 47 | { 48 | Q_OBJECT 49 | 50 | public: 51 | HomeView(QWidget *parent); 52 | 53 | signals: 54 | void urlActivated(const QUrl &url); 55 | void addressEntered(const QString &address); 56 | 57 | private slots: 58 | void gotoAddress(const QString &address); 59 | 60 | protected: 61 | void focusInEvent(QFocusEvent *event); 62 | 63 | private: 64 | AddressBar *m_addressBar; 65 | BookmarksView *m_bookmarks; 66 | }; 67 | 68 | #endif // HOMEVIEW_H 69 | -------------------------------------------------------------------------------- /examples/webkitwidgets/domtraversal/main.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | //! [main program] 41 | #include 42 | #include "window.h" 43 | 44 | int main(int argc, char *argv[]) 45 | { 46 | QApplication app(argc, argv); 47 | Window window; 48 | window.show(); 49 | window.setUrl(QUrl("http://qt-project.org/")); 50 | return app.exec(); 51 | } 52 | //! [main program] 53 | -------------------------------------------------------------------------------- /examples/webkitwidgets/simpleselector/main.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | //! [main program] 42 | #include 43 | #include "window.h" 44 | 45 | int main(int argc, char *argv[]) 46 | { 47 | QApplication app(argc, argv); 48 | Window window; 49 | window.setUrl(QUrl("http://www.webkit.org")); 50 | window.show(); 51 | return app.exec(); 52 | } 53 | //! [main program] 54 | -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/anomaly/src/ControlStrip.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef CONTROLSTRIP_H 35 | #define CONTROLSTRIP_H 36 | 37 | #include 38 | 39 | class ControlStrip : public QWidget 40 | { 41 | Q_OBJECT 42 | 43 | public: 44 | ControlStrip(QWidget *parent = 0); 45 | 46 | QSize sizeHint() const; 47 | QSize minimumSizeHint() const; 48 | 49 | signals: 50 | void menuClicked(); 51 | void backClicked(); 52 | void forwardClicked(); 53 | void closeClicked(); 54 | 55 | protected: 56 | void paintEvent(QPaintEvent *event); 57 | void mousePressEvent(QMouseEvent *event); 58 | 59 | private: 60 | QPixmap menuPixmap; 61 | QPixmap backPixmap; 62 | QPixmap forwardPixmap; 63 | QPixmap closePixmap; 64 | }; 65 | 66 | #endif // CONTROLSTRIP_H 67 | -------------------------------------------------------------------------------- /examples/webkitqml/shared/main.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | #include 41 | #include 42 | int main(int argc, char* argv[]) 43 | { 44 | QGuiApplication app(argc,argv); 45 | QQuickView view; 46 | view.setSource(QUrl("qrc:///" QWEBKIT_EXAMPLE_NAME ".qml")); 47 | view.setResizeMode(QQuickView::SizeRootObjectToView); 48 | view.show(); 49 | return app.exec(); 50 | } 51 | -------------------------------------------------------------------------------- /examples/webkitwidgets/formextractor/main.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | #include 42 | #include "mainwindow.h" 43 | 44 | int main(int argc, char *argv[]) 45 | { 46 | Q_INIT_RESOURCE(formextractor); 47 | QApplication app(argc, argv); 48 | MainWindow mainWindow; 49 | mainWindow.setWindowTitle("Form Extractor"); 50 | mainWindow.show(); 51 | return app.exec(); 52 | } 53 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/autosaver.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the demonstration applications of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef AUTOSAVER_H 35 | #define AUTOSAVER_H 36 | 37 | #include 38 | #include 39 | #include 40 | 41 | /* 42 | This class will call the save() slot on the parent object when the parent changes. 43 | It will wait several seconds after changed() to combining multiple changes and 44 | prevent continuous writing to disk. 45 | */ 46 | class AutoSaver : public QObject { 47 | 48 | Q_OBJECT 49 | 50 | public: 51 | AutoSaver(QObject *parent); 52 | ~AutoSaver(); 53 | void saveIfNeccessary(); 54 | 55 | public slots: 56 | void changeOccurred(); 57 | 58 | protected: 59 | void timerEvent(QTimerEvent *event); 60 | 61 | private: 62 | QBasicTimer m_timer; 63 | QTime m_firstChange; 64 | 65 | }; 66 | 67 | #endif // AUTOSAVER_H 68 | 69 | -------------------------------------------------------------------------------- /examples/webkitwidgets/previewer/previewer.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | #ifndef PREVIEWER_H 42 | #define PREVIEWER_H 43 | 44 | #include "ui_previewer.h" 45 | 46 | //! [0] 47 | class Previewer : public QWidget, public Ui::Form 48 | { 49 | Q_OBJECT 50 | 51 | public: 52 | Previewer(QWidget *parent = 0); 53 | 54 | void setBaseUrl(const QUrl &url); 55 | 56 | public slots: 57 | void on_previewButton_clicked(); 58 | 59 | private: 60 | QUrl baseUrl; 61 | }; 62 | //! [0] 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /examples/webkitwidgets/xmlpatterns/qobjectxmlmodel/mainwindow.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | #ifndef MAINWINDOW_H 42 | #define MAINWINDOW_H 43 | 44 | #include 45 | #include 46 | 47 | #include "ui_mainwindow.h" 48 | 49 | //! [0] 50 | class MainWindow : public QMainWindow, 51 | private Ui_MainWindow 52 | { 53 | Q_OBJECT 54 | 55 | public: 56 | MainWindow(); 57 | 58 | private slots: 59 | void on_actionAbout_triggered(); 60 | }; 61 | //! [0] 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /examples/webkitqml/flickrview/doc/src/flickrview.qdoc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the documentation of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:FDL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Free Documentation License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Free 19 | ** Documentation License version 1.3 as published by the Free Software 20 | ** Foundation and appearing in the file included in the packaging of 21 | ** this file. Please review the following information to ensure 22 | ** the GNU Free Documentation License version 1.3 requirements 23 | ** will be met: http://www.gnu.org/copyleft/fdl.html. 24 | ** $QT_END_LICENSE$ 25 | ** 26 | ****************************************************************************/ 27 | 28 | /*! 29 | \example webkitqml/flickrview 30 | \title Flickr View Example 31 | \brief Demonstrates how to embed a web view in a Qt Quick application 32 | \ingroup webkit-qmlexamples 33 | 34 | The Flickr View Qt Quick example uses a \l{WebView} to browse the images 35 | from the \l{http://flickr.com}{Flickr} public RSS feed. 36 | 37 | \image flickrview-example.png 38 | 39 | FlickrView is an example that retrieves the \l{http://www.flickr.com/services/feeds/docs/photos_public}{flickr.com RSS feed of public photos} 40 | utilizing an \l{XmlListModel} and shows the thumbnails in a \l{ListView}. 41 | When clicking on a thumbnail in the list at the bottom, the full size 42 | image is loaded in a \l{WebView} using the corresponding Flickr link for it. 43 | It is also possible to browse the profile of Flickr users in the WebView like in a 44 | normal browser. This demonstrates how navigaton can be restricted to a specific 45 | domain in the \c{onNavigationRequested} signal. 46 | The feed can be updated using pull-to-refresh at the end of the thumbnail list. 47 | 48 | This example uses the QtWebKit QML API that utilizes the WebKit2 split-process architecture. 49 | */ 50 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/edittreeview.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the demonstration applications of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #include "edittreeview.h" 35 | 36 | #include 37 | 38 | EditTreeView::EditTreeView(QWidget *parent) 39 | : QTreeView(parent) 40 | { 41 | } 42 | 43 | void EditTreeView::keyPressEvent(QKeyEvent *event) 44 | { 45 | if ((event->key() == Qt::Key_Delete 46 | || event->key() == Qt::Key_Backspace) 47 | && model()) { 48 | removeOne(); 49 | } else { 50 | QAbstractItemView::keyPressEvent(event); 51 | } 52 | } 53 | 54 | void EditTreeView::removeOne() 55 | { 56 | if (!model()) 57 | return; 58 | QModelIndex ci = currentIndex(); 59 | int row = ci.row(); 60 | model()->removeRow(row, ci.parent()); 61 | } 62 | 63 | void EditTreeView::removeAll() 64 | { 65 | if (!model()) 66 | return; 67 | model()->removeRows(0, model()->rowCount(rootIndex()), rootIndex()); 68 | } 69 | 70 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/toolbarsearch.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the demonstration applications of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef TOOLBARSEARCH_H 35 | #define TOOLBARSEARCH_H 36 | 37 | #include "searchlineedit.h" 38 | 39 | QT_BEGIN_NAMESPACE 40 | class QUrl; 41 | class QAction; 42 | class QStringListModel; 43 | QT_END_NAMESPACE 44 | 45 | class AutoSaver; 46 | 47 | class ToolbarSearch : public SearchLineEdit 48 | { 49 | Q_OBJECT 50 | 51 | signals: 52 | void search(const QUrl &url); 53 | 54 | public: 55 | ToolbarSearch(QWidget *parent = 0); 56 | ~ToolbarSearch(); 57 | 58 | public slots: 59 | void clear(); 60 | void searchNow(); 61 | 62 | private slots: 63 | void save(); 64 | void aboutToShowMenu(); 65 | void triggeredMenuAction(QAction *action); 66 | 67 | private: 68 | void load(); 69 | 70 | AutoSaver *m_autosaver; 71 | int m_maxSavedSearches; 72 | QStringListModel *m_stringListModel; 73 | }; 74 | 75 | #endif // TOOLBARSEARCH_H 76 | 77 | -------------------------------------------------------------------------------- /examples/webkitwidgets/simpleselector/window.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | #ifndef WINDOW_H 42 | #define WINDOW_H 43 | 44 | #include 45 | #include 46 | //! [Window class definition] 47 | #include "ui_window.h" 48 | 49 | class Window : public QWidget, private Ui::Window 50 | { 51 | Q_OBJECT 52 | 53 | public: 54 | Window(QWidget *parent = 0); 55 | void setUrl(const QUrl &url); 56 | 57 | public slots: 58 | void on_elementLineEdit_returnPressed(); 59 | void on_highlightButton_clicked(); 60 | }; 61 | //! [Window class definition] 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /examples/webkitwidgets/previewer/previewer.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | #include 42 | #include "previewer.h" 43 | 44 | //! [0] 45 | Previewer::Previewer(QWidget *parent) 46 | : QWidget(parent) 47 | { 48 | setupUi(this); 49 | } 50 | //! [0] 51 | 52 | void Previewer::setBaseUrl(const QUrl &url) 53 | { 54 | baseUrl = url; 55 | } 56 | 57 | //! [1] 58 | void Previewer::on_previewButton_clicked() 59 | { 60 | // Update the contents in web viewer 61 | QString text = plainTextEdit->toPlainText(); 62 | webView->setHtml(text, baseUrl); 63 | } 64 | //! [1] 65 | -------------------------------------------------------------------------------- /examples/webkitwidgets/domtraversal/window.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Window 4 | 5 | 6 | 7 | 0 8 | 0 9 | 800 10 | 600 11 | 12 | 13 | 14 | Web Element DOM Traversal 15 | 16 | 17 | 18 | 19 | 4 20 | 21 | 22 | 4 23 | 24 | 25 | 26 | 27 | 28 | http://qt-project.org/ 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 0 39 | 0 40 | 800 41 | 27 42 | 43 | 44 | 45 | 46 | 47 | 48 | Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea 49 | 50 | 51 | Document Structure 52 | 53 | 54 | 1 55 | 56 | 57 | 58 | 59 | 4 60 | 61 | 62 | 63 | 64 | false 65 | 66 | 67 | false 68 | 69 | 70 | 71 | 1 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | QWebView 83 | QWidget 84 |
QtWebKitWidgets/QWebView
85 |
86 |
87 | 88 | 89 |
90 | -------------------------------------------------------------------------------- /examples/webkitwidgets/formextractor/formextractor.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | #ifndef FORMEXTRACTOR_H 42 | #define FORMEXTRACTOR_H 43 | 44 | #include 45 | #include 46 | #include "ui_formextractor.h" 47 | 48 | class FormExtractor : public QWidget 49 | { 50 | Q_OBJECT 51 | 52 | public: 53 | FormExtractor(QWidget *parent = 0, Qt::WindowFlags flags = 0); 54 | ~FormExtractor(); 55 | 56 | public slots: 57 | void submit(); 58 | void populateJavaScriptWindowObject(); 59 | 60 | private: 61 | Ui::Form ui; 62 | }; 63 | 64 | #endif // FORMEXTRACTOR_H 65 | -------------------------------------------------------------------------------- /examples/webkitwidgets/imageanalyzer/mainwindow.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | 42 | #ifndef MAINWINDOW_H 43 | #define MAINWINDOW_H 44 | 45 | #include 46 | 47 | class ImageAnalyzer; 48 | QT_BEGIN_NAMESPACE 49 | class QNetworkDiskCache; 50 | QT_END_NAMESPACE 51 | 52 | class MainWin : public QWebView 53 | { 54 | Q_OBJECT 55 | 56 | public: 57 | explicit MainWin(QWidget * parent = 0); 58 | 59 | private: 60 | ImageAnalyzer * m_analyzer; 61 | QNetworkAccessManager * m_network; 62 | QNetworkDiskCache * m_cache; 63 | 64 | private slots: 65 | void addJSObject(); 66 | 67 | }; 68 | #endif 69 | -------------------------------------------------------------------------------- /examples/webkitwidgets/framecapture/framecapture.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | #ifndef FRAMECAPTURE_H 42 | #define FRAMECAPTURE_H 43 | 44 | #include 45 | 46 | class FrameCapture : public QObject 47 | { 48 | Q_OBJECT 49 | 50 | public: 51 | FrameCapture(); 52 | void load(const QUrl &url, const QString &outputFileName); 53 | 54 | signals: 55 | void finished(); 56 | 57 | private slots: 58 | void printProgress(int percent); 59 | void saveResult(bool ok); 60 | 61 | private: 62 | QWebPage m_page; 63 | QString m_fileName; 64 | int m_percent; 65 | 66 | void saveFrame(QWebFrame *frame); 67 | }; 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/anomaly/src/BookmarksView.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #include "BookmarksView.h" 35 | 36 | #include 37 | 38 | BookmarksView::BookmarksView(QWidget *parent) 39 | : QWidget(parent) 40 | { 41 | QListWidget *m_iconView = new QListWidget(this); 42 | connect(m_iconView, SIGNAL(itemActivated(QListWidgetItem*)), SLOT(activate(QListWidgetItem*))); 43 | 44 | QVBoxLayout *layout = new QVBoxLayout(this); 45 | setLayout(layout); 46 | layout->addWidget(m_iconView); 47 | 48 | m_iconView->addItem("www.google.com"); 49 | m_iconView->addItem("doc.qt.io/qt-5"); 50 | m_iconView->addItem("news.bbc.co.uk/2/mobile/default.stm"); 51 | m_iconView->addItem("mobile.wikipedia.org"); 52 | m_iconView->addItem("qt.io"); 53 | m_iconView->addItem("en.wikipedia.org"); 54 | 55 | setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); 56 | } 57 | 58 | void BookmarksView::activate(QListWidgetItem *item) 59 | { 60 | QUrl url = item->text().prepend("http://"); 61 | emit urlSelected(url); 62 | } 63 | -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/anomaly/src/HomeView.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #include "HomeView.h" 35 | 36 | #include 37 | #include 38 | 39 | #include "AddressBar.h" 40 | #include "BookmarksView.h" 41 | 42 | HomeView::HomeView(QWidget *parent) 43 | : QWidget(parent) 44 | , m_addressBar(0) 45 | { 46 | m_addressBar = new AddressBar(parent); 47 | connect(m_addressBar, SIGNAL(addressEntered(QString)), SLOT(gotoAddress(QString))); 48 | 49 | m_bookmarks = new BookmarksView(parent); 50 | connect(m_bookmarks, SIGNAL(urlSelected(QUrl)), SIGNAL(urlActivated(QUrl))); 51 | 52 | QVBoxLayout *layout = new QVBoxLayout(this); 53 | layout->setMargin(4); 54 | layout->setSpacing(4); 55 | layout->addWidget(m_addressBar); 56 | layout->addWidget(m_bookmarks); 57 | } 58 | 59 | void HomeView::gotoAddress(const QString &address) 60 | { 61 | emit addressEntered(address); 62 | } 63 | 64 | void HomeView::focusInEvent(QFocusEvent *event) 65 | { 66 | m_addressBar->setFocus(); 67 | QWidget::focusInEvent(event); 68 | } 69 | -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/anomaly/src/ZoomStrip.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #include "ZoomStrip.h" 35 | 36 | #include 37 | #include 38 | 39 | ZoomStrip::ZoomStrip(QWidget *parent) 40 | : QWidget(parent) 41 | { 42 | zoomInPixmap.load(":/images/list-add.png"); 43 | zoomOutPixmap.load(":/images/list-remove.png"); 44 | } 45 | 46 | QSize ZoomStrip::sizeHint() const 47 | { 48 | return minimumSizeHint(); 49 | } 50 | 51 | QSize ZoomStrip::minimumSizeHint() const 52 | { 53 | return QSize(48, 96); 54 | } 55 | 56 | void ZoomStrip::mousePressEvent(QMouseEvent *event) 57 | { 58 | if (event->pos().y() < height() / 2) 59 | emit zoomInClicked(); 60 | else 61 | emit zoomOutClicked(); 62 | } 63 | 64 | void ZoomStrip::paintEvent(QPaintEvent *event) 65 | { 66 | int w = width(); 67 | int s = (w - zoomInPixmap.width()) / 2; 68 | 69 | QPainter p(this); 70 | p.fillRect(event->rect(), QColor(128, 128, 128, 128)); 71 | p.drawPixmap(s, s, zoomInPixmap); 72 | p.drawPixmap(s, s + w, zoomOutPixmap); 73 | p.end(); 74 | } 75 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/addbookmarkdialog.ui: -------------------------------------------------------------------------------- 1 | 2 | AddBookmarkDialog 3 | 4 | 5 | 6 | 0 7 | 0 8 | 240 9 | 168 10 | 11 | 12 | 13 | Add Bookmark 14 | 15 | 16 | 17 | 18 | 19 | Type a name for the bookmark, and choose where to keep it. 20 | 21 | 22 | Qt::PlainText 23 | 24 | 25 | true 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | Qt::Vertical 39 | 40 | 41 | 42 | 20 43 | 2 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | Qt::Horizontal 52 | 53 | 54 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 55 | 56 | 57 | false 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | buttonBox 67 | accepted() 68 | AddBookmarkDialog 69 | accept() 70 | 71 | 72 | 248 73 | 254 74 | 75 | 76 | 157 77 | 274 78 | 79 | 80 | 81 | 82 | buttonBox 83 | rejected() 84 | AddBookmarkDialog 85 | reject() 86 | 87 | 88 | 316 89 | 260 90 | 91 | 92 | 286 93 | 274 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /doc/src/qtwebkit-examples.qdoc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the documentation of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:FDL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Free Documentation License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Free 19 | ** Documentation License version 1.3 as published by the Free Software 20 | ** Foundation and appearing in the file included in the packaging of 21 | ** this file. Please review the following information to ensure 22 | ** the GNU Free Documentation License version 1.3 requirements 23 | ** will be met: http://www.gnu.org/copyleft/fdl.html. 24 | ** $QT_END_LICENSE$ 25 | ** 26 | ****************************************************************************/ 27 | 28 | /*! 29 | \page qtwebkitexamples-index.html 30 | \title Qt WebKit Examples 31 | \brief Provides examples demonstrating the WebKit features 32 | 33 | Qt WebKit Examples provide QML-based examples that demonstrate the WebKit2 34 | features, and also QWidget-based examples that demonstrate the Webkit1 35 | features. 36 | 37 | \section1 WebKit2 Examples 38 | \annotatedlist webkit-qmlexamples 39 | 40 | \section1 WebKit1 Examples 41 | \annotatedlist webkit-widgetexamples 42 | 43 | \sa {Qt WebKit} 44 | */ 45 | 46 | /*! 47 | \group webkit-widgetexamples 48 | \title Qt WebKit Widgets Examples 49 | \brief Examples demonstrating the webkit widgets usage 50 | \ingroup all-examples 51 | 52 | \image webkit-examples.png WebKit 53 | 54 | Qt provides an integrated Web browser component based on WebKit, the popular 55 | open source browser engine. 56 | 57 | These examples and demonstrations show a range of different uses for WebKit, 58 | from displaying Web pages within a Qt user interface to an implementation of 59 | a basic function Web browser. 60 | */ 61 | 62 | /*! 63 | \group webkit-qmlexamples 64 | \title Qt WebKit Examples List 65 | \brief QML examples demonstrating Webkit features 66 | \ingroup all-examples 67 | 68 | These examples demonstrate how to embed a WebView within a Qt Quick 69 | application. 70 | */ 71 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/chasewidget.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the demonstration applications of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef CHASEWIDGET_H 35 | #define CHASEWIDGET_H 36 | 37 | #include 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | QT_BEGIN_NAMESPACE 44 | class QHideEvent; 45 | class QShowEvent; 46 | class QPaintEvent; 47 | class QTimerEvent; 48 | QT_END_NAMESPACE 49 | 50 | class ChaseWidget : public QWidget 51 | { 52 | Q_OBJECT 53 | public: 54 | ChaseWidget(QWidget *parent = 0, QPixmap pixmap = QPixmap(), bool pixmapEnabled = false); 55 | 56 | void setAnimated(bool value); 57 | void setPixmapEnabled(bool enable); 58 | QSize sizeHint() const; 59 | 60 | protected: 61 | void paintEvent(QPaintEvent *event); 62 | void timerEvent(QTimerEvent *event); 63 | 64 | private: 65 | int segmentCount() const; 66 | QColor colorForSegment(int segment) const; 67 | 68 | int m_segment; 69 | int m_delay; 70 | int m_step; 71 | int m_timerId; 72 | bool m_animated; 73 | QPixmap m_pixmap; 74 | bool m_pixmapEnabled; 75 | }; 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/anomaly/src/webview.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #include "webview.h" 35 | 36 | #include 37 | #include 38 | 39 | WebView::WebView(QWidget *parent) 40 | : QWebView(parent) 41 | , inLoading(false) 42 | { 43 | connect(this, SIGNAL(loadStarted()), this, SLOT(newPageLoading())); 44 | connect(this, SIGNAL(loadFinished(bool)), this, SLOT(pageLoaded(bool))); 45 | page()->setPreferredContentsSize(QSize(1024, 768)); 46 | } 47 | 48 | void WebView::paintEvent(QPaintEvent *event) 49 | { 50 | if (inLoading && loadingTime.elapsed() < 750) { 51 | QPainter painter(this); 52 | painter.setBrush(Qt::white); 53 | painter.setPen(Qt::NoPen); 54 | foreach (const QRect &rect, event->region().rects()) { 55 | painter.drawRect(rect); 56 | } 57 | } else { 58 | QWebView::paintEvent(event); 59 | } 60 | } 61 | 62 | void WebView::newPageLoading() 63 | { 64 | inLoading = true; 65 | loadingTime.start(); 66 | } 67 | 68 | void WebView::pageLoaded(bool) 69 | { 70 | inLoading = false; 71 | update(); 72 | } 73 | -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/anomaly/src/BrowserWindow.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef BROWSERWINDOW_H 35 | #define BROWSERWINDOW_H 36 | 37 | #include 38 | 39 | QT_BEGIN_NAMESPACE 40 | class QPropertyAnimation; 41 | class QUrl; 42 | QT_END_NAMESPACE 43 | 44 | class BrowserView; 45 | class HomeView; 46 | 47 | class BrowserWindow : public QWidget 48 | { 49 | Q_OBJECT 50 | Q_PROPERTY(qreal slideValue READ slideValue WRITE setSlideValue) 51 | 52 | public: 53 | BrowserWindow(); 54 | 55 | private slots: 56 | void navigate(const QUrl &url); 57 | void gotoAddress(const QString &address); 58 | void animationFinished(); 59 | 60 | public slots: 61 | void showBrowserView(); 62 | void showHomeView(); 63 | 64 | protected: 65 | void keyReleaseEvent(QKeyEvent *event); 66 | void resizeEvent(QResizeEvent *event); 67 | 68 | private: 69 | void setSlideValue(qreal); 70 | qreal slideValue() const; 71 | 72 | QWidget *m_slidingSurface; 73 | HomeView *m_homeView; 74 | BrowserView *m_browserView; 75 | QPropertyAnimation *m_animation; 76 | }; 77 | 78 | #endif // BROWSERWINDOW_H 79 | -------------------------------------------------------------------------------- /examples/webkitwidgets/formextractor/mainwindow.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | #ifndef MAINWINDOW_H 42 | #define MAINWINDOW_H 43 | 44 | #include 45 | #include "formextractor.h" 46 | 47 | QT_BEGIN_NAMESPACE 48 | class QAction; 49 | class QMenu; 50 | QT_END_NAMESPACE 51 | 52 | class MainWindow : public QMainWindow 53 | { 54 | Q_OBJECT 55 | 56 | public: 57 | MainWindow(); 58 | 59 | private slots: 60 | void about(); 61 | 62 | private: 63 | FormExtractor *centralWidget; 64 | QMenu *fileMenu; 65 | QMenu *helpMenu; 66 | QAction *exitAct; 67 | QAction *aboutAct; 68 | QAction *aboutQtAct; 69 | 70 | void createActions(); 71 | void createMenus(); 72 | }; 73 | 74 | #endif // MAINWINDOW_H 75 | -------------------------------------------------------------------------------- /examples/webkitqml/shared/LoadIndicator.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.0 42 | 43 | Rectangle { 44 | id: container 45 | 46 | property bool running: false 47 | property string imageSource: "qrc:/shared/images/busy.png" 48 | 49 | visible: running 50 | 51 | Image { 52 | id: image 53 | anchors.centerIn: parent 54 | source: container.imageSource 55 | ParallelAnimation { 56 | running: container.running 57 | NumberAnimation { target: image; property: "opacity"; from: 0.0; to: 1.0; duration: 200 } 58 | NumberAnimation { target: image; property: "rotation"; from: 0; to: 360; loops: Animation.Infinite; duration: 1200 } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/edittableview.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the demonstration applications of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #include "edittableview.h" 35 | #include 36 | 37 | EditTableView::EditTableView(QWidget *parent) 38 | : QTableView(parent) 39 | { 40 | } 41 | 42 | void EditTableView::keyPressEvent(QKeyEvent *event) 43 | { 44 | if ((event->key() == Qt::Key_Delete 45 | || event->key() == Qt::Key_Backspace) 46 | && model()) { 47 | removeOne(); 48 | } else { 49 | QAbstractItemView::keyPressEvent(event); 50 | } 51 | } 52 | 53 | void EditTableView::removeOne() 54 | { 55 | if (!model() || !selectionModel()) 56 | return; 57 | int row = currentIndex().row(); 58 | model()->removeRow(row, rootIndex()); 59 | QModelIndex idx = model()->index(row, 0, rootIndex()); 60 | if (!idx.isValid()) 61 | idx = model()->index(row - 1, 0, rootIndex()); 62 | selectionModel()->select(idx, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); 63 | } 64 | 65 | void EditTableView::removeAll() 66 | { 67 | if (model()) 68 | model()->removeRows(0, model()->rowCount(rootIndex()), rootIndex()); 69 | } 70 | 71 | -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/anomaly/src/BrowserView.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef BROWSERVIEW_H 35 | #define BROWSERVIEW_H 36 | 37 | #include 38 | #include 39 | 40 | QT_BEGIN_NAMESPACE 41 | class QUrl; 42 | QT_END_NAMESPACE 43 | 44 | class QWebView; 45 | class TitleBar; 46 | class ControlStrip; 47 | class WebView; 48 | class ZoomStrip; 49 | 50 | class BrowserView : public QWidget 51 | { 52 | Q_OBJECT 53 | 54 | public: 55 | BrowserView(QWidget *parent = 0); 56 | 57 | public slots: 58 | void navigate(const QUrl &url); 59 | void zoomIn(); 60 | void zoomOut(); 61 | 62 | private slots: 63 | void initialize(); 64 | void start(); 65 | void setProgress(int percent); 66 | void finish(bool); 67 | void updateTitleBar(); 68 | 69 | signals: 70 | void menuButtonClicked(); 71 | 72 | protected: 73 | void resizeEvent(QResizeEvent *event); 74 | 75 | private: 76 | TitleBar *m_titleBar; 77 | WebView *m_webView; 78 | ZoomStrip *m_zoomStrip; 79 | ControlStrip *m_controlStrip; 80 | int m_progress; 81 | int m_currentZoom; 82 | QVector m_zoomLevels; 83 | }; 84 | 85 | #endif // BROWSERVIEW_H 86 | 87 | -------------------------------------------------------------------------------- /examples/webkitwidgets/domtraversal/window.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | #ifndef WINDOW_H 42 | #define WINDOW_H 43 | 44 | #include 45 | #include 46 | #include 47 | 48 | QT_BEGIN_NAMESPACE 49 | class QTreeWidgetItem; 50 | QT_END_NAMESPACE 51 | 52 | //! [Window class definition] 53 | #include "ui_window.h" 54 | 55 | class Window : public QMainWindow, private Ui::Window 56 | { 57 | Q_OBJECT 58 | 59 | public: 60 | Window(QWidget *parent = 0); 61 | void setUrl(const QUrl &url); 62 | 63 | public slots: 64 | void on_webView_loadFinished(); 65 | 66 | private: 67 | void examineChildElements(const QWebElement &parentElement, 68 | QTreeWidgetItem *parentItem); 69 | }; 70 | //! [Window class definition] 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/networkaccessmanager.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the demonstration applications of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef NETWORKACCESSMANAGER_H 35 | #define NETWORKACCESSMANAGER_H 36 | 37 | #include 38 | #include 39 | 40 | class NetworkAccessManager : public QNetworkAccessManager 41 | { 42 | Q_OBJECT 43 | 44 | public: 45 | NetworkAccessManager(QObject *parent = 0); 46 | 47 | virtual QNetworkReply* createRequest ( Operation op, const QNetworkRequest & req, QIODevice * outgoingData = 0 ); 48 | 49 | private: 50 | QList sslTrustedHostList; 51 | qint64 requestFinishedCount; 52 | qint64 requestFinishedFromCacheCount; 53 | qint64 requestFinishedPipelinedCount; 54 | qint64 requestFinishedSecureCount; 55 | qint64 requestFinishedDownloadBufferCount; 56 | 57 | public slots: 58 | void loadSettings(); 59 | void requestFinished(QNetworkReply *reply); 60 | 61 | private slots: 62 | void authenticationRequired(QNetworkReply *reply, QAuthenticator *auth); 63 | void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *auth); 64 | #ifndef QT_NO_OPENSSL 65 | void sslErrors(QNetworkReply *reply, const QList &error); 66 | #endif 67 | }; 68 | 69 | #endif // NETWORKACCESSMANAGER_H 70 | -------------------------------------------------------------------------------- /examples/webkitwidgets/previewer/mainwindow.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | #ifndef MAINWINDOW_H 42 | #define MAINWINDOW_H 43 | 44 | #include 45 | #include "previewer.h" 46 | 47 | QT_BEGIN_NAMESPACE 48 | class QAction; 49 | class QMenu; 50 | QT_END_NAMESPACE 51 | 52 | //! [0] 53 | class MainWindow : public QMainWindow 54 | { 55 | Q_OBJECT 56 | 57 | public: 58 | MainWindow(); 59 | 60 | private slots: 61 | void open(); 62 | void openUrl(); 63 | void save(); 64 | void about(); 65 | void updateTextEdit(); 66 | //! [0] 67 | 68 | //! [1] 69 | private: 70 | Previewer *centralWidget; 71 | QMenu *fileMenu; 72 | QMenu *helpMenu; 73 | QAction *openAct; 74 | QAction *openUrlAct; 75 | QAction *saveAct; 76 | QAction *exitAct; 77 | QAction *aboutAct; 78 | QAction *aboutQtAct; 79 | 80 | void createActions(); 81 | void createMenus(); 82 | void setStartupText(); 83 | }; 84 | //! [1] 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /examples/webkitwidgets/xmlpatterns/qobjectxmlmodel/xmlsyntaxhighlighter.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | #ifndef XMLSYNTAXHIGHLIGHTER_H 42 | #define XMLSYNTAXHIGHLIGHTER_H 43 | 44 | #include 45 | 46 | class XmlSyntaxHighlighter : public QSyntaxHighlighter 47 | { 48 | public: 49 | XmlSyntaxHighlighter(QTextDocument *parent = 0); 50 | 51 | protected: 52 | virtual void highlightBlock(const QString &text); 53 | 54 | private: 55 | struct HighlightingRule 56 | { 57 | QRegExp pattern; 58 | QTextCharFormat format; 59 | }; 60 | QVector highlightingRules; 61 | 62 | QRegExp commentStartExpression; 63 | QRegExp commentEndExpression; 64 | 65 | QTextCharFormat tagFormat; 66 | QTextCharFormat attributeFormat; 67 | QTextCharFormat attributeContentFormat; 68 | QTextCharFormat commentFormat; 69 | }; 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /examples/webkitwidgets/fancybrowser/mainwindow.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | #include 42 | 43 | class QWebView; 44 | QT_BEGIN_NAMESPACE 45 | class QLineEdit; 46 | QT_END_NAMESPACE 47 | 48 | //! [1] 49 | class MainWindow : public QMainWindow 50 | { 51 | Q_OBJECT 52 | 53 | public: 54 | MainWindow(const QUrl& url); 55 | 56 | protected slots: 57 | 58 | void adjustLocation(); 59 | void changeLocation(); 60 | void adjustTitle(); 61 | void setProgress(int p); 62 | void finishLoading(bool); 63 | 64 | void viewSource(); 65 | void slotSourceDownloaded(); 66 | 67 | void highlightAllLinks(); 68 | void rotateImages(bool invert); 69 | void removeGifImages(); 70 | void removeInlineFrames(); 71 | void removeObjectElements(); 72 | void removeEmbeddedElements(); 73 | 74 | private: 75 | QString jQuery; 76 | QWebView *view; 77 | QLineEdit *locationEdit; 78 | QAction *rotateAction; 79 | int progress; 80 | //! [1] 81 | }; 82 | -------------------------------------------------------------------------------- /examples/webkitwidgets/previewer/previewer.ui: -------------------------------------------------------------------------------- 1 | 2 | Form 3 | 4 | 5 | 6 | 0 7 | 0 8 | 911 9 | 688 10 | 11 | 12 | 13 | Form 14 | 15 | 16 | 17 | 18 | 19 | Qt::Horizontal 20 | 21 | 22 | 23 | HTML Editor 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | Clear 37 | 38 | 39 | 40 | 41 | 42 | 43 | Preview 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | HTML Preview 56 | 57 | 58 | 59 | 60 | 61 | 62 | about:blank 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | QWebView 76 | QWidget 77 |
QtWebKit/QWebView
78 |
79 |
80 | 81 | 82 | 83 | clearButton 84 | clicked() 85 | plainTextEdit 86 | clear() 87 | 88 | 89 | 56 90 | 653 91 | 92 | 93 | 98 94 | 551 95 | 96 | 97 | 98 | 99 |
100 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/autosaver.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the demonstration applications of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #include "autosaver.h" 35 | 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | #define AUTOSAVE_IN 1000 * 3 // seconds 42 | #define MAXWAIT 1000 * 15 // seconds 43 | 44 | AutoSaver::AutoSaver(QObject *parent) : QObject(parent) 45 | { 46 | Q_ASSERT(parent); 47 | } 48 | 49 | AutoSaver::~AutoSaver() 50 | { 51 | if (m_timer.isActive()) 52 | qWarning() << "AutoSaver: still active when destroyed, changes not saved."; 53 | } 54 | 55 | void AutoSaver::changeOccurred() 56 | { 57 | if (m_firstChange.isNull()) 58 | m_firstChange.start(); 59 | 60 | if (m_firstChange.elapsed() > MAXWAIT) { 61 | saveIfNeccessary(); 62 | } else { 63 | m_timer.start(AUTOSAVE_IN, this); 64 | } 65 | } 66 | 67 | void AutoSaver::timerEvent(QTimerEvent *event) 68 | { 69 | if (event->timerId() == m_timer.timerId()) { 70 | saveIfNeccessary(); 71 | } else { 72 | QObject::timerEvent(event); 73 | } 74 | } 75 | 76 | void AutoSaver::saveIfNeccessary() 77 | { 78 | if (!m_timer.isActive()) 79 | return; 80 | m_timer.stop(); 81 | m_firstChange = QTime(); 82 | if (!QMetaObject::invokeMethod(parent(), "save", Qt::DirectConnection)) { 83 | qWarning() << "AutoSaver: error invoking slot save() on parent"; 84 | } 85 | } 86 | 87 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/cookies.ui: -------------------------------------------------------------------------------- 1 | 2 | CookiesDialog 3 | 4 | 5 | 6 | 0 7 | 0 8 | 550 9 | 370 10 | 11 | 12 | 13 | Cookies 14 | 15 | 16 | 17 | 18 | 19 | Qt::Horizontal 20 | 21 | 22 | 23 | 252 24 | 20 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | &Remove 41 | 42 | 43 | 44 | 45 | 46 | 47 | Remove &All Cookies 48 | 49 | 50 | 51 | 52 | 53 | 54 | Qt::Horizontal 55 | 56 | 57 | 58 | 40 59 | 20 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | QDialogButtonBox::Ok 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | SearchLineEdit 78 | QLineEdit 79 |
searchlineedit.h
80 |
81 | 82 | EditTableView 83 | QTableView 84 |
edittableview.h
85 |
86 |
87 | 88 | 89 | 90 | buttonBox 91 | accepted() 92 | CookiesDialog 93 | accept() 94 | 95 | 96 | 472 97 | 329 98 | 99 | 100 | 461 101 | 356 102 | 103 | 104 | 105 | 106 |
107 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/history.ui: -------------------------------------------------------------------------------- 1 | 2 | HistoryDialog 3 | 4 | 5 | 6 | 0 7 | 0 8 | 758 9 | 450 10 | 11 | 12 | 13 | History 14 | 15 | 16 | 17 | 18 | 19 | Qt::Horizontal 20 | 21 | 22 | 23 | 252 24 | 20 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | &Remove 41 | 42 | 43 | 44 | 45 | 46 | 47 | Remove &All 48 | 49 | 50 | 51 | 52 | 53 | 54 | Qt::Horizontal 55 | 56 | 57 | 58 | 40 59 | 20 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | QDialogButtonBox::Ok 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | SearchLineEdit 78 | QLineEdit 79 |
searchlineedit.h
80 |
81 | 82 | EditTreeView 83 | QTreeView 84 |
edittreeview.h
85 |
86 |
87 | 88 | 89 | 90 | buttonBox 91 | accepted() 92 | HistoryDialog 93 | accept() 94 | 95 | 96 | 472 97 | 329 98 | 99 | 100 | 461 101 | 356 102 | 103 | 104 | 105 | 106 |
107 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/bookmarks.ui: -------------------------------------------------------------------------------- 1 | 2 | BookmarksDialog 3 | 4 | 5 | 6 | 0 7 | 0 8 | 758 9 | 450 10 | 11 | 12 | 13 | Bookmarks 14 | 15 | 16 | 17 | 18 | 19 | Qt::Horizontal 20 | 21 | 22 | 23 | 252 24 | 20 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | &Remove 41 | 42 | 43 | 44 | 45 | 46 | 47 | Add Folder 48 | 49 | 50 | 51 | 52 | 53 | 54 | Qt::Horizontal 55 | 56 | 57 | 58 | 40 59 | 20 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | QDialogButtonBox::Ok 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | SearchLineEdit 78 | QLineEdit 79 |
searchlineedit.h
80 |
81 | 82 | EditTreeView 83 | QTreeView 84 |
edittreeview.h
85 |
86 |
87 | 88 | 89 | 90 | buttonBox 91 | accepted() 92 | BookmarksDialog 93 | accept() 94 | 95 | 96 | 472 97 | 329 98 | 99 | 100 | 461 101 | 356 102 | 103 | 104 | 105 | 106 |
107 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/proxy.ui: -------------------------------------------------------------------------------- 1 | 2 | ProxyDialog 3 | 4 | 5 | 6 | 0 7 | 0 8 | 369 9 | 144 10 | 11 | 12 | 13 | Proxy Authentication 14 | 15 | 16 | 17 | 18 | 19 | ICON 20 | 21 | 22 | 23 | 24 | 25 | 26 | Connect to proxy 27 | 28 | 29 | true 30 | 31 | 32 | 33 | 34 | 35 | 36 | Username: 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | Password: 47 | 48 | 49 | 50 | 51 | 52 | 53 | QLineEdit::Password 54 | 55 | 56 | 57 | 58 | 59 | 60 | Qt::Horizontal 61 | 62 | 63 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | buttonBox 73 | accepted() 74 | ProxyDialog 75 | accept() 76 | 77 | 78 | 248 79 | 254 80 | 81 | 82 | 157 83 | 274 84 | 85 | 86 | 87 | 88 | buttonBox 89 | rejected() 90 | ProxyDialog 91 | reject() 92 | 93 | 94 | 316 95 | 260 96 | 97 | 98 | 286 99 | 274 100 | 101 | 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /examples/webkitwidgets/scroller/plot/plotwidget.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | #ifndef PLOTWIDGET_H 42 | #define PLOTWIDGET_H 43 | 44 | #include 45 | #include 46 | 47 | QT_BEGIN_NAMESPACE 48 | class QPushButton; 49 | class QLabel; 50 | class QScroller; 51 | QT_END_NAMESPACE 52 | 53 | class PlotWidget : public QWidget 54 | { 55 | Q_OBJECT 56 | 57 | public: 58 | PlotWidget(bool smallscreen = false); 59 | 60 | void setScroller(QWidget *widget); 61 | 62 | public slots: 63 | void reset(); 64 | 65 | protected: 66 | void resizeEvent(QResizeEvent *); 67 | void paintEvent(QPaintEvent *); 68 | 69 | bool eventFilter(QObject *obj, QEvent *ev); 70 | 71 | private: 72 | 73 | struct PlotItem { 74 | QPointF velocity; 75 | QPointF contentPosition; 76 | QPointF overshootPosition; 77 | }; 78 | 79 | void addPlotItem(const PlotItem &pi); 80 | 81 | QWidget *m_widget; 82 | QList m_plotitems; 83 | qreal minMaxVelocity, minMaxPosition; 84 | QPushButton *m_clear; 85 | QLabel *m_legend; 86 | }; 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /examples/webkitwidgets/browser/searchlineedit.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the demonstration applications of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #ifndef SEARCHLINEEDIT_H 35 | #define SEARCHLINEEDIT_H 36 | 37 | #include "urllineedit.h" 38 | 39 | #include 40 | #include 41 | 42 | QT_BEGIN_NAMESPACE 43 | class QMenu; 44 | QT_END_NAMESPACE 45 | 46 | class SearchButton; 47 | 48 | /* 49 | Clear button on the right hand side of the search widget. 50 | Hidden by default 51 | "A circle with an X in it" 52 | */ 53 | class ClearButton : public QAbstractButton 54 | { 55 | Q_OBJECT 56 | 57 | public: 58 | ClearButton(QWidget *parent = 0); 59 | void paintEvent(QPaintEvent *event); 60 | 61 | public slots: 62 | void textChanged(const QString &text); 63 | }; 64 | 65 | 66 | class SearchLineEdit : public ExLineEdit 67 | { 68 | Q_OBJECT 69 | Q_PROPERTY(QString inactiveText READ inactiveText WRITE setInactiveText) 70 | 71 | signals: 72 | void textChanged(const QString &text); 73 | 74 | public: 75 | SearchLineEdit(QWidget *parent = 0); 76 | 77 | QString inactiveText() const; 78 | void setInactiveText(const QString &text); 79 | 80 | QMenu *menu() const; 81 | void setMenu(QMenu *menu); 82 | 83 | protected: 84 | void resizeEvent(QResizeEvent *event); 85 | void paintEvent(QPaintEvent *event); 86 | 87 | private: 88 | void updateGeometries(); 89 | 90 | SearchButton *m_searchButton; 91 | QString m_inactiveText; 92 | }; 93 | 94 | #endif // SEARCHLINEEDIT_H 95 | 96 | -------------------------------------------------------------------------------- /examples/webkitwidgets/embedded/anomaly/src/AddressBar.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL21$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 or version 3 as published by the Free 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 | ** following information to ensure the GNU Lesser General Public License 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ** 26 | ** As a special exception, The Qt Company gives you certain additional 27 | ** rights. These rights are described in The Qt Company LGPL Exception 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ** 30 | ** $QT_END_LICENSE$ 31 | ** 32 | ****************************************************************************/ 33 | 34 | #include "AddressBar.h" 35 | 36 | #include 37 | #include 38 | 39 | AddressBar::AddressBar(QWidget *parent) 40 | : QWidget(parent) 41 | { 42 | m_lineEdit = new QLineEdit(parent); 43 | m_lineEdit->setPlaceholderText("Enter address or search terms"); 44 | connect(m_lineEdit, SIGNAL(returnPressed()), SLOT(processAddress())); 45 | m_toolButton = new QToolButton(parent); 46 | m_toolButton->setText("Go"); 47 | connect(m_toolButton, SIGNAL(clicked()), SLOT(processAddress())); 48 | } 49 | 50 | QSize AddressBar::sizeHint() const 51 | { 52 | return m_lineEdit->sizeHint(); 53 | } 54 | 55 | void AddressBar::processAddress() 56 | { 57 | if (!m_lineEdit->text().isEmpty()) 58 | emit addressEntered(m_lineEdit->text()); 59 | } 60 | 61 | void AddressBar::resizeEvent(QResizeEvent *event) 62 | { 63 | int x, y, w, h; 64 | 65 | m_toolButton->adjustSize(); 66 | x = width() - m_toolButton->width(); 67 | y = 0; 68 | w = m_toolButton->width(); 69 | h = height() - 1; 70 | m_toolButton->setGeometry(x, y, w, h); 71 | m_toolButton->show(); 72 | 73 | x = 0; 74 | y = 0; 75 | w = width() - m_toolButton->width(); 76 | h = height() - 1; 77 | m_lineEdit->setGeometry(x, y, w, h); 78 | m_lineEdit->show(); 79 | } 80 | 81 | void AddressBar::focusInEvent(QFocusEvent *event) 82 | { 83 | m_lineEdit->setFocus(); 84 | QWidget::focusInEvent(event); 85 | } 86 | -------------------------------------------------------------------------------- /examples/webkitwidgets/simpleselector/window.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of The Qt Company Ltd nor the names of its 21 | ** contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | #include 42 | #include 43 | #include "window.h" 44 | 45 | //! [Window class constructor] 46 | Window::Window(QWidget *parent) 47 | : QWidget(parent) 48 | { 49 | setupUi(this); 50 | } 51 | //! [Window class constructor] 52 | 53 | //! [return pressed] 54 | void Window::on_elementLineEdit_returnPressed() 55 | { 56 | QWebFrame *frame = webView->page()->mainFrame(); 57 | 58 | //! [select elements] 59 | QWebElement document = frame->documentElement(); 60 | QWebElementCollection elements = document.findAll(elementLineEdit->text()); 61 | //! [select elements] 62 | 63 | foreach (QWebElement element, elements) 64 | element.setAttribute("style", "background-color: #f0f090"); 65 | } 66 | //! [return pressed] 67 | 68 | //! [button clicked] 69 | void Window::on_highlightButton_clicked() 70 | { 71 | on_elementLineEdit_returnPressed(); 72 | } 73 | //! [button clicked] 74 | 75 | //! [set URL] 76 | void Window::setUrl(const QUrl &url) 77 | { 78 | webView->setUrl(url); 79 | } 80 | //! [set URL] 81 | -------------------------------------------------------------------------------- /examples/webkitqml/youtubeview/doc/src/youtubeview.qdoc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the documentation of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:FDL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see http://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at http://www.qt.io/contact-us. 16 | ** 17 | ** GNU Free Documentation License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Free 19 | ** Documentation License version 1.3 as published by the Free Software 20 | ** Foundation and appearing in the file included in the packaging of 21 | ** this file. Please review the following information to ensure 22 | ** the GNU Free Documentation License version 1.3 requirements 23 | ** will be met: http://www.gnu.org/copyleft/fdl.html. 24 | ** $QT_END_LICENSE$ 25 | ** 26 | ****************************************************************************/ 27 | 28 | /*! 29 | \example webkitqml/youtubeview 30 | \title YouTube View Example 31 | \brief Demonstrates how to embed a web view in a Qt Quick application 32 | \ingroup webkit-qmlexamples 33 | 34 | The YouTube View \l{Qt QML}{QML} example uses a \l{WebView} to play 35 | \l{http://www.youtube.com/html5}{HTML5 video clips from YouTube}. 36 | 37 | \image youtubeview-example.png 38 | 39 | The application makes use of an \l{XmlListModel} to query the \l{https://developers.google.com/youtube}{YouTube API} 40 | for HTML5 video clips and lists thumbnails of the clips in a \l{ListView} at the top. The \l{WebView} loads a local \c player.html file that 41 | embeds a YouTube HTML5 video player using the \l{https://developers.google.com/youtube/iframe_api_reference}{IFrame player API}, 42 | which allows to control the YouTube player using JavaScript. 43 | 44 | When clicking on a thumbnail, the corresponding clip is loaded in the WebView by passing the video ID as a query string to \c player.html. 45 | When the video is started, the thumbnail list is hidden with an animated fade-out, when the video is stopped the list is showed again. 46 | The specific states of the player change the title of the WebView using \e{document.title} in JavaScript. The application 47 | is acting on these title changes in the \c{onTitleChanged} slot of the WebView item and thus switches between specific states. 48 | By default the application loads a list of movie trailers. 49 | 50 | When clicking on the button below the thumbnail list, the application switches to search mode, which allows to search for videos 51 | using keywords. Additionally it is also possible to choose from a number of preset movie trailer streams. 52 | 53 | \image youtubeview-example-preset.png 54 | 55 | This example uses the QtWebKit QML API that utilizes the WebKit2 split-process architecture. 56 | */ 57 | --------------------------------------------------------------------------------