summaryrefslogtreecommitdiffstats
path: root/examples/webkit
diff options
context:
space:
mode:
Diffstat (limited to 'examples/webkit')
-rw-r--r--examples/webkit/fancybrowser/main.cpp4
-rw-r--r--examples/webkit/fancybrowser/mainwindow.cpp5
-rw-r--r--examples/webkit/fancybrowser/mainwindow.h4
-rwxr-xr-xexamples/webkit/formextractor/form.html24
-rw-r--r--examples/webkit/formextractor/formextractor.cpp33
-rw-r--r--examples/webkit/formextractor/formextractor.h8
-rw-r--r--examples/webkit/formextractor/main.cpp4
-rw-r--r--examples/webkit/formextractor/mainwindow.cpp5
-rw-r--r--examples/webkit/formextractor/mainwindow.h4
-rw-r--r--examples/webkit/googlechat/googlechat.cpp4
-rw-r--r--examples/webkit/googlechat/googlechat.h4
-rw-r--r--examples/webkit/googlechat/main.cpp4
-rw-r--r--examples/webkit/previewer/main.cpp4
-rw-r--r--examples/webkit/previewer/mainwindow.cpp4
-rw-r--r--examples/webkit/previewer/mainwindow.h4
-rw-r--r--examples/webkit/previewer/previewer.cpp4
-rw-r--r--examples/webkit/previewer/previewer.h4
17 files changed, 59 insertions, 64 deletions
diff --git a/examples/webkit/fancybrowser/main.cpp b/examples/webkit/fancybrowser/main.cpp
index 5936469..fafbbb2 100644
--- a/examples/webkit/fancybrowser/main.cpp
+++ b/examples/webkit/fancybrowser/main.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/examples/webkit/fancybrowser/mainwindow.cpp b/examples/webkit/fancybrowser/mainwindow.cpp
index e24f6cf..6d477db 100644
--- a/examples/webkit/fancybrowser/mainwindow.cpp
+++ b/examples/webkit/fancybrowser/mainwindow.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -94,6 +94,7 @@ MainWindow::MainWindow()
toolsMenu->addAction(tr("Remove all embedded elements"), this, SLOT(removeEmbeddedElements()));
setCentralWidget(view);
+ setUnifiedTitleAndToolBarOnMac(true);
}
//! [3]
diff --git a/examples/webkit/fancybrowser/mainwindow.h b/examples/webkit/fancybrowser/mainwindow.h
index ba0bede..ecd2308 100644
--- a/examples/webkit/fancybrowser/mainwindow.h
+++ b/examples/webkit/fancybrowser/mainwindow.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/examples/webkit/formextractor/form.html b/examples/webkit/formextractor/form.html
index 18ddff1..6b0bbde 100755
--- a/examples/webkit/formextractor/form.html
+++ b/examples/webkit/formextractor/form.html
@@ -1,22 +1,4 @@
-<html><script>
-function extractFormValues()
-{
- var firstName = document.getElementById("firstname").value;
- var lastName = document.getElementById("lastname").value;
- var maleGender = document.getElementById("genderMale");
- var femaleGender = document.getElementById("genderFemale");
-
- var gender = "";
- if (maleGender.checked)
- gender = maleGender.value;
- else if (femaleGender.checked)
- gender = femaleGender.value;
-
- var updates = document.getElementById("updates").checked;
-
- formExtractor.setValues(firstName, lastName, gender, updates);
-}
-</script><body>
+<html><body>
<h1>
The Green People Book Club
</h1>
@@ -24,7 +6,7 @@ The Green People Book Club
<p>
Welcome to The Green People Book Club. Please register to obtain a membership with us.
</p>
- <form onsubmit="extractFormValues()">
+ <form onsubmit="formExtractor.submit()">
<table>
<tbody><tr>
<td>
@@ -61,4 +43,4 @@ Welcome to The Green People Book Club. Please register to obtain a membership wi
<input type="submit" value="Submit">
</form>
-</body></html> \ No newline at end of file
+</body></html>
diff --git a/examples/webkit/formextractor/formextractor.cpp b/examples/webkit/formextractor/formextractor.cpp
index d5ecc29..ead88b1 100644
--- a/examples/webkit/formextractor/formextractor.cpp
+++ b/examples/webkit/formextractor/formextractor.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
@@ -34,13 +34,15 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
#include "formextractor.h"
+#include <QWebElement>
+
FormExtractor::FormExtractor(QWidget *parent, Qt::WFlags flags)
: QWidget(parent, flags)
{
@@ -55,17 +57,28 @@ FormExtractor::~FormExtractor()
{
}
-void FormExtractor::setValues(const QString &firstName, const QString &lastName,
- const QString &gender, bool updates)
+void FormExtractor::submit()
{
- ui.firstNameEdit->setText(firstName);
- ui.lastNameEdit->setText(lastName);
- ui.genderEdit->setText(gender);
+ QWebFrame *frame = ui.webView->page()->mainFrame();
- if (updates == false)
- ui.updatesEdit->setText("No");
- else
+ QWebElement firstName = frame->findFirstElement("#firstname");
+ QWebElement lastName = frame->findFirstElement("#lastname");
+ QWebElement maleGender = frame->findFirstElement("#genderMale");
+ QWebElement femaleGender = frame->findFirstElement("#genderFemale");
+ QWebElement updates = frame->findFirstElement("#updates");
+
+ ui.firstNameEdit->setText(firstName.scriptableProperty("value").toString());
+ ui.lastNameEdit->setText(lastName.scriptableProperty("value").toString());
+
+ if (maleGender.scriptableProperty("checked").toBool())
+ ui.genderEdit->setText(maleGender.scriptableProperty("value").toString());
+ else if (femaleGender.scriptableProperty("checked").toBool())
+ ui.genderEdit->setText(femaleGender.scriptableProperty("value").toString());
+
+ if (updates.scriptableProperty("checked").toBool())
ui.updatesEdit->setText("Yes");
+ else
+ ui.updatesEdit->setText("No");
}
void FormExtractor::populateJavaScriptWindowObject()
diff --git a/examples/webkit/formextractor/formextractor.h b/examples/webkit/formextractor/formextractor.h
index 5b11565..58a54b7 100644
--- a/examples/webkit/formextractor/formextractor.h
+++ b/examples/webkit/formextractor/formextractor.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -55,9 +55,7 @@ public:
~FormExtractor();
public slots:
- void setValues(const QString &firstName, const QString &lastName,
- const QString &gender, bool updates);
-
+ void submit();
void populateJavaScriptWindowObject();
private:
diff --git a/examples/webkit/formextractor/main.cpp b/examples/webkit/formextractor/main.cpp
index aa7847d..792386d 100644
--- a/examples/webkit/formextractor/main.cpp
+++ b/examples/webkit/formextractor/main.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/examples/webkit/formextractor/mainwindow.cpp b/examples/webkit/formextractor/mainwindow.cpp
index ec4d043..f774737 100644
--- a/examples/webkit/formextractor/mainwindow.cpp
+++ b/examples/webkit/formextractor/mainwindow.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -48,6 +48,7 @@ MainWindow::MainWindow()
createMenus();
centralWidget = new FormExtractor(this);
setCentralWidget(centralWidget);
+ setUnifiedTitleAndToolBarOnMac(true);
}
void MainWindow::createActions()
diff --git a/examples/webkit/formextractor/mainwindow.h b/examples/webkit/formextractor/mainwindow.h
index 7918870..9a6dcd7 100644
--- a/examples/webkit/formextractor/mainwindow.h
+++ b/examples/webkit/formextractor/mainwindow.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/examples/webkit/googlechat/googlechat.cpp b/examples/webkit/googlechat/googlechat.cpp
index 9ac2cd2..20bcc54 100644
--- a/examples/webkit/googlechat/googlechat.cpp
+++ b/examples/webkit/googlechat/googlechat.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/examples/webkit/googlechat/googlechat.h b/examples/webkit/googlechat/googlechat.h
index c92632c..2a1df08 100644
--- a/examples/webkit/googlechat/googlechat.h
+++ b/examples/webkit/googlechat/googlechat.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/examples/webkit/googlechat/main.cpp b/examples/webkit/googlechat/main.cpp
index 26feeea..c0265e5 100644
--- a/examples/webkit/googlechat/main.cpp
+++ b/examples/webkit/googlechat/main.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/examples/webkit/previewer/main.cpp b/examples/webkit/previewer/main.cpp
index 87612e2..de137ee 100644
--- a/examples/webkit/previewer/main.cpp
+++ b/examples/webkit/previewer/main.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/examples/webkit/previewer/mainwindow.cpp b/examples/webkit/previewer/mainwindow.cpp
index 1e20ed3..0bef996 100644
--- a/examples/webkit/previewer/mainwindow.cpp
+++ b/examples/webkit/previewer/mainwindow.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/examples/webkit/previewer/mainwindow.h b/examples/webkit/previewer/mainwindow.h
index 3a0a4b1..5ff6ced 100644
--- a/examples/webkit/previewer/mainwindow.h
+++ b/examples/webkit/previewer/mainwindow.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/examples/webkit/previewer/previewer.cpp b/examples/webkit/previewer/previewer.cpp
index 51419d7..f3aa9ce 100644
--- a/examples/webkit/previewer/previewer.cpp
+++ b/examples/webkit/previewer/previewer.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/examples/webkit/previewer/previewer.h b/examples/webkit/previewer/previewer.h
index ae70f9f..2fa8722 100644
--- a/examples/webkit/previewer/previewer.h
+++ b/examples/webkit/previewer/previewer.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/