[PyKDE] Re: tab creation or khtml part crashing
Marcos Dione
mdione at grulic.org.ar
Mon Dec 18 14:27:23 GMT 2006
On Mon, Dec 18, 2006 at 11:16:19AM +0100, Andreas Pakulat wrote:
> On 18.12.06 02:44:42, Marcos Dione wrote:
> > 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 ())
>
> The right thing would be a plain QWidget, with a layout set on it and
> you could use that as parent&paretnWidget.
well, as I said, you can't use a layout as a khtmlpart parentWidget
because is not a qwidget, and as khtmlpart is neither a qwidget, you
can't addWidget() it to a layout. that's why I put a khtmlview in the
middle, but then I don't get the scrollbars. hence, the original code.
--
(Not so) Random fortune:
14:30 * perrito666 se pregunta si la manpage de mplayer tiene fin o hay alguien
escribiendola a medida que la lee
More information about the PyQt
mailing list