/// TEST SECTION BEGINlistExec(dbSPO,qList);QTime tt1,tt2,tt3;QVariantList thotels,trooms,tplaces,tmeals,tnights,tcheckins,tprice;QSqlQuery tq(dbSPO);/*Inc intHotel intRoom intPlace intMeal intNight intCheckin intPrice float*/tq.prepare("insert into price (hotel,room,place,meal,night,checkin,price) values (?,?,?,?,?,?,?);");tt2.start();xmlChar *tstr = (xmlChar *)"1234"; for (int i=0; i < 154740; i++) { thotels << QString((const char *)tstr); trooms << QString((const char *)tstr); tplaces << QString((const char *)tstr); tmeals << QString((const char *)tstr); tnights << QString((const char *)tstr); tcheckins << QString((const char *)tstr); tprice << QString((const char *)tstr); }qDebug("Generate queries: %d ms", tt2.elapsed());tt3.start(); tq.addBindValue(thotels); tq.addBindValue(trooms); tq.addBindValue(tplaces); tq.addBindValue(tmeals); tq.addBindValue(tnights); tq.addBindValue(tcheckins); tq.addBindValue(tprice);qDebug("Bind values: %d ms", tt3.elapsed());tt1.start();if (!tq.execBatch()) qDebug() << tq.lastError(); qDebug("Execute queries: %d ms", tt1.elapsed());return true;/// TEST SECTION END
/// TEST SECTION BEGIN 2listExec(dbSPO,qList);qList.clear();QTime tt1,tt2;tt2.start();xmlChar *tstr = (xmlChar *)"1234"; for (int i=0; i < 154740; i++) { qList << QString("INSERT INTO price (hotel,room,place,meal,night,checkin,price) VALUES (%1,%2,%3,%4,%5,%6,%7);") .arg(QString((const char *)tstr)) .arg(QString((const char *)tstr)) .arg(QString((const char *)tstr)) .arg(QString((const char *)tstr)) .arg(QString((const char *)tstr)) .arg(QString((const char *)tstr)) .arg(QString((const char *)tstr)); }qDebug("Generate queries: %d ms", tt2.elapsed());tt1.start();listExec(dbSPO,qList);qDebug("Execute queries: %d ms", tt1.elapsed());return true;/// TEST SECTION END 2
dbSPO.transaction();if (!tq.execBatch()) qDebug() << tq.lastError();dbSPO.commit();
QDebug operator<<(QDebug debug, QDir::Filters filters){ QStringList flags; if (filters == QDir::NoFilter) { flags << QLatin1String("NoFilter"); } else { if (filters & QDir::Dirs) flags << QLatin1String("Dirs"); if (filters & QDir::AllDirs) flags << QLatin1String("AllDirs"); if (filters & QDir::Files) flags << QLatin1String("Files"); if (filters & QDir::Drives) flags << QLatin1String("Drives"); if (filters & QDir::NoSymLinks) flags << QLatin1String("NoSymLinks"); if (filters & QDir::NoDotAndDotDot) flags << QLatin1String("NoDotAndDotDot"); if ((filters & QDir::AllEntries) == QDir::AllEntries) flags << QLatin1String("AllEntries"); if (filters & QDir::Readable) flags << QLatin1String("Readable"); if (filters & QDir::Writable) flags << QLatin1String("Writable"); if (filters & QDir::Executable) flags << QLatin1String("Executable"); if (filters & QDir::Modified) flags << QLatin1String("Modified"); if (filters & QDir::Hidden) flags << QLatin1String("Hidden"); if (filters & QDir::System) flags << QLatin1String("System"); if (filters & QDir::CaseSensitive) flags << QLatin1String("CaseSensitive"); } debug << "QDir::Filters(" << qPrintable(flags.join(QLatin1String("|"))) << ")"; return debug;}
QLabel *label = new QLabel(QLatin1String("MOD"), this);
QLabel *label = new QLabel("MOD", this);