Results 1 to 3 of 3

Thread: what is the difference among three ways of constructing a Qtopia application?

  1. #1
    Join Date
    Sep 2007
    Posts
    5
    Thanks
    1
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default what is the difference among three ways of constructing a Qtopia application?

    method 1:int main( int argc, char ** argv )
    {
    QPEApplication a( argc, argv );
    skizzy mw;
    a.showMainWidget( &mw );
    return a.exec();
    }
    mothed 2:

    QTOPIA_ADD_APPLICATION("skizzy",skizzy);
    QTOPIA_MAIN

    method 3:

    static Main *m = 0;

    void qtopiaInit( int argc, char *argv[] )
    {
    m = new Main();
    qApp->showMainWidget(m);
    }

    void qtopiaDestroy()
    {
    delete m;
    }

    QTOPIA_MAIN

    and the QTOPIA_MAIN macro is implemented as:


    int main( int argc, char **argv )
    {
    QPEApplication a( argc, argv );
    qtopiaInit( argc, argv );
    int rv = a.exec();
    qtopiaDestroy();
    return rv;
    }
    all the examples comes from the offical documents (http//doc.trolltech.com)?who can tell me the difference ?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: what is the difference among three ways of constructing a Qtopia application?

    All these basically do the same. The difference is that you might want to do some additional things here and there thus you can either go for a minimal and standard application startup (method 2), semi automatic method3 or method1 that gives you full control over everything (allowing for instance to use a subclass of QPEApplication).

  3. #3
    Join Date
    Sep 2007
    Posts
    5
    Thanks
    1
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: what is the difference among three ways of constructing a Qtopia application?

    thanks ,years gone ,here is my topic still

Similar Threads

  1. Replies: 3
    Last Post: 6th March 2007, 18:24

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.