hbQT - Post queries in this thread only

Moderator: Rathinagiri

Post Reply
User avatar
bedipritpal
Posts: 122
Joined: Thu Sep 02, 2010 10:47 pm

Re: hbQT - Post queries in this thread only

Post by bedipritpal »

Roberto Lopez wrote:Pritpal,

I'm trying to build hbqt libraries from current sources (I've downloaded one hour ago).

libhbqtcore is not built.
Done.

Update afresh.
enjoy hbIDEing... Pritpal Bedi
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: hbQT - Post queries in this thread only

Post by Roberto Lopez »

bedipritpal wrote:
Roberto Lopez wrote:Pritpal,

I'm trying to build hbqt libraries from current sources (I've downloaded one hour ago).

libhbqtcore is not built.
Done.

Update afresh.
Thanks again!
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: hbQT - Post queries in this thread only

Post by Roberto Lopez »

Pritpal,

Is not my intention to disturb you with this kind of requests, but I'm stuck on this and I'm not able to find a solution.

As I've said in a previous post, I'm trying to print on the default printer without user interaction.

I've believed that QPRINTERINFO could give the required data (a pointer to the default printer to use with QPAINTER).

But I've found that QPRINTERINFO gives me only the default printer name, but not a pointer to it:

Code: Select all

qPrinterInfo := qPrinterInfo():New()
qpi := qPrinterInfo():from( ::qPrinterInfo:defaultprinter() )
msginfo( qpi:printername() )
Then, I've tried this:

Code: Select all

qPrinter := qprinter():new()
msginfo( qprinter:printername )
It returns the default printer name, but, again, I've not found anything in QPRINTER that returns a pointer to the printer to use with QPAINTER.

Any help on this is welcome.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: hbQT - Post queries in this thread only

Post by Rathinagiri »

Hi Roberto,

Is this not working?

Code: Select all

oPainter := QPainter():New()
oPrinter := QPrinter():new()
oPainter:begin(oPrinter)
Because that's how I worked for graph commands.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
bedipritpal
Posts: 122
Joined: Thu Sep 02, 2010 10:47 pm

Re: hbQT - Post queries in this thread only

Post by bedipritpal »

Roberto Lopez wrote:Pritpal,

Is not my intention to disturb you with this kind of requests, but I'm stuck on this and I'm not able to find a solution.
You may ask n number of questions freely.
As I've said in a previous post, I'm trying to print on the default printer without user interaction.

I've believed that QPRINTERINFO could give the required data (a pointer to the default printer to use with QPAINTER).

But I've found that QPRINTERINFO gives me only the default printer name, but not a pointer to it:

Code: Select all

qPrinterInfo := qPrinterInfo():New()
qpi := qPrinterInfo():from( ::qPrinterInfo:defaultprinter() )
msginfo( qpi:printername() )
Then, I've tried this:

Code: Select all

qPrinter := qprinter():new()
msginfo( qprinter:printername )
It returns the default printer name, but, again, I've not found anything in QPRINTER that returns a pointer to the printer to use with QPAINTER.

Any help on this is welcome.

First update from SVN r.15458, then :

Code: Select all

   qPtinterInfo := QPrinterInfo():new()
   qPrinter := QPrinter():from( qPrinterInfo:defaultPrinter() )
Hope it should work. I have not tested.
enjoy hbIDEing... Pritpal Bedi
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: hbQT - Post queries in this thread only

Post by Rathinagiri »

rathinagiri wrote:Hi Roberto,

Is this not working?

Code: Select all

oPainter := QPainter():New()
oPrinter := QPrinter():new()
oPainter:begin(oPrinter)
Because that's how I worked for graph commands.
I have checked with a sample and it works I think.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: hbQT - Post queries in this thread only

Post by Roberto Lopez »

Pritpal, Rathinagiri,

Thanks for your answers.

I'll try it ASAP and post the results here.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: hbQT - Post queries in this thread only

Post by Roberto Lopez »

rathinagiri wrote:Hi Roberto,

Is this not working?

Code: Select all

oPainter := QPainter():New()
oPrinter := QPrinter():new()
oPainter:begin(oPrinter)
Because that's how I worked for graph commands.
Thanks, it works perfect.

All we have bad days... this is the day for me :)

The samples that I've found and I've learned from, uses a pointer to the printer and not a qprinter object to work with qpainter, ie:

Code: Select all

::qPrnDlg := QPrintPreviewDialog():new()
::qPrnDlg:connect( "paintRequested(QPrinter)", {|p| ::paintRequested( p ) } )
Then, in the paintrequest method:

Code: Select all

METHOD PaintRequested( pPrinter ) CLASS PRINTER
<...>
	::qPainter:Begin(::pPrinter)
<...>
From this experience, my believe was that I must use a pointer to the printer only in qpainter:begin and not a qPrinter object.

Well... as I've said... a bad day for me :)

Thanks again.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: hbQT - Post queries in this thread only

Post by Roberto Lopez »

bedipritpal wrote: First update from SVN r.15458, then :

Code: Select all

   qPtinterInfo := QPrinterInfo():new()
   qPrinter := QPrinter():from( qPrinterInfo:defaultPrinter() )
Hope it should work. I have not tested.
I've created samples for both propositions (you and rathinagiri) .

This (the Rathinagiri solution) worked and solved the problem:

Code: Select all

oPrinter := qPrinter():New()
oPainter := QPainter():New()
oPainter:begin(oPrinter)
oPainter:drawLine_4( 10 , 10 , 100 , 100 )
oPainter:end()
The other sample (based on your proposition) does not work:

Code: Select all

oPrinterInfo := QPrinterInfo():new()
oPrinter := QPrinter():from( oPrinterInfo:defaultPrinter() )
oPainter := QPainter():New()
oPainter:begin(oPrinter)
oPainter:drawLine_4( 10 , 10 , 100 , 100 )
oPainter:end()
I'm not fully sure, but apparently, oPrinter should be the same in both cases.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: hbQT - Post queries in this thread only

Post by Rathinagiri »

Yes. I too have got this simple thing only after some 10 hours of confusion!

Qxxxx():new() always gives the pointer to the QT object created. :)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
Post Reply