Results 1 to 5 of 5

Thread: QWebView - browser example, 'alt' parameter on web page.

  1. #1
    Join Date
    Jul 2010
    Location
    Poland
    Posts
    184
    Thanks
    70
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default QWebView - browser example, 'alt' parameter on web page.

    Hello!

    I've downloaded "Fancybrowser" example from http://doc.qt.nokia.com/4.6/webkit-fancybrowser.html. It works just fine. But, can I use JavaScript or Flash with webkit? Do I need to turn it on/off somewhere?

    Why I can't see the 'alt' on images while I'm browsing web pages? For example:
    <area shape="rect" coords="0,0,10,100" href="javascript:void(null)" alt="alttext" title="alttext" />
    I can't see that.

    P.S. I can see 'alt' parameter on my PC but I'm using same browser on ARM, and on QT libs for ARM I can't see that.

    thanks in advance
    best regards
    Tomasz
    Last edited by Tomasz; 25th October 2010 at 12:47.

  2. #2
    Join Date
    Oct 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QWebView - browser example, 'alt' parameter on web page.

    You'll have to enable the usage of Plugins by invoking
    Qt Code:
    1. QWebPage::settings()->setAttribute(QWebSettings::PluginsEnabled, true);
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jul 2010
    Location
    Poland
    Posts
    184
    Thanks
    70
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QWebView - browser example, 'alt' parameter on web page.

    Qt Code:
    1. [...]/fancy_browser/mainwindow.cpp:63: error: cannot call member function ‘QWebSettings* QWebPage::settings() const’ without object
    To copy to clipboard, switch view to plain text mode 

    I've got only QWebView, so the code above doesn't work. Or maybe I'm doing something wrong.

    thanks in advance
    best regards
    Tomasz

  4. #4
    Join Date
    Oct 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QWebView - browser example, 'alt' parameter on web page.

    The above line was just meant as a hint.
    In my sources i've coded this:

    Header:
    Qt Code:
    1. QWebPage *m_page;
    2. QWebSettings *m_settings;
    To copy to clipboard, switch view to plain text mode 

    Source:
    Qt Code:
    1. m_page = new QWebPage(this);
    2. m_settings = m_page->settings();
    3. m_settings->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
    4. m_settings->setAttribute(QWebSettings::PluginsEnabled, true);
    To copy to clipboard, switch view to plain text mode 

    and this works fine in my app.

  5. #5
    Join Date
    Jul 2010
    Location
    Poland
    Posts
    184
    Thanks
    70
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QWebView - browser example, 'alt' parameter on web page.

    Ok. I've done it that way:

    Qt Code:
    1. view = new QWebView(this);
    2.  
    3. QWebSettings *viewSettings;
    4. viewSettings = view->settings();
    5. viewSettings->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
    6. viewSettings->setAttribute(QWebSettings::PluginsEnabled, true);
    To copy to clipboard, switch view to plain text mode 

    But when start my app I get something like that:
    Qt Code:
    1. QWebInspector: QSettings couldn't read configuration setting [resourceTrackingEnabled].
    To copy to clipboard, switch view to plain text mode 

    But program still works, and I still don't have 'alt' parameter working. Any ideas?

    thanks in advance
    best regards
    Tomasz

Similar Threads

  1. Replies: 1
    Last Post: 27th September 2010, 14:21
  2. Editing in text box of web page : QWebView
    By girishgowda in forum Qt Programming
    Replies: 0
    Last Post: 13th July 2010, 11:42
  3. Replies: 4
    Last Post: 28th April 2010, 09:50
  4. QWebView problem to display the web page
    By ansar in forum Qt Programming
    Replies: 4
    Last Post: 2nd March 2010, 12:36
  5. How to get default home page of internet browser
    By sam_er83 in forum Qt Programming
    Replies: 2
    Last Post: 14th September 2009, 07:29

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.