×

Discussion Board

Results 1 to 14 of 14
  1. #1
    Registered User
    Join Date
    Apr 2010
    Posts
    8

    Lightbulb [SOLVED]white screen when calling qwebview widget

    hi, all~i'm a newbie to the qt development for Maemo and now totally stucked on the usage of qwebview widget

    My example code is very simple. But everything get strange when i run it in the maemo emulator, the qwebview displays nothing but a white screen. What i'm sure about is that the qwebview has loaded the content of page. i tried google but got nothing, so i wish i would seek answer here, thanks for your help.

    Code:
    #include <QtGui>
    #include<QtWebKit>
    
    int main(int argc, char *argv[])
    {
    	QApplication app(argc, argv);
    
    	QWebView *view = new QWebView();
    	view->load(QUrl("http://www.google.com"));
    	view->show();
    
    	QPushButton *ok = new QPushButton("TEST");
    
    	QHBoxLayout *layout = new QHBoxLayout();
    	layout->addWidget(ok);
    	layout->addWidget(view);
    
    	QWidget *widget = new QWidget();
    	widget->setLayout(layout);
    	widget->show();
    
    	return app.exec();
    }
    Last edited by hulun499; 2010-05-10 at 11:13.

  2. #2
    Registered User
    Join Date
    Apr 2010
    Posts
    8

    Re: white screen when calling qwebview widget

    hi, i just complied the code on the windows platform by using Qt Creator and the code runs well~ i think this problem may be related to configuration of development environment of linux, i will try to solve the problem in this direction and post my solution if fixed, thanks and also i will appreciate if u can give any advise on this

    my development environment is CENTOS(linux kernel 2.6.18) + MAEMO 5 + Qt4.6 + ESBOX

  3. #3
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: white screen when calling qwebview widget

    I don't know about Maemo, but for Symbian the default for "color" is white. So text that shows up in black under Creator is white in the emulator or on the device, unless you change the default.

  4. #4
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Posts
    4,326

    Re: white screen when calling qwebview widget

    Quote Originally Posted by hulun499 View Post
    What i'm sure about is that the qwebview has loaded the content of page.
    How do you know that?

    Quote Originally Posted by hulun499 View Post
    my development environment is CENTOS(linux kernel 2.6.18) + MAEMO 5 + Qt4.6 + ESBOX
    Development environment could be MADDE, scratchbox 1, scratchbox 2. Which one do you refer as Maemo 5?

  5. #5
    Registered User
    Join Date
    Apr 2010
    Posts
    8

    Re: white screen when calling qwebview widget

    Quote Originally Posted by danhicksbyron View Post
    I don't know about Maemo, but for Symbian the default for "color" is white. So text that shows up in black under Creator is white in the emulator or on the device, unless you change the default.
    I don't think my problem is related to the default color of text, as the images in google homepage also does not show up~but anyway i will try this and see if any text will be displayed

  6. #6
    Registered User
    Join Date
    Apr 2010
    Posts
    8

    Re: white screen when calling qwebview widget

    Quote Originally Posted by divanov View Post
    How do you know that?
    I caught the signal loadProcess to monitor the loading of webpage and found that the loading indicator was updated.

    Quote Originally Posted by divanov View Post
    Development environment could be MADDE, scratchbox 1, scratchbox 2. Which one do you refer as Maemo 5?
    i used the scratchbox 1 for development
    Last edited by hulun499; 2010-04-26 at 04:32.

  7. #7
    Registered User
    Join Date
    Apr 2010
    Posts
    8

    Re: white screen when calling qwebview widget

    newfound!

    The code works fine when i disable the composite extension by adding the parameter '-extension Composite' to the Xephyr command. It seems that it is hard for maemo to render the html content when using qwebview widget on my pc~any idea?

  8. #8
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Posts
    4,326

    Re: white screen when calling qwebview widget

    I've developed small test application

    Code:
    #ifndef MAIN_H
    #define MAIN_H
    
    #include <QtGui>
    #include <QtWebKit>
    
    class View : public QMainWindow
    {
        Q_OBJECT
    
    public:
        View(QWidget *parent = 0);
    
    private slots:
        void loadFinished(bool ok);
    
    private:
        QWebView *view;
        QPushButton *ok;
    };
    
    #endif // MAIN_H
    Code:
    #include "main.h"
    
    View::View(QWidget *parent) : QMainWindow(parent)
    {
        ok = new QPushButton("Test");
        view = new QWebView();
        connect(view, SIGNAL(loadFinished(bool)), SLOT(loadFinished(bool)));
    
        QHBoxLayout *layout = new QHBoxLayout();
        layout->addWidget(ok);
        layout->addWidget(view);
    
        QWidget *widget = new QWidget();
        widget->setLayout(layout);
        setCentralWidget(widget);
    
        view->load(QUrl("http://www.google.com"));
    }
    
    void View::loadFinished(bool ok)
    {
        qDebug() << __PRETTY_FUNCTION__ << ok;
    }
    
    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
    
        View view;
        view.show();
    
        return app.exec();
    }
    That's what I get when I run it:
    > run-standalone.sh $(pwd)/webkit3
    webkit3[7520]: GLIB CRITICAL ** Gtk - gtk_widget_set_sensitive: assertion `GTK_IS_WIDGET (widget)' failed
    QMaemoInternetConnectivity has received an error message.
    Name: "org.freedesktop.DBus.Error.ServiceUnknown"
    Message: "The name com.nokia.icd was not provided by any .service files"
    NOTE: Please ignore this error message if you are running your application in scratchbox
    Warning: Qt GConf backend has got a NULL value for the key: "/system/osso/connectivity/IAP/last_used_network"
    QMaemoInternetConnectivity has received an error message.
    Name: "org.freedesktop.DBus.Error.ServiceUnknown"
    Message: "The name com.nokia.icd_ui was not provided by any .service files"
    NOTE: Please ignore this error message if you are running your application in scratchbox
    void View::loadFinished(bool) false

  9. #9
    Registered User
    Join Date
    Apr 2010
    Posts
    8

    Re: white screen when calling qwebview widget

    i got the below message when i run my example code
    HelloWorld[2855]: GLIB CRITICAL ** Gtk - gtk_widget_set_sensitive: assertion `GTK_IS_WIDGET (widget)' failed
    QMaemoInternetConnectivity has received an error message.
    Name: "org.freedesktop.DBus.Error.ServiceUnknown"
    Message: "The name com.nokia.icd was not provided by any .service files"
    NOTE: Please ignore this error message if you are running your application in scratchbox
    Warning: Qt GConf backend has got a NULL value for the key: "/system/osso/connectivity/IAP/last_used_network"
    QMaemoInternetConnectivity has received an error message.
    Name: "org.freedesktop.DBus.Error.ServiceUnknown"
    Message: "The name com.nokia.icd_ui was not provided by any .service files"
    NOTE: Please ignore this error message if you are running your application in scratchbox
    QMaemoInternetConnectivity has received an error message.
    Name: "org.freedesktop.DBus.Error.ServiceUnknown"
    Message: "The name com.nokia.icd was not provided by any .service files"
    NOTE: Please ignore this error message if you are running your application in scratchbox
    Warning: Qt GConf backend has got a NULL value for the key: "/system/osso/connectivity/IAP/last_used_network"
    QMaemoInternetConnectivity has received an error message.
    Name: "org.freedesktop.DBus.Error.ServiceUnknown"
    Message: "The name com.nokia.icd_ui was not provided by any .service files"
    NOTE: Please ignore this error message if you are running your application in scratchbox
    QMaemoInternetConnectivity has received an error message.
    Name: "org.freedesktop.DBus.Error.ServiceUnknown"
    Message: "The name com.nokia.icd was not provided by any .service files"
    NOTE: Please ignore this error message if you are running your application in scratchbox
    Warning: Qt GConf backend has got a NULL value for the key: "/system/osso/connectivity/IAP/last_used_network"
    QMaemoInternetConnectivity has received an error message.
    Name: "org.freedesktop.DBus.Error.ServiceUnknown"
    Message: "The name com.nokia.icd_ui was not provided by any .service files"
    NOTE: Please ignore this error message if you are running your application in scratchbox
    I don't know why i got the error highlighted by red color as no gdk object is used in my code.

  10. #10
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Posts
    4,326

    Re: white screen when calling qwebview widget

    Quote Originally Posted by hulun499 View Post
    i got the below message when i run my example code

    I don't know why i got the error highlighted by red color as no gdk object is used in my code.
    Qt integrates with Gtk2 and it's using inside styles, certain methods and widgets from Gtk2 toolkit.

  11. #11
    Registered User
    Join Date
    Apr 2010
    Posts
    8

    Re: white screen when calling qwebview widget

    hi, all~i finally got the solution!

    The reason why the qwebview cannot access webpage is the internet connectivity in the simulation environment of scratchbox. To solve the problem, you need 1)copy the /etc/resolv.conf to /scratchbox/etc/resolv.conf; 2)Change /scratchbox/etc/nsswitch.conf hosts-line as "hosts: files dns".

    But actually i dunno much about the detail as i can use apt-get in the scratchbox which approves that the network connectivity is accessible there, i will appreciate if someone can explain it!

    Thanks for the help of divanov and danhicksbyron!

  12. #12
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Posts
    4,326

    Re: white screen when calling qwebview widget

    You probably have network configured in /etc/apt/apt.conf
    Which version of scratchbox are you using?
    Are you behind firewall?

  13. #13
    Registered User
    Join Date
    Apr 2010
    Posts
    8

    Re: white screen when calling qwebview widget

    hi, Daniil~

    Quote Originally Posted by divanov View Post
    You probably have network configured in /etc/apt/apt.conf
    Do u mean the proxy setting in apt.conf? If so, my apt.conf doesn't have any such setting, you can see the content below.

    // Don't open connections in parallel, that brings the little devices
    // down to their knees.
    //
    Acquire::Queue-Mode "access";
    Acquire::https::Verify-Peer "false";
    APT::Install-Recommends 0;
    Quote Originally Posted by divanov View Post
    Which version of scratchbox are you using?
    I'm using scratchbox 1 to do the development.

    Quote Originally Posted by divanov View Post
    Are you behind firewall?
    There should be a firewall as i'm in a company network.

  14. #14
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Posts
    4,326

    Re: white screen when calling qwebview widget

    Quote Originally Posted by hulun499 View Post
    hi, Daniil~
    Do u mean the proxy setting in apt.conf? If so, my apt.conf doesn't have any such setting, you can see the content below.
    What are settings of your target? sb-conf show

    Quote Originally Posted by hulun499 View Post
    I'm using scratchbox 1 to do the development.
    This says particularly nothing to me. Are you using VirtualBox image for Windows or did you install rootstrap manually,
    or did you use scratchbox installation script (http://repository.maemo.org/stable/5...stall_5.0.sh)?

    Quote Originally Posted by hulun499 View Post
    There should be a firewall as i'm in a company network.
    Check if this page reports the same IP as you get with ifconfig
    http://tools-on.net/privacy.shtml?o=...6362706175&s=r

Similar Threads

  1. White Screen during videoControl.getSnapshot()
    By am11 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2010-01-19, 23:34
  2. Flash widget screen turning white on tap
    By ranco in forum [Archived] Flash Lite on Nokia Devices
    Replies: 2
    Last Post: 2010-01-06, 08:08
  3. White Rectangle on Home Screen
    By ChrisWooldridge in forum Symbian User Interface
    Replies: 0
    Last Post: 2009-11-26, 02:29
  4. Self-updating home screen widget not possible?
    By bau420 in forum Symbian Web Runtime
    Replies: 6
    Last Post: 2009-07-30, 08:45
  5. Will Home screen widget work's on 5800 xpress music phone?
    By mehraj123 in forum Symbian Web Runtime
    Replies: 1
    Last Post: 2009-04-24, 07:17

Posting Permissions

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