QGraphicsScene interferes with QNetworkManager
-
I am using QNetworkManager to download files. If I connect the downloadProgress signal of QNetworkManager object to a slot of Main Gui Thread which draws on QGraphicsView, the download speed decreases more than 10 times:
@
// a custom progress bar
void manager::showGProgress(int num, float prgrss) //slot
{
prgrss=prgrss/100;
x_coord=(ui->graphicsView_2->width()-3)*prgrss;
for(float b=0;b<=x_coord;b=b+0.5)
{
progress.addRect(0,0,x_coord,y_coord);
//x_coord=(ui->graphicsView_2->width()-3)*prgrss;
ui->graphicsView_2->setAlignment(Qt::AlignLeft);
ui->graphicsView_2->setScene(&progress);
//ui->graphicsView_2->show();
}}@
-
I have introduced "code wrappings":http://qt-project.org/wiki/ForumHelp#e3f82045ad0f480d3fb9e0ac2d58fb01 Remember next time.
-
Is there any alternative way of doing this, i.e. custom progress bar which won't interfere with QNetworkManager. QNetworkManager runs in a separate thread of its own, such things shouldn't occur.