No ActiveX - what about QWebView

Moderator: Rathinagiri

Ricci
Posts: 255
Joined: Thu Nov 19, 2009 2:23 pm

No ActiveX - what about QWebView

Post by Ricci »

Because HbQT is platform independend we have no ActiveX anymore.

To show the content of a website QT offers the the QWebView Class but who will implement it into HMG4 ?
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: No ActiveX - what about QWebView

Post by mrduck »

Ricci wrote:Because HbQT is platform independend we have no ActiveX anymore.

To show the content of a website QT offers the the QWebView Class but who will implement it into HMG4 ?

Try to use directly the Qt classes...
User avatar
bedipritpal
Posts: 122
Joined: Thu Sep 02, 2010 10:47 pm

Re: No ActiveX - what about QWebView

Post by bedipritpal »

QtWebKit library is completely implemented in Harbour.
You need to devise the commands per HMG methodology
or use the classes as per Qt standards.
enjoy hbIDEing... Pritpal Bedi
Ricci
Posts: 255
Joined: Thu Nov 19, 2009 2:23 pm

Re: No ActiveX - what about QWebView

Post by Ricci »

Thank you. Some small lines how to do it?
User avatar
bedipritpal
Posts: 122
Joined: Thu Sep 02, 2010 10:47 pm

Re: No ActiveX - what about QWebView

Post by bedipritpal »

Ricci wrote:Thank you. Some small lines how to do it?

Code: Select all

FUNCTION Build_HTMLViewer( oWnd )
   LOCAL oFrm, oHtm, sz_:= oWnd:currentSize()

   oFrm := XbpStatic():new( oWnd, , {5,5}, {sz_[1]-5-10,sz_[2]-30-7} )
   oFrm:type := XBPSTATIC_TYPE_RECESSEDBOX
   oFrm:options := XBPSTATIC_FRAMETHICK
   oFrm:create()
   #ifdef __HARBOUR__
   //oFrm:setStyleSheet( "border: 2px solid yellow;" )
   #endif

   sz_:= oFrm:currentSize()
   // oHtm := XbpHTMLViewer():new( oWnd, , {10,10}, {sz_[1]-25,sz_[2]-30-15} )
   oHtm := XbpHTMLViewer():new( oFrm, , {10,10}, {sz_[1]-10-10,sz_[2]-10-10} )
   oHtm:create()
   oHtm:navigate( "http://harbour-project.org" )
   oHtm:titleChange := {|e| HB_SYMBOL_UNUSED( e ) }

   RETURN oHtm
And for details you can look into harbour/contrib/hbxbp/xbphtmlviewer.prg
OR
Read XBase++ documentation on XbpHTMLViewer class.

A lot more can be done just than viewing web-pages, but that is
the next step in Harbour. You will have to add hbqtwebkit lib in project and
QtWebKit4.dll with run-time.
enjoy hbIDEing... Pritpal Bedi
Ricci
Posts: 255
Joined: Thu Nov 19, 2009 2:23 pm

Re: No ActiveX - what about QWebView

Post by Ricci »

Thank you Pritpal, but maybe this XBP/Harbour staff is a little bit far away from HMG4 for me.

And I didn´t get it working, maybe some .ch files or libs are missing?
- undefined reference to `HB_FUN_XBPSTATIC'
- undefined reference to `HB_FUN_XBPHTMLVIEWER'
Ricci
Posts: 255
Joined: Thu Nov 19, 2009 2:23 pm

Re: No ActiveX - what about QWebView

Post by Ricci »

mrduck wrote:
Ricci wrote:Because HbQT is platform independend we have no ActiveX anymore.
To show the content of a website QT offers the the QWebView Class but who will implement it into HMG4 ?
Try to use directly the Qt classes...
The simple command "web := QWebView()" end into a missing library while compiling, I tried to find the right .hbc file but it never works.

Better I forget it .... that´s no fun.
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: No ActiveX - what about QWebView

Post by mrduck »

Ricci,
use directly QtWebKit... there is hbqtwebkit.hbc in contrib/hbqt directory.

There is a remmed example in contrib/hbqt/tests/demoqt.prg.

I don't know why it is remmed... but you can try...

and since we are in open-source, you may have a look at contrib/hbxbp/xbphtmlviewer.prg and see how Pritpal did it. The code is not difficult and can be ported to HMG4 quite easily (there are no strong ties to xbp...)

What I don't understand is

Code: Select all

   #if 0  /* Discontinued till QWebKit is integrated separately - Pritpal */
   ::oWidget := QWebView( ::pParent )

   ::oWidget:connect( "iconChanged()"   , {|p| ::execSlot( "iconChanged()"            , p ) } )
   ::oWidget:connect( "linkClicked(QUrl)" , {|p| ::execSlot( "linkClicked(QUrl)"        , p ) } )
it seems to me that object creation is disabled....

But I remember that it was deliberately disable because QTWebKit is quite big, and inclusion would grow the exe size a lot...

Pritpal, was this the reason of the #if 0 ?
Ricci
Posts: 255
Joined: Thu Nov 19, 2009 2:23 pm

Re: No ActiveX - what about QWebView

Post by Ricci »

I took a look into Marinas and found that libqtwebkit4.a was missing in HMG4.
And I had to change hbqt.hbc.

Now I can continue.

web := QWebView()
web.load(QUrl("http://google.de"))
web.show()

It´s still opening 2 windows .... let´s see.

>contrib/hbxbp/xbphtmlviewer.prg

Not in my HMG4
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: No ActiveX - what about QWebView

Post by mrduck »

Ricci wrote: Now I can continue.

web := QWebView()
web.load(QUrl("http://google.de"))
web.show()

It´s still opening 2 windows .... let´s see.
QWebView( parent )... perhaps missing parent ???

Code: Select all

>contrib/hbxbp/xbphtmlviewer.prg 

Not in my HMG4[/quote]

it's in harbour... here: http://hg.bruxx.it/hg/harbour-project/file/ffaba8d2e88b/harbour/contrib/hbxbp/xbphtmlviewer.prg
Post Reply