Problem with QPrintPreviewDialog

156 views
Skip to first unread message

Cristian Francolino

unread,
Jun 8, 2018, 8:55:00 AM6/8/18
to qtcon...@googlegroups.com

Hello,

I have a problem with QPrintPreviewDialog class. It shows the preview allright but when I click de Print button, it opens an "export to PDF" dialog. It doesn't allow me to select a printer, only pdf export.

Here's my code:

METHOD prueba() CLASS ppal
LOCAL oPrinter, oPrintPreviewDialog
oPrinter := QPrinter()
oPrinter:setPageSize(QPageSize(QPrinter_A4))
oPrinter:setPageOrientation(QPrinter_Portrait)
oPrinter:setPageMargins(QMarginsF(15, 15, 15, 15), QPrinter_Millimeter)
oPrinter:setFullPage(.F.)
oPrinter:setOutputFormat(QPrinter_NativeFormat)
oPrintPreviewDialog := QPrintPreviewDialog(oPrinter)
oPrintPreviewDialog:connect("paintRequested(QPrinter*)",{|printer|self:prueba2(printer)})
oPrintPreviewDialog:exec()
RETURN self
METHOD prueba2(printer) CLASS ppal
LOCAL oPainter
oPainter := QPainter()
oPainter:begin(printer)
oPainter:drawText(100, 100, 'Prueba')
oPainter:end()
RETURN self

Thanks in advance.
Cristian Francolino



Juan Francolino

unread,
Jun 8, 2018, 9:33:09 AM6/8/18
to qtcon...@googlegroups.com

Hi,

The same problem occurs with HBIDE.

Regards,

Juan
--
You received this message because you are subscribed to the Google Groups "QtContribs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qtcontribs+...@googlegroups.com.
To post to this group, send email to qtcon...@googlegroups.com.
Visit this group at https://groups.google.com/group/qtcontribs.
For more options, visit https://groups.google.com/d/optout.

Cristian Francolino

unread,
Jun 8, 2018, 11:39:37 AM6/8/18
to qtcon...@googlegroups.com

Hi,

I solved the problem. All I had to do is copy the folder "printsupport" (from Qt plugins) into my application folder.

Regards,

Cristian

Reply all
Reply to author
Forward
0 new messages