11#include " navigationwidget.h"
22#include " declarationnavigationcontext.h"
3+ #include < qlayout.h>
4+ #include < QWebView>
5+ #include < QUrl>
6+ #include < QWebFrame>
7+ #include < QWebElement>
8+ #include < qboxlayout.h>
9+ #include < qpushbutton.h>
10+ #include < QObject>
311
412namespace Python {
513
@@ -8,15 +16,42 @@ NavigationWidget::NavigationWidget(KDevelop::DeclarationPointer declaration, KDe
816 kDebug () << " Navigation widget for Declaration requested" ;
917 m_topContext = topContext;
1018
11- initBrowser (400 );
12-
1319 m_startContext = new DeclarationNavigationContext (declaration, m_topContext);
1420 setContext (m_startContext);
21+
22+ m_documentationWebView = new QWebView (this );
23+ m_documentationWebView->load (QUrl (" http://localhost:1050/" ));
24+ connect ( m_documentationWebView, SIGNAL (loadFinished (bool )), SLOT (addDocumentationData (bool )) );
25+
26+ delete layout ();
27+
28+ QGridLayout* newLayout = new QGridLayout ();
29+ newLayout->setRowMinimumHeight (0 , 300 );
30+ newLayout->setColumnMinimumWidth (0 , 400 );
31+ setLayout (newLayout);
32+ layout ()->addWidget (m_documentationWebView);
33+
34+ initBrowser (400 );
35+ }
36+
37+ void NavigationWidget::addDocumentationData (bool finished)
38+ {
39+ kDebug () << " Done loading!" ;
40+ QWebElement document = m_documentationWebView->page ()->mainFrame ()->documentElement ();
41+ if ( ! document.isNull () ) {
42+ kDebug () << " >>> Trying to append documentation... " ;
43+ document.findFirst (" body" ).appendInside (" Hello World" );
44+ }
45+ else {
46+ kError () << " !!! Could not append documentation to HTML page received!" ;
47+ }
1548}
1649
1750NavigationWidget::NavigationWidget (const KDevelop::IncludeItem& includeItem, KDevelop::TopDUContextPointer topContext, const QString& htmlPrefix, const QString& htmlSuffix)
1851{
1952
2053}
2154
22- }
55+ }
56+
57+ #include " navigationwidget.moc"
0 commit comments