running qt/embedded

[email protected] (nick_faye) 17 Feb 2004 01:50:47 -0800
Newsgroups gmane.comp.mozilla.devel.qt
Organization http://groups.google.com
Message-ID <[email protected]>
hi guys,
    i hope someone here has encountered the same problem we do.  we
are trying to evaluate the qt/em 2.3.7 on our target system.  we had
successfully cross compiled the qt library and binaries.  but when we
tried running the sample codes of the qt/e, our system halts.  when we
tried running these lines of code:


#include <qapplication.h>
#include <qpushbutton.h>
#include <qfont.h>
#include <stdio.h>

int main( int argc, char **argv )
{
    char cChar;
    printf("Continue? (y/n)\n");
    fflush(stdin);
    scanf("%c", &cChar);
    if(cChar == 'n'){
        printf("You selected NO.\n");
        return 0;
    }
    else{
            QApplication a( argc, argv );
            printf("FINISHED QAPPLICATION\n");

            QPushButton quit( "Quit", 0 );
            printf("QUIT BUTTON CREATED\n");
            quit.resize( 75, 30 );
            quit.setFont( QFont( "Times", 18, QFont::Bold ) );

            QObject::connect( &quit, SIGNAL(clicked()), &a,
SLOT(quit()) );
            printf("CLICKED SIGNAL CONNECTED TO QUIT SLOT\n");

            a.setMainWidget( &quit );
            printf("ABOUT TO CALL QUIT.SHOW\n");
            quit.show();
            printf("ABOUT TO EXIT\n");
            return 0;
            return a.exec();
    }
} 
the string "Continue (y/n)" was not even displayed and the system
hangs.  But when we tried commenting out all the else{} block, the
printf's worked just fine.  Any hint?  Please?  Thank you

nick_faye