Skip to content

Commit ec9f94e

Browse files
author
timlinux
committedNov 29, 2009
Switch to using QWebView to allow rich html in help viewer
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12294 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

5 files changed

+24
-12
lines changed

5 files changed

+24
-12
lines changed
 
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
<h3>Open Vector Layer Dialog</h3>
2+
3+
<p class="overview">
4+
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>
5+
6+
<img src=":/themes/default/mActionDelete.png">

‎src/core/qgsapplication.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ QString QgsApplication::reportStyleSheet()
385385
"padding-bottom: 8px;"
386386
"border: 1px solid #6c6c6c;"
387387
"}"
388+
".overview{ font: 1.82em; font-weight: bold;}"
388389
"h1 {font-size : 22pt; }"
389390
"h2 {font-size : 18pt; }"
390391
"h3 {font-size : 14pt; }";

‎src/helpviewer/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ ELSE (${QTVERSION} STRLESS "4.3.0")
5959
${QT_QTNETWORK_LIBRARY}
6060
${QT_QTSVG_LIBRARY}
6161
${QT_QTXML_LIBRARY}
62+
${QT_QTWEBKIT_LIBRARY}
6263
)
6364
ENDIF (${QTVERSION} STRLESS "4.3.0")
6465

‎src/helpviewer/qgshelpviewer.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ void QgsHelpViewer::loadContext( const QString &contextId )
151151
file.close();
152152

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

157159
}
@@ -179,7 +181,7 @@ void QgsHelpViewer::loadContextFromSqlite( const QString &contextId )
179181
{
180182
// there should only be one row returned
181183
// Set the browser text to the record from the database
182-
txtBrowser->setText(( char* )sqlite3_column_text( ppStmt, 0 ) );
184+
webView->setHtml(( char* )sqlite3_column_text( ppStmt, 0 ) );
183185
setWindowTitle( tr( "Quantum GIS Help - %1" ).arg(( char* )sqlite3_column_text( ppStmt, 1 ) ) );
184186
}
185187
}

‎src/helpviewer/qgshelpviewerbase.ui

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,13 @@
2121
<property name="sizeGripEnabled">
2222
<bool>true</bool>
2323
</property>
24-
<layout class="QGridLayout">
25-
<property name="margin">
26-
<number>9</number>
27-
</property>
28-
<property name="spacing">
29-
<number>6</number>
30-
</property>
24+
<layout class="QGridLayout" name="gridLayout">
3125
<item row="0" column="0">
32-
<widget class="QTextBrowser" name="txtBrowser">
33-
<property name="acceptDrops">
34-
<bool>false</bool>
26+
<widget class="QWebView" name="webView">
27+
<property name="url">
28+
<url>
29+
<string>about:blank</string>
30+
</url>
3531
</property>
3632
</widget>
3733
</item>
@@ -45,6 +41,13 @@
4541
</layout>
4642
</widget>
4743
<layoutdefault spacing="6" margin="11"/>
44+
<customwidgets>
45+
<customwidget>
46+
<class>QWebView</class>
47+
<extends>QWidget</extends>
48+
<header>QtWebKit/QWebView</header>
49+
</customwidget>
50+
</customwidgets>
4851
<resources/>
4952
<connections>
5053
<connection>

0 commit comments

Comments
 (0)
Please sign in to comment.