Question

I need to print labels in my programm. The lables have a picture and a description text that should wrap around the picture. QPrinter only offers to print text in a rectangle, but nothing where i can define text regions or something similar.

Is there a way or do i have to write something by myself?

Was it helpful?

Solution

Use a QTextDocument and set your content in HTML mode. Take a look at QPintPreviewDialog. This is the way to go. You also could use a QPageSetupDialog before the print preview if you want to ajust the page settings. Three small advices: 1) If an answer is acceptable, mark it as accepted and upvote. 2) Just ask one question per thread. 3) Read the Qt API. It takes some time but you have at least to know the modules and classes to look for if you have a problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top