Hi all guys,
I know there was a discussion in this forum in the past,
but even if I put the best of my attention I was not able to
get the goal
Can someone help?
Thank you in advance.
Roberto
Hi all guys,
I know there was a discussion in this forum in the past,
but even if I put the best of my attention I was not able to
get the goal
Can someone help?
Thank you in advance.
Roberto
Hi all,
How to print aQTableWidget?
I know there was a discussion in this forum in the past,
but even if I put the best of my attention I was not able to
get the goal
If someone has example code please can help?
Thank you in advance.
Roberto
Hi
about printing a QtableWidget,
I tried again the code suggested once by JPN,
but no success..
Attached you will find what I get
Any clue? any idead..?
What could be wrong?
Thank you,
Roberto
Thanks JPN
You might want to adjust the scaling a bit. Looks like the content is scaled to fit the page.[/QUOTE]
Which line of your suggested code should I modify?
regards
Oh sorry..
this is the link you posted once..
http://www.qtcentre.org/forum/f-qt-p...g-3796.html#10
..should I add something??
If so how to complete it?
Thanka a lot
Roby
It depends how you want it to be. Maybe drawing it without scaling suits your needs:
Or alternatively use HTML and QTextDocument as suggested by Jacek at the end of the thread.Qt Code:
// painter.drawPixmap(printer.pageRect(), pixmap, pixmap.rect()); painter.drawPixmap(printer.pageRect().topLeft(), pixmap);To copy to clipboard, switch view to plain text mode
J-P Nurmi
JPN,
following your suggestion it Prints the entire table ..in the top left corner of the page..
only a problem...
the table is extremely little...I can't even see it ..
How come?
is there a scaling problem?
Roby
Give it a try with QPrinter::ScreenResolution. Presumably the another option is to scale according to used resolution in case it doesn't look good enough.
J-P Nurmi
Indeed now it look grater but not all the columns fit on the page..
"Presumably the another option is to scale according to used resolution in case it doesn't look good enough"
Can you show me how to do it?
I tried the following:
QPrinter printer;
int dpi = printer.resolution();
printer.setResolution(dpi);
but it doesn't change the fact that the table is not entirely printed..
Roby
Bookmarks