Skip to content

Commit

Permalink
Switch to using QWebView to allow rich html in help viewer
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12294 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Nov 29, 2009
1 parent e140945 commit ec9f94e
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 12 deletions.
5 changes: 5 additions & 0 deletions resources/context_help/QgsOpenVectorLayerDialog-en_US
@@ -1 +1,6 @@
<h3>Open Vector Layer Dialog</h3>

<p class="overview">
The open vector layer dialog is used to add vector data to the QGIS map view. Vector data are spatial data described using geometries of points, lines and polygons (enclosed areas).</p>

<img src=":/themes/default/mActionDelete.png">
1 change: 1 addition & 0 deletions src/core/qgsapplication.cpp
Expand Up @@ -385,6 +385,7 @@ QString QgsApplication::reportStyleSheet()
"padding-bottom: 8px;"
"border: 1px solid #6c6c6c;"
"}"
".overview{ font: 1.82em; font-weight: bold;}"
"h1 {font-size : 22pt; }"
"h2 {font-size : 18pt; }"
"h3 {font-size : 14pt; }";
Expand Down
1 change: 1 addition & 0 deletions src/helpviewer/CMakeLists.txt
Expand Up @@ -59,6 +59,7 @@ ELSE (${QTVERSION} STRLESS "4.3.0")
${QT_QTNETWORK_LIBRARY}
${QT_QTSVG_LIBRARY}
${QT_QTXML_LIBRARY}
${QT_QTWEBKIT_LIBRARY}
)
ENDIF (${QTVERSION} STRLESS "4.3.0")

Expand Down
6 changes: 4 additions & 2 deletions src/helpviewer/qgshelpviewer.cpp
Expand Up @@ -151,7 +151,9 @@ void QgsHelpViewer::loadContext( const QString &contextId )
file.close();

// Set the browser text to the help contents
txtBrowser->setHtml( helpContents );
QString myStyle = QgsApplication::reportStyleSheet();
helpContents = "<head><style>" + myStyle + "</style></head><body>" + helpContents + "</body>";
webView->setHtml( helpContents );
setWindowTitle( tr( "Quantum GIS Help" ) );

}
Expand Down Expand Up @@ -179,7 +181,7 @@ void QgsHelpViewer::loadContextFromSqlite( const QString &contextId )
{
// there should only be one row returned
// Set the browser text to the record from the database
txtBrowser->setText(( char* )sqlite3_column_text( ppStmt, 0 ) );
webView->setHtml(( char* )sqlite3_column_text( ppStmt, 0 ) );
setWindowTitle( tr( "Quantum GIS Help - %1" ).arg(( char* )sqlite3_column_text( ppStmt, 1 ) ) );
}
}
Expand Down
23 changes: 13 additions & 10 deletions src/helpviewer/qgshelpviewerbase.ui
Expand Up @@ -21,17 +21,13 @@
<property name="sizeGripEnabled">
<bool>true</bool>
</property>
<layout class="QGridLayout">
<property name="margin">
<number>9</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QTextBrowser" name="txtBrowser">
<property name="acceptDrops">
<bool>false</bool>
<widget class="QWebView" name="webView">
<property name="url">
<url>
<string>about:blank</string>
</url>
</property>
</widget>
</item>
Expand All @@ -45,6 +41,13 @@
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header>QtWebKit/QWebView</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
Expand Down

0 comments on commit ec9f94e

Please sign in to comment.