×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jun 2008
    Location
    Poland
    Posts
    60

    QWebView - load page from memory

    Hi,

    I'd like to create at runtime a html page and show it in QWebView. But I don't want to store this html on the device. Unfortunetly I didn't find method to load html content from the memory (variable), only load page from http.
    Any idea?

  2. #2
    Registered User
    Join Date
    Jul 2008
    Posts
    8

    Re: QWebView - load page from memory

    Hi,

    i think you can use smt like:
    Code:
    page()->mainFrame()->load(QUrl("file:///c:/Data/webPage.html"));
    to load a web page, stored on your file system, into QWebView object(or rather into QWebFrame object).

    If you want to load a page created in runtime:
    Code:
    QString h=QString("<>html....<>");
    page()->mainFrame()->setHtml(h);
    Or even you can use qt resources system:
    Code:
    QResource res(":/index.html");
    QByteArray html((const char*)res.data(), res.size());
    QString h=QString(html);
    page()->mainFrame()->setHtml(h);
    It will load a page and set html contents as given in QString object. The only problem using resources system is i can not make working css styles sheets and java script functions from other files... It works only when page is loaded using load() method, using qt resources system i can see only html contents form setHtml() method, but no css or js sripts from other files are loaded.

    Does anyone can help us here and tell how can we use html, css and js data from qt resources system stored in separate files?

    Regards
    Pawel

Similar Threads

  1. How can i load a bitmap from the phone memory?
    By pierrick001 in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2009-06-04, 05:24
  2. memory allocation/fragmentation
    By victorh81 in forum Symbian
    Replies: 3
    Last Post: 2005-02-02, 14:48
  3. How do I load a file into memory?
    By aehrath in forum Symbian
    Replies: 3
    Last Post: 2003-07-28, 15:26
  4. Some memory related and other issues
    By sanjg2k1 in forum General Development Questions
    Replies: 0
    Last Post: 2003-07-07, 17:38
  5. Page caching memory in WAP 2.0 devices
    By semljire in forum Browsing and Mark-ups
    Replies: 1
    Last Post: 2003-02-19, 08:05

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×