Sorry for the late reply, especially as your responses have been so prompt. Unfortunately I had unavoidable commitments. Thank you once again for your response it did clear some issues up for me. I will run a series of tests based on your replies and assess my options for achieving a reasonably rapid and satisfactory solution.
Can I take the opportunity to reinforce the hopefully obvious notion that I am posting as a relative novice in this area and I have the greatest respect for your obvious competence and experience in this field. I think I need to be clearer in my statements and I apologise for the areas of vagueness that have lead to some miscommunication.
I think it is also important that I stress that I am very aware that in many ways the approach I am using is not the best practice for printing out text and graphs. It would, however, have been extremely beneficial to utilise this approach if it could have been achieved reliably as it would result in the most expedient solution for my very specific, current circumstances. In my initial tests I encountered no problems and it seemed likely that this approach may have provided a more than satisfactory implementation for the functionality that was required.
This approach can produce very high quality and more than satisfactory results proven through numerous subjective tests. Timing was critical and this approach also offered a very quick solution for relatively complex layouts of plots, graphics, text and custom widgets, largely reusing existing code.
In summary my initial question was can the specific (and possibly relatively rare) printer issue be avoided using the approach outlined. The potential responses I identified were.
1. Yes
1.a. the implementation for direct rendering of widgets is wrong and needs to be corrected
1.b. by changing settings used (e.g. change the QPrinter::***Resolution *Note that setting the QPrinter::ScreenSetting option seems to dramatically lower the output quality)
1.c. substitute use of QTextEdit->render(&painter) for QTextEdit
2. No
2.a. Use a QTextDocument based approach (this is likely to incur a time penalty)
2.b. Use a QGraphicsScene based approach (this is likely to incur a time penalty)
2.c. It is a printer driver issue that cannot be avoided using the proposed approach. Use 2.a. 2.b. or another approach to implement required printout functionality.
It was important to note the finding that there was a significant difference in printout quality when using the settings QPrinter::HighResolution & QPrinter::ScreenResolution and that this was a fundamental point in my query hence my comment
which was referring to a very specific pointThis is absolutely not true
in the very specific context that it is not true that there is never an advantage to upscale a widget to a higher resolution than a screen resolution. Upscaling many widgets can produce significantly better printout results. This depends on every aspect of the upscaling process involved and does not necessarily breach any fundamental laws of sampling. E.g.If you want to print a widget then its resolution is equal to the resolution of your screen and upscaling it to the maximum resolution supported by a printer doesn't make sense.
HighResolution Upscaling Example
&
ScreenResolution Unscaled Example
It was also referring to
specifically in the context that the results obtained using this approach have been frequently subjectively assessed by testers as very poor indeed. In terms of my requirements this definition of reasonable is not sufficient.If you keep the printout resolution in the range of your screen resolution, you should obtain reasonable print jobs.
I apologise for this I meant to refer specifically to the documentation regarding the PrinterMode setting where it statesYou render the widget off screen and indeed the screen resolution is largely irrelevant. It is then advisable to render at the HighResolution setting. This is exactly what the documentation recommends for high quality printouts.
I reiterate again that I know this approach is not optimal or best practice for achieving the highest quality printouts.ScreenResolution will produce a lower quality output than HighResolution and should only be used for drafts.
Bookmarks