Preview forms before saving into database
Unsolved
General and Desktop
-
@LT-K101 said in Preview forms before saving into database:
I want to preview the entry made before saving
Please explain better: what kind of preview? PDF?
-
@LT-K101 Then, well, print? The easiest way for you to go about, I think, would be:
- gather everything in the textual form in one QString;
- use QTextEdit on QDialog to display to data from the QString using QTextDocument and allow the user to accept/decline;
- if user accepts, create QPrinter and use QTextDocument::print().
All the classes are well documented. Of course, you can fiddle around with rich text (rich text in Qt is well documented too), printer selection and options and what not.
EDIT: since it might be unclear - the QTextDocument is not necessary here but using it saves all the work with rendering text, as the print() method takes care of laying out the text, page breaks, etc.
-
Hi,
QPrintPreviewDialog can be used before you start inking paper for your tests.