Page 1 of 2
No ActiveX - what about QWebView
Posted: Thu Sep 29, 2011 9:02 pm
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 ?
Re: No ActiveX - what about QWebView
Posted: Thu Sep 29, 2011 9:09 pm
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...
Re: No ActiveX - what about QWebView
Posted: Thu Sep 29, 2011 11:08 pm
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.
Re: No ActiveX - what about QWebView
Posted: Fri Sep 30, 2011 6:27 am
by Ricci
Thank you. Some small lines how to do it?
Re: No ActiveX - what about QWebView
Posted: Fri Sep 30, 2011 7:41 pm
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.
Re: No ActiveX - what about QWebView
Posted: Fri Sep 30, 2011 8:41 pm
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'
Re: No ActiveX - what about QWebView
Posted: Sun Oct 02, 2011 7:59 pm
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.
Re: No ActiveX - what about QWebView
Posted: Sun Oct 02, 2011 8:32 pm
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 ?
Re: No ActiveX - what about QWebView
Posted: Sun Oct 02, 2011 9:02 pm
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
Re: No ActiveX - what about QWebView
Posted: Sun Oct 02, 2011 9:22 pm
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