Page 2 of 15

Re: hbQT - Post queries in this thread only

Posted: Sat Sep 04, 2010 2:23 pm
by Rathinagiri
Roberto, can you update with the new HBQT code?

Re: hbQT - Post queries in this thread only

Posted: Sat Sep 04, 2010 3:37 pm
by Roberto Lopez
rathinagiri wrote:Roberto, can you update with the new HBQT code?
I must prepare new binaries for both (Windows and Linux) from the modified sources.

I'll try to do it ASAP.

Re: hbQT - Post queries in this thread only

Posted: Sat Sep 04, 2010 5:30 pm
by bedipritpal
Roberto Lopez wrote:Pritpal,

Various users (and me) verified that images are not working in menus under Ubuntu 10.4.

It can be verified on demoqt.
I am not a user of Linux so cannot comment.

Post your relevant code here and let me analyze how it can be done in different way.
Hopefully we will get to the problem.

Re: hbQT - Post queries in this thread only

Posted: Sat Sep 04, 2010 6:38 pm
by Roberto Lopez
bedipritpal wrote:
Roberto Lopez wrote:Pritpal,

Various users (and me) verified that images are not working in menus under Ubuntu 10.4.

It can be verified on demoqt.
I am not a user of Linux so cannot comment.

Post your relevant code here and let me analyze how it can be done in different way.
Hopefully we will get to the problem.
Thanks for your answer.

There is no special code. It is simply demoqt with Harbour built from current (a couple of days ago) sources.

The same works perfect on Windows.

Re: hbQT - Post queries in this thread only

Posted: Sat Sep 04, 2010 6:42 pm
by Roberto Lopez
Pritpal,

I'm trying to print based on a millimeters coordinates system.

I've found a solution, but is C++ based.

The problem is that I can't figure out how the following code can be translated to HBQT:

Code: Select all

painter.device()->physicalDpiX()
were 'painter' is a QPaniter object.

Thanks in advance.

Re: hbQT - Post queries in this thread only

Posted: Sat Sep 04, 2010 7:57 pm
by bedipritpal
Roberto Lopez wrote:Pritpal,

I'm trying to print based on a millimeters coordinates system.

I've found a solution, but is C++ based.

The problem is that I can't figure out how the following code can be translated to HBQT:

Code: Select all

painter.device()->physicalDpiX()
were 'painter' is a QPaniter object.

Thanks in advance.
Try:

Local qPaintDevice

qPaintDevice := QPaintDevice():from( painter:device() )
nDpiX := qPaintDevice:physicalDpiX()

Re: hbQT - Post queries in this thread only

Posted: Sat Sep 04, 2010 8:06 pm
by bedipritpal
Roberto Lopez wrote: There is no special code. It is simply demoqt with Harbour built from current (a couple of days ago) sources.
The same works perfect on Windows.
Try:

oActNew := QAction():new( oMenu1 )
oActNew:setText( "&New" )
oActNew:setIcon( "new.png" )
oActNew:connect( "triggered(bool)", {|w,l| FileDialog( "New" , w, l ) } )
oMenu1:addAction_4( oActNew )

Re: hbQT - Post queries in this thread only

Posted: Sat Sep 04, 2010 10:57 pm
by Roberto Lopez
Pritpal,

Thanks for your answers.

Re: hbQT - Post queries in this thread only

Posted: Sun Sep 05, 2010 12:00 am
by bedipritpal
Roberto Lopez wrote:Pritpal,

Thanks for your answers.
It is not enough.
Did they work ?

Re: hbQT - Post queries in this thread only

Posted: Sun Sep 05, 2010 1:11 am
by Roberto Lopez
bedipritpal wrote:
Roberto Lopez wrote:Pritpal,

I'm trying to print based on a millimeters coordinates system.

I've found a solution, but is C++ based.

The problem is that I can't figure out how the following code can be translated to HBQT:

Code: Select all

painter.device()->physicalDpiX()
were 'painter' is a QPaniter object.

Thanks in advance.
Try:

Local qPaintDevice

qPaintDevice := QPaintDevice():from( painter:device() )
nDpiX := qPaintDevice:physicalDpiX()
Its working fine. It returns the correct DPIs for the printer.

A little suggestion:

Since QT official reference samples (and most of those we can find on the web) are C++ based, could be very useful if you could write a small HOWTO file, explaining how to handle certain situations when the translation of the code is not obvious for a Harbour/xBase programmer without C++ knowledge.

Thanks.