Switch to using QWebView to allow rich html in help viewer

git-svn-id: http://svn.osgeo.org/qgis/trunk@12294 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
timlinux 2009-11-29 22:16:56 +00:00
parent 82693c9791
commit 32ac8b8285
5 changed files with 24 additions and 12 deletions

View File

@ -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">

View File

@ -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; }";

View File

@ -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")

View File

@ -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" ) );
}
@ -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 ) ) );
}
}

View File

@ -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>
@ -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>