[PyKDE] Re: tab creation or khtml part crashing

Andreas Pakulat apaku at gmx.de
Mon Dec 18 10:16:19 GMT 2006


On 18.12.06 02:44:42, Marcos Dione wrote:
> On Sun, Dec 17, 2006 at 11:04:18PM -0300, Marcos Dione wrote:
> >     also, now tabs open and are shown correctly, except that no
> > scrollbars are shown, so the content "dissapears" at the right and the
> > bottom. any hints?
> 
>     answering myself, again: forget about KHTMLView altogether. the
> problem was like this:
> 
> * QTabWidget.addTab() only accepts QWidgets. KHTMLPart is not.
> * QVBoxLayout is not a QWidget, so create one and use it as the layout
>   parent.
> * QVBoxLayout is not a QWidget, so you cannot use it as a KHTMLPart 
>   parentWidget. so, add the KHTMLView.
> 
>     all this got fixed using only a splitter. here's the final code:
> 
> tab= QSplitter (self.tabMaster)
> htmlView= KHTMLPart (tab, None, self)
> htmlView.openURL (url)
> self.tabMaster.addTab (tab, url.url ())

Thats not really the proper solution, unless you want to display 2
widgets side-by-side (or top-bottom) with resizing enabled. 

The right thing would be a plain QWidget, with a layout set on it and
you could use that as parent&paretnWidget.

Andreas

-- 
You have a strong desire for a home and your family interests come first.




More information about the PyQt mailing list