Re: delay in qapplication
You'd have to debug more properly. Maybe the driver initialisation takes so long?
Re: delay in qapplication
Here is my code.
Code:
#include "dbclientside.h"
#include <QApplication>
void execute()
{
//calls methods of dll to execute a stored procedure and retrieve the resultset
//prints the resultset to stdout
}
int main(int argc, char* argv[])
{
QApplication a
(argc, argv
);
//This line takes approximately 40 seconds.
execute(); //This line takes just 1 or 2 seconds.
return a.exec();
}
If you mean QODBC driver, it is initialized in execute() method. And does not take so much time.
Re: delay in qapplication
Could you insert a breakpoint on the line constructing a QApplication object and then step into QApplication's constructor while debugging? Maybe it's something in QCoreApplication::init() what's taking so long.
Re: delay in qapplication
Quote:
Originally Posted by
mandal
If you mean QODBC driver, it is initialized in execute() method. And does not take so much time.
Plugins get initialised inside QCoreApplication constructor. I didn't mean your code to initialise the database.
Do what JPN suggests - dive into QApplication code. Remember to compile in debug mode or else you won't get much info.
Re: delay in qapplication
Code:
void QApplicationPrivate::construct(
#ifdef Q_WS_X11
Display *dpy, Qt::HANDLE visual, Qt::HANDLE cmap
#endif
)
{
Q_INIT_RESOURCE(qstyle);
process_cmdline(); //<---- HERE WHERE MY CODE HANGS FOR 40 SECONDS
// Must be called before initialize()
qt_init(this, qt_appType
#ifdef Q_WS_X11
, dpy, visual, cmap
#endif
);
initialize();
eventDispatcher->startingUp();
#ifdef QT_EVAL
extern void qt_gui_eval_init(uint);
qt_gui_eval_init(application_type);
#endif
}
I debugged detailly and found the line causes the delay.This method is in qapplcation.cpp file.
Any suggestions? Thanx a lot