[PyKDE] KHTML border woes

Jim Bublitz jbublitz at nwinternet.com
Thu Sep 8 06:25:27 BST 2005


On Wednesday 07 September 2005 20:39, Brian Thomason wrote:
> I'm currently banging my head on a small, simple (in theory), fullscreen
> app that I've written using a KApplication, KMainWindow, and a KHTMLPArt
> view as the central widget.
>
> The background of the page being displayed in the view is black, and I
> wish for the whole screen to be black. Unfortunately, the view has a 1
> pixel white border all the way around it that I can't seem to egt rid of
> for the life of me.
>
> I've tried everything from setting the background of the widget to
> black, to setting the fixed width/height of the view a few pixels too
> large to hide the border. (This actually gets rid of the right border
> and the bottom border, but the top and left borders remain)  I've tried
> changing the geometry of the view, but also to no avail.
>
> I'm positive it's the view widget and NOT KMainWindow as resizing the
> view to be very small, leaves a small white square on the screen.
>
> If anyone has any idea how to fix this (even a hack) I would more than
> greatly appreciate it.

I'm not sure how to fix this, but I'd try playing around with 
KHTMLPart.view(), which returns a KHTMLView. That's a subclass of 
QScrollView, which is in turn a subclass of QFrame, which has methods for 
styling the widget's frame.

So for example, you should be able (if p is a KHTMLPart) to use:

    p.view().setFrameStyle (QFrame.NoFrame)

Not sure if that's where it's controlled, but it's where I'd start looking.

KHTMLPart or KHMTLView might also reset the frame style in various places, 
although I'd hope not (you'd have to check the C++ code for that). In that 
case you might have to turn off the frame every time you render or something 
like that.

Jim




More information about the PyQt mailing list