diff options
Diffstat (limited to 'src/webenginewidgets/doc/snippets')
3 files changed, 0 insertions, 165 deletions
diff --git a/src/webenginewidgets/doc/snippets/qtwebengine_qwebengineinspector_snippet.cpp b/src/webenginewidgets/doc/snippets/qtwebengine_qwebengineinspector_snippet.cpp deleted file mode 100644 index 5e57de027..000000000 --- a/src/webenginewidgets/doc/snippets/qtwebengine_qwebengineinspector_snippet.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -void wrapInFunction() -{ - -//! [0] - // ... - QWebPage *page = new QWebPage; - // ... - - QWebInspector *inspector = new QWebInspector; - inspector->setPage(page); -//! [0] - -} - diff --git a/src/webenginewidgets/doc/snippets/webelement/main.cpp b/src/webenginewidgets/doc/snippets/webelement/main.cpp deleted file mode 100644 index b1781a6f4..000000000 --- a/src/webenginewidgets/doc/snippets/webelement/main.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/* - Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include <QApplication> -#include <QUrl> -#include <qwebview.h> -#include <qwebframe.h> -#include <qwebelement.h> - -static QWebFrame *frame; - -static void traverse() -{ -//! [Traversing with QWebElement] - frame->setHtml("<html><body><p>First Paragraph</p><p>Second Paragraph</p></body></html>"); - QWebElement doc = frame->documentElement(); - QWebElement body = doc.firstChild(); - QWebElement firstParagraph = body.firstChild(); - QWebElement secondParagraph = firstParagraph.nextSibling(); -//! [Traversing with QWebElement] -} - -static void findButtonAndClick() -{ - - frame->setHtml("<form name=\"myform\" action=\"submit_form.asp\" method=\"get\">" - "<input type=\"text\" name=\"myfield\">" - "<input type=\"submit\" value=\"Submit\">" - "</form>"); - -//! [Calling a DOM element method] - - QWebElement document = frame->documentElement(); - /* Assume that the document has the following structure: - - <form name="myform" action="submit_form.asp" method="get"> - <input type="text" name="myfield"> - <input type="submit" value="Submit"> - </form> - - */ - - QWebElement button = document.findFirst("input[type=submit]"); - button.evaluateJavaScript("click()"); - -//! [Calling a DOM element method] - - } - -static void autocomplete1() -{ - QWebElement document = frame->documentElement(); - -//! [autocomplete1] - QWebElement firstTextInput = document.findFirst("input[type=text]"); - QString storedText = firstTextInput.attribute("value"); -//! [autocomplete1] - -} - - -static void autocomplete2() -{ - - QWebElement document = frame->documentElement(); - QString storedText = "text"; - -//! [autocomplete2] - QWebElement firstTextInput = document.findFirst("input[type=text]"); - textInput.setAttribute("value", storedText); -//! [autocomplete2] - -} - - -static void findAll() -{ -//! [FindAll] - QWebElement document = frame->documentElement(); - /* Assume the document has the following structure: - - <p class=intro> - <span>Intro</span> - <span>Snippets</span> - </p> - <p> - <span>Content</span> - <span>Here</span> - </p> - */ - -//! [FindAll intro] - QWebElementCollection allSpans = document.findAll("span"); - QWebElementCollection introSpans = document.findAll("p.intro span"); -//! [FindAll intro] //! [FindAll] -} - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - QWebView *view = new QWebView(0); - frame = view->page()->mainFrame(); - traverse(); - findAll(); - findButtonAndClick(); - autocomplete1(); - autocomplete2(); - return 0; -} diff --git a/src/webenginewidgets/doc/snippets/webelement/webelement.pro b/src/webenginewidgets/doc/snippets/webelement/webelement.pro deleted file mode 100644 index fbe701314..000000000 --- a/src/webenginewidgets/doc/snippets/webelement/webelement.pro +++ /dev/null @@ -1,2 +0,0 @@ -TEMPLATE = app -SOURCES = main.cpp |