[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    KHTMLPart::document seems to return nothing ...
From:       Jan.Kaiser () OnVista ! de
Date:       2003-06-04 14:50:19
[Download RAW message or body]


Hi,

thanks for all the help. The creation if KHTMLPart works now without the
GUI==false flag.
If I invoke the KHTMLPart::show() method, even a "browser" window co
But unfortunately there is another problem regarding the retrieval of the
DOM::Document by invoking
the KHTMLPart::document method. This call seems to return nothing.

Is there a special (e.g. signal/slot) mechanism required to access the
document?

int main(int argc, char* argv[])
{

  KApplication a(argc, argv, "test");
  cerr << "created KApplication" << endl;
  KURL url = KURL("http://www.kde.org/index.php");
  cerr << "created KURL" << endl;
  KHTMLPart *w = new KHTMLPart(0,0,0,0,KHTMLPart::BrowserViewGUI);
  cerr << "created KHTMLPart" << endl;
  if (w != 0)
  {
    bool opened = w->openURL(url);
    cerr << "opened url: " << opened << endl;
    Document doc = w->document();
    // this prints nothing for the doc.toHTML() expression
    cerr << "got doc " << doc.toHTML() << endl;
  }
  else
    cerr << "w is null" << endl;
  return a.exec();
}


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic