https://github.com/FiveTechSoft/fivetouch-Qt-Creator-4.8.2-and-Qt-5.12.1-2019/tree/master/download
print01.prg
Code: Select all | Expand
#include "FiveTouch.ch"
function Main()
QPrintPreviewDialog( QPrinter() ):Exec()
return nil
![Image](https://raw.githubusercontent.com/FiveTechSoft/screenshots/master/fivetouch_print1.png)
Code: Select all | Expand
#include "FiveTouch.ch"
function Main()
QPrintPreviewDialog( QPrinter() ):Exec()
return nil
Code: Select all | Expand
#include "FiveTouch.ch"
#define QPRINTER_A4 0
#define QPRINTER_PORTRAIT 0
#define QPRINTER_MILLIMETER 0
#define QPRINTER_NATIVEFORMAT 0
function Main()
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*)", { | oPrinter | PrintPage( oPrinter ) } )
oPrintPreviewDialog:Exec()
return nil
function PrintPage( oPrinter )
local oPainter
oPainter = QPainter()
oPainter:Begin( oPrinter )
oPainter:DrawText( 100, 100, "Some text" )
oPainter:End()
return nil