0BLACK0
21st September 2010, 10:44
hi guys i'm very new to qt programing currently i use PyQt4 (Python+Qt)
i want to ask a question about my new project "custom report generator"
i tried many ways of implementing this program in QT but every method ends with stacked in missing features
my real problem now is the reports pages can be more than 20000+ pages and i want the user to preview it before printing
when using QPrintPreviewWidget it takes too long to draw the items usually "tables with text" and you can't print custom pages from QPrintPreviewWidget something like (from page 0 to 5)
so i tried to paint in QGraphicsScene and implement my own QPrintPreviewWidget like
then render the selected rectangles "pages" to printer directly
i succeeded with that but drawing tables with text in QGraphicsScene take too long
because i'm very very Newbie i draw the table columns,rows cell by cell of "QRectF" cause i want to align and format the text within the cells by sub-classing QGraphicsTextItem()
and paint the text with custom font and bound it to specific rectangle then use QGraphicsScene.addItem() to add it
this cause the QGraphicsScene to have lot's & lot's of items and objects
when painting 70000 rows it takes 2GB of my ram then crashed :(
so is there a way to draw my table with customized text (align and font)
with better idea and doesn't have many objects to draw in QGraphicsScene()
i know that my solution is newbie that's what i said before :p
i can post sample if any one using PyQt4
hope to find better idea :confused:
thanx in advance :)
i want to ask a question about my new project "custom report generator"
i tried many ways of implementing this program in QT but every method ends with stacked in missing features
my real problem now is the reports pages can be more than 20000+ pages and i want the user to preview it before printing
when using QPrintPreviewWidget it takes too long to draw the items usually "tables with text" and you can't print custom pages from QPrintPreviewWidget something like (from page 0 to 5)
so i tried to paint in QGraphicsScene and implement my own QPrintPreviewWidget like
then render the selected rectangles "pages" to printer directly
i succeeded with that but drawing tables with text in QGraphicsScene take too long
because i'm very very Newbie i draw the table columns,rows cell by cell of "QRectF" cause i want to align and format the text within the cells by sub-classing QGraphicsTextItem()
and paint the text with custom font and bound it to specific rectangle then use QGraphicsScene.addItem() to add it
this cause the QGraphicsScene to have lot's & lot's of items and objects
when painting 70000 rows it takes 2GB of my ram then crashed :(
so is there a way to draw my table with customized text (align and font)
with better idea and doesn't have many objects to draw in QGraphicsScene()
i know that my solution is newbie that's what i said before :p
i can post sample if any one using PyQt4
hope to find better idea :confused:
thanx in advance :)