Bruno Luciani wrote:
>
> Anybody have a little sample in howto use QprintPreviewDialog to preview
> and print
>
> a QtextDocument object ? , i don't find anything , and it is needed to
> connect a signal
>
> and eider found a signal related to this widget
>
Study ideeditor.prg.
These methods are relevant:
METHOD IdeEditsManager:printPreview()
LOCAL qDlg
IF ! empty( ::qCurEdit )
qDlg := QPrintPreviewDialog():new( ::oDlg:oWidget )
qDlg:setWindowTitle( "Harbour-QT Preview Dialog" )
Qt_Slots_Connect( ::pSlots, qDlg, "paintRequested(QPrinter)", {|p|
::paintRequested( p ) } )
qDlg:exec()
Qt_Slots_disConnect( ::pSlots, qDlg, "paintRequested(QPrinter)" )
ENDIF
RETURN self
/*----------------------------------------------------------------------*/
METHOD IdeEditsManager:paintRequested( pPrinter )
LOCAL qPrinter
qPrinter := QPrinter():configure( pPrinter )
::qCurEdit:print( qPrinter )
RETURN Self
/*----------------------------------------------------------------------*/
And change
::qCurEdit:print( qPrinter )
=>
qTextDocument:print( qPrinter )
Above is a generic idea. You may need to hook :printPreview()
method above to some pushbutton where qTextDocument is also visible, and
then adopt to your needs.
-----
enjoy hbIDEing...
Pritpal Bedi
http://hbide.vouch.info/
--
View this message in context:
http://n2.nabble.com/QprintPreviewDialog-tp4919220p4919938.html
Sent from the harbour-devel mailing list archive at Nabble.com.
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour