×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Feb 2009
    Posts
    16

    qt load url internal qt browser

    Hi All,

    I'm new on qt development. Actually this is my 5th day about it My target is too simple. i need to load a url but not on the external nokia browser. i need to launch it on internal qtbrowser.

    #include <QtGui>
    #include <QDesktopServices>
    #include <QUrl>

    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);
    QDesktopServices:penUrl(QUrl("http://stage.kangurum.com.tr/migrosmobile/qt/home.do?isQt=yes"));
    return app.exec();
    }

    I found this code but i think this lauches the external browser. its not for me. I have a N8 device and it should work on it. please help me i need it in 2 days.

  2. #2
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: qt load url internal qt browser

    Quote Originally Posted by griim67 View Post
    I'm new on qt development. Actually this is my 5th day about it My target is too simple. i need to load a url but not on the external nokia browser. i need to launch it on internal qtbrowser.
    Look in the docs for QWebView
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  3. #3
    Registered User
    Join Date
    Feb 2009
    Posts
    16

    Re: qt load url internal qt browser

    thanks for quick reply.
    i think this should work:

    #include <QtGui/QApplication>
    #include "mainwindow.h"
    #include <QWebView>
    #include <QUrl>

    int main(int argc, char *argv[]){
    QApplication a(argc, argv);
    QWebView *view = new QWebView(parent);
    view->load(QUrl("http://qt.nokia.com/"));
    view->show();
    return a.exec();
    }

    but i got errors like:

    QWebView: No such file or directory
    QWebView was not declared in this scope
    view was not declared in this scope
    expected type-specifier before QWebView
    expected ';' before QWebView

    i think these are really simple but i do not know this qt development :S

  4. #4
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: qt load url internal qt browser

    Open the *.pro file and add the webkit module to your project:
    Code:
    QT       += core gui webkit
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  5. #5
    Registered User
    Join Date
    Feb 2009
    Posts
    16

    Re: qt load url internal qt browser

    thank you very much itomuta. it is now working on emulator but i got an error on my N8 device. the error is "QWebView: No such file or directory" i think i should install something to my device. i can run other examples of qt on my device but i got this error on this webview.

  6. #6
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: qt load url internal qt browser

    It looks more like compilation error rather than run-time error.

  7. #7
    Registered User
    Join Date
    Feb 2009
    Posts
    16

    Re: qt load url internal qt browser

    i got this error after qmake:
    Could not install from package C:\Data\MyAppName.sis on device: General OS-related error

  8. #8
    Registered User
    Join Date
    Feb 2009
    Posts
    16

    Re: qt load url internal qt browser

    you r right. thanks. finaly i success to run the program on my N8 device. But now i got an other error is that qt browser do not load my url. my code is:

    int main(int argc, char *argv[]){
    QApplication a(argc, argv);

    QWebView view;
    view.load(QUrl("MyUrl"));
    view.showMaximized();

    return a.exec();
    }

    Emulator can load it.

  9. #9
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: qt load url internal qt browser

    Does your project have NetworkServices capabilities?

  10. #10
    Registered User
    Join Date
    Feb 2009
    Posts
    16

    Re: qt load url internal qt browser

    should i add something else to *.pro file for network access?

    i added "TARGET.CAPABILITY += NetworkServices" but it is still same.

    TARGET.UID3 = 0xe79dc3cd
    # TARGET.CAPABILITY +=
    TARGET.CAPABILITY += NetworkServices
    TARGET.EPOCSTACKSIZE = 0x14000
    TARGET.EPOCHEAPSIZE = 0x020000 0x800000
    }
    Last edited by griim67; 2011-02-13 at 15:08.

  11. #11
    Registered User
    Join Date
    Feb 2009
    Posts
    16

    Re: qt load url internal qt browser

    finally i success to run the program on my device. But still i have problems i got memory warning errors and then program shutdowns itself :S

    And i want to ask something. is qt browser better then normal browser of N8? i thougt yes but i see that normal browser runs my webapp better than qt browser :S

Similar Threads

  1. QT 4.7 / QT 4.6 inconsistency in Nokia QT SDK
    By stewarth01 in forum [Archived] Qt SDKs and Tools
    Replies: 3
    Last Post: 2010-11-07, 20:48
  2. Internal switching between stacked widgets in qt
    By sathyanarayanan.se in forum Qt
    Replies: 10
    Last Post: 2010-07-15, 12:47
  3. QT Blutooth module not available in Nokia QT SDK (QT 4.6.3)
    By Suyash in forum [Archived] Qt SDKs and Tools
    Replies: 5
    Last Post: 2010-06-25, 09:55

Posting Permissions

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