[Qt-interest] main gui thread

Puneet Bisht pbisht at nivio.com
Wed Feb 18 13:15:14 CET 2009


hi all,

i m using qt 3.3
i have a main.cpp as follows

int main( int argc, char **argv )
{
    QApplication qApp( argc, argv );
//	qApp.setStyle( QStyleFactory::create("Keramik"));
	qApp.setStyle( QStyleFactory::create("Aqua"));
	nivlogin check_obj;
        check_obj.firstFun();
        check_obj.show();
        qApp.connect( &qApp, SIGNAL( lastWindowClosed() ), &qApp, SLOT(
quit() ) );
    return qApp.exec();
}

nivlogin is a login class, after successfull login i hide this login form
and shows other widget which is a file transfer app.

obj1 = new cwidget();
 obj1->show();
 QDialog::hide();

now from  obj1 i create a thread which transfers the selected files , for
each file i m creating a separate process , after completion of each
process
i m updating status of file as "completed" in the widget.

here is the problem , documents says that gui should be updated from main
thread but i m updating it from worker thread.
can someone give me a code snip... on this or upgrade my code ,
here in terms of this scenario can any one help me on how i should update
the gui, and using qprocess in different thread other than main one is
causing crashes.
i want some code snippet
thanks in advance



More information about the Qt-interest-old mailing list