QTableWidget Sql Query 25.000 records
Dear All
I have a big problem like this...
I have the following code for QTableWidget
Code:
treeStoklarStokBilgisi->clear();
treeStoklarStokBilgisi->setUpdatesEnabled( false );
QString arananStokNo
= lineStoklarParcaNo
->text
();
QString arananAciklama
= lineStoklarAciklama
->text
();
QString arananMakina
= comboStoklarMakina
->currentText
();
query = "SELECT stok.stokid, stokisim, parcano FROM stok LEFT JOIN stokindex ON stokindex.stokid = stok.stokid WHERE stok.stokid IN (SELECT stokid FROM stokindex WHERE parcano like '" + arananStokNo + "%')";
if (radioMakina->isChecked())
{
query += " AND stokid IN (SELECT makinaindex.stokid FROM makinaindex, makina WHERE makinaindex.makinaid=makina.makinaid AND makina.makina_isim ~*'" + arananMakina + "')";
}
anas.exec(query);
while(anas.next())
{
//aciklama = anas.value(1).toString();
//stokno = anas.value(0).toString();
// i->setStatusTip(0, stokno);
i->setText(0, anas.value(2).toString());
i->setText(1, anas.value(1).toString());
i->setText(2, anas.value(0).toString());
parnox.exec("SELECT parcano FROM stokindex WHERE stokid=" + stokno + " ORDER BY sorulma DESC");
int iR=1;
while(parnox.next())
{
if(iR==1)
{
i->setStatusTip(0, parnox.value(0).toString());
i->setText(0, parnox.value(0).toString());
i->setText(1, aciklama);
i->setText(2, stokno);
iR++;
}
else if(iR>1)
{
alti->setStatusTip(0, parnox.value(0).toString());
alti->setText(0, parnox.value(0).toString());
alti->setStatusTip(1, stokno);
alti->setText(2, stokno);
}
}
}
treeStoklarStokBilgisi->setUpdatesEnabled( true );
But the problem is when I try to load the data It takes to much time for loading the tree...
Can anybody help me to solve this problem...
Re: QTableWidget Sql Query 25.000 records
Can you post constructor from cachedb?
Re: QTableWidget Sql Query 25.000 records
cachedb is a database that I copy from postgres to memory to sqlite...
If you need the codes I could sent