giusepped
20th November 2010, 14:39
I just moved to Qt 4.7. Compilation is a charm but when I use the export to pdf document of an html content, results are different with respect to previous version.
The code (that I did not change)
medie = " <table width=680><tbody><tr bgcolor=\"lightGray\" ><td colspan=3 >"+ QObject::tr("Valori medi mensili") +"</td></tr>";
medie +="<tr><td colspan=3>";
medie +="<table width=100% border=1 cellspacing=0 cellpadding=3 ><tr><td></td>";
medie += "<td>" + QObject::tr("Energia[")+unitEnergy+"]" + "</td>";
medie += "<td>" + QObject::tr("Fattore Ombre[%]") + "</td>";
medie += "<td>" + QObject::tr("Perdite termiche[%]") + "</td>";
medie += "<td>" + QObject::tr("Altre perdite[%]") + "</td>";
medie += "<td>" + QObject::tr("Temp. medie[<sup>o</sup>]") + "</td>";
medie += "<td>" + QObject::tr("Vento medio[m/s]") + "</td>";
medie += "</tr>";
for(int i=0;i<12;i++) {
medie += "<tr>";
medie += "<td>" + MyMath::months(i+1) + "</td>";
if (Eset)
medie += "<td>" + QString("%L1").arg(E[i],0,'f',2) + "</td>";
else
medie += "<td>" + QString("%L1").arg(0) + "</td>";
medie += "<td>" + QString("%L1").arg((opt.shadows.at(i))*100,0,'f',2) + "</td>";
medie += "<td>" +QString("%L1").arg((1-
opt.thermalLosses.at(i))*100,0,'f',2) +"</td>";
medie += "<td>" + QString("%L1").arg((opt.otherLoss.at(i))*100,0,'f',2) +"</td>";
medie += "<td>" + QString("%L1").arg(opt.temperatures.at(i),0,'f',2) +"</td>";
medie += "<td>" +QString("%L1").arg(opt.wind.at(i),0,'f',2) + "</td>";
medie += "</tr>";
}
medie += "</table>";
medie += "</td></tr></tbody></table>";
And I print on a qprinter by using
m_cursor.insertHtml(medie);
m_document->drawContents(&p,printer->paperRect());
But the result is a broken table:mad:
as attached in the picture.
Why?
The code (that I did not change)
medie = " <table width=680><tbody><tr bgcolor=\"lightGray\" ><td colspan=3 >"+ QObject::tr("Valori medi mensili") +"</td></tr>";
medie +="<tr><td colspan=3>";
medie +="<table width=100% border=1 cellspacing=0 cellpadding=3 ><tr><td></td>";
medie += "<td>" + QObject::tr("Energia[")+unitEnergy+"]" + "</td>";
medie += "<td>" + QObject::tr("Fattore Ombre[%]") + "</td>";
medie += "<td>" + QObject::tr("Perdite termiche[%]") + "</td>";
medie += "<td>" + QObject::tr("Altre perdite[%]") + "</td>";
medie += "<td>" + QObject::tr("Temp. medie[<sup>o</sup>]") + "</td>";
medie += "<td>" + QObject::tr("Vento medio[m/s]") + "</td>";
medie += "</tr>";
for(int i=0;i<12;i++) {
medie += "<tr>";
medie += "<td>" + MyMath::months(i+1) + "</td>";
if (Eset)
medie += "<td>" + QString("%L1").arg(E[i],0,'f',2) + "</td>";
else
medie += "<td>" + QString("%L1").arg(0) + "</td>";
medie += "<td>" + QString("%L1").arg((opt.shadows.at(i))*100,0,'f',2) + "</td>";
medie += "<td>" +QString("%L1").arg((1-
opt.thermalLosses.at(i))*100,0,'f',2) +"</td>";
medie += "<td>" + QString("%L1").arg((opt.otherLoss.at(i))*100,0,'f',2) +"</td>";
medie += "<td>" + QString("%L1").arg(opt.temperatures.at(i),0,'f',2) +"</td>";
medie += "<td>" +QString("%L1").arg(opt.wind.at(i),0,'f',2) + "</td>";
medie += "</tr>";
}
medie += "</table>";
medie += "</td></tr></tbody></table>";
And I print on a qprinter by using
m_cursor.insertHtml(medie);
m_document->drawContents(&p,printer->paperRect());
But the result is a broken table:mad:
as attached in the picture.
Why?