Hi!
I am trying to run a test application that uses QWebView for asking a text entry.
I am able to type any characters in the text entry on the N900, but special character like "@" (character 2 is appearing instead) just doesn't appears in the Fremantle SDK on my desktop.
I am using Qt4.6 for Maemo5
Here is the code
qwebview.pro:
qwebview.qrc:Code:TEMPLATE = app TARGET = qwebview DEPENDPATH += . INCLUDEPATH += . CONFIG += qt debug QT += network webkit HEADERS += qwet.h SOURCES += main.cpp qwet.cpp RESOURCES += qwebview.qrc
Code:<RCC> <qresource prefix="/"> <file>html/view.html</file> <file>css/view.css</file> </qresource> </RCC>qwet.cpp:Code:#ifndef QWET_H #define QWET_H #include <QtCore/QPointer> #include <QtWebKit/QWebView> #include <QtWebKit/QWebPage> #include <QtWebKit/QWebFrame> #include <QtGui/QWidget> #include <QtGui/QApplication> #include <QtGui/QMainWindow> #include <QtGui/QFrame> #include <QtGui/QVBoxLayout> class QWET : public QMainWindow { Q_OBJECT public: QWET(QWidget *parent = 0); private: QPointer<QWebView> _webView; QPointer<QVBoxLayout> _layout; }; #endif // QWET_H
css/view.css:Code:#include "qwet.h" QWET::QWET(QWidget *parent) : QMainWindow(parent) { QFrame* cW = new QFrame(this); setCentralWidget(cW); _layout = new QVBoxLayout(this); cW->setLayout(_layout); _layout->setMargin(0); _layout->setSpacing(0); _webView = new QWebView(this); _webView->load(QUrl("qrc:///html/view.html")); _webView->show(); _layout->addWidget(_webView); }
Code:@CHARSET "UTF-8"; html { background-color: lightgray; margin: 1em 0 0 1em; padding: 0; } body { margin: 0; padding: 0; } h1#header { color: black; margin: 0; padding: 0; } p { color: black; margin: 0 0 0 5pt; padding: 0; } form#form { color: black; margin: 0 0 0 5pt; padding: 0; } fieldset { border: 0; }
Do I have to set something in my Scratchbox target, the in Hildon desktop, or I have to set some QWebView settings ?Code:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <!-- You reference the resources with qrc:// --> <!-- Stylesheet reference --> <link rel="stylesheet" href="qrc:///css/view.css" /> <title>WebKit example</title> </head> <body> <!-- Header --> <h1 id="header">Welcome</h1> <!-- Paragraph --> <p id="paragraph">Hello World!</p> <!-- Form --> <form id="form" action="#"> <fieldset> <label for="text">Text</label> <!-- Text input --> <input id="text" type="text" /> <!-- Submit button --> <input id="button" type="button" value="Submit!"/> </fieldset> </form> </body> </html>
Thanks

Reply With Quote

