beirrascan
3rd November 2010, 21:31
Hi everyone.
I am trying to learn how to print with qt. I have made some progress. But I have a problem that I cant solve:
somewhere in my print function I have to search a database and copy each record to my sheet of paper one after the other. Each record has its own length and I dont know their size. The text of each record its drawn in one rectangle one after the other. But how can I know the height of the rectangles? if one record has a lot of text it can stay to big and then the next record will be written above it.
Example:
while (query.next())
{
painter.drawText(x,y,w,h,Qt::AlignTop | Qt::TextWordWrap,query.value(1).toString();
}
can someone give me an hint please?
thanks
daniel
I am trying to learn how to print with qt. I have made some progress. But I have a problem that I cant solve:
somewhere in my print function I have to search a database and copy each record to my sheet of paper one after the other. Each record has its own length and I dont know their size. The text of each record its drawn in one rectangle one after the other. But how can I know the height of the rectangles? if one record has a lot of text it can stay to big and then the next record will be written above it.
Example:
while (query.next())
{
painter.drawText(x,y,w,h,Qt::AlignTop | Qt::TextWordWrap,query.value(1).toString();
}
can someone give me an hint please?
thanks
daniel