I was testing an application of ours on Fedora 23 (x86-64) with Qt 4.8.7 and found that the startup is delayed by 40 seconds or more.

The culprit seems to be QPrinter. Just creating a QPrinter object takes anywhere between 25 to 50 seconds! I have attached a minimal example program. I used the a Qt Creator template so it has created a ui file for mainwindow. Do ignore that extra code.

The code in question is in the mainwindow constructor:

qDebug() << "Using Qt version: " << qVersion();
qDebug() << "before create printer" << QTime::currentTime();
QPrinter *qp = new QPrinter(QPrinter::ScreenResolution);
qDebug() << "after create printer" << QTime::currentTime();
delete qp;
qDebug() << "after delete printer" << QTime::currentTime();


A typical run gave me about 50 seconds between printing of "before create.." and "after create.." lines. I tried it several times and I got anywhere between 25 to 50 seconds.


I restarted the computer for some other reason, and now everything seems to be alright. The constructor finishes in no time and everything works as expected.

I am wondering if this problem can happen again. What can possibly cause QPrinter constructor to get stuck for such a long time?



Thanks and regards,

Syam

Attachment: qprinter.tar.gz
Description: application/gzip

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to