Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User griim67's Avatar
    Join Date
    Feb 2009
    Posts
    16
    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 ltomuta's Avatar
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,335
    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

  3. #3
    Registered User griim67's Avatar
    Join Date
    Feb 2009
    Posts
    16
    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 ltomuta's Avatar
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,335
    Open the *.pro file and add the webkit module to your project:
    Code:
    QT       += core gui webkit

  5. #5
    Registered User griim67's Avatar
    Join Date
    Feb 2009
    Posts
    16
    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
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    It looks more like compilation error rather than run-time error.

  7. #7
    Registered User griim67's Avatar
    Join Date
    Feb 2009
    Posts
    16
    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 griim67's Avatar
    Join Date
    Feb 2009
    Posts
    16
    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
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    Does your project have NetworkServices capabilities?

  10. #10
    Registered User griim67's Avatar
    Join Date
    Feb 2009
    Posts
    16
    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 griim67's Avatar
    Join Date
    Feb 2009
    Posts
    16
    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
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved