mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
primitive help viewer
git-svn-id: http://svn.osgeo.org/qgis/trunk@633 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
14b85907f0
commit
4029db1453
47
src/qgshelpviewer.cpp
Normal file
47
src/qgshelpviewer.cpp
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
qgshelpviewer.cpp
|
||||||
|
Simple help browser
|
||||||
|
-------------------
|
||||||
|
begin : 2004-01-28
|
||||||
|
copyright : (C) 2004 by Gary E.Sherman
|
||||||
|
email : sherman at mrcc.com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
#include "qgshelpviewer.h"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qtextbrowser.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
|
||||||
|
QgsHelpViewer::QgsHelpViewer( QWidget* parent, const char* name, bool modal, WFlags fl )
|
||||||
|
: QgsHelpViewerBase( parent, name, modal, fl )
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
QgsHelpViewer::~QgsHelpViewer()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
void QgsHelpViewer::showContent(QString path, QString doc){
|
||||||
|
textBrowser->mimeSourceFactory()->addFilePath(path);
|
||||||
|
textBrowser->setSource(doc);
|
||||||
|
}
|
||||||
|
|
45
src/qgshelpviewer.h
Normal file
45
src/qgshelpviewer.h
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
qgshelpviewer.h
|
||||||
|
Simple help browser
|
||||||
|
-------------------
|
||||||
|
begin : 2004-01-28
|
||||||
|
copyright : (C) 2004 by Gary E.Sherman
|
||||||
|
email : sherman at mrcc.com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
#ifndef QGSHELPVIEWER_H
|
||||||
|
#define QGSHELPVIEWER_H
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qdialog.h>
|
||||||
|
|
||||||
|
class QVBoxLayout;
|
||||||
|
class QHBoxLayout;
|
||||||
|
class QGridLayout;
|
||||||
|
class QPushButton;
|
||||||
|
class QTextBrowser;
|
||||||
|
class QString;
|
||||||
|
#include "qgshelpviewerbase.h"
|
||||||
|
class QgsHelpViewer : public QgsHelpViewerBase
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
QgsHelpViewer( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
|
||||||
|
~QgsHelpViewer();
|
||||||
|
void showContent(QString path, QString doc);
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // QGSHELPVIEWER_H
|
168
src/qgshelpviewerbase.ui
Normal file
168
src/qgshelpviewerbase.ui
Normal file
@ -0,0 +1,168 @@
|
|||||||
|
<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
|
||||||
|
<class>QgsHelpViewerBase</class>
|
||||||
|
<widget class="QDialog">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>QgsHelpViewerBase</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>512</width>
|
||||||
|
<height>521</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="caption">
|
||||||
|
<string>QGIS Help</string>
|
||||||
|
</property>
|
||||||
|
<property name="sizeGripEnabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<grid>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>unnamed</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QLayoutWidget" row="2" column="0">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>layout21</cstring>
|
||||||
|
</property>
|
||||||
|
<hbox>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>unnamed</cstring>
|
||||||
|
</property>
|
||||||
|
</hbox>
|
||||||
|
</widget>
|
||||||
|
<widget class="QTextBrowser" row="1" column="0">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>textBrowser</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLayoutWidget" row="0" column="0">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>layout24</cstring>
|
||||||
|
</property>
|
||||||
|
<hbox>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>unnamed</cstring>
|
||||||
|
</property>
|
||||||
|
<widget class="QPushButton">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>buttonHome</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Helvetica</family>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>&Home</string>
|
||||||
|
</property>
|
||||||
|
<property name="accel">
|
||||||
|
<string>Alt+H</string>
|
||||||
|
</property>
|
||||||
|
<property name="autoDefault">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>buttonForward</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Helvetica</family>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>&Forward</string>
|
||||||
|
</property>
|
||||||
|
<property name="accel">
|
||||||
|
<string>Alt+F</string>
|
||||||
|
</property>
|
||||||
|
<property name="autoDefault">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>buttonBack</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Helvetica</family>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>&Back</string>
|
||||||
|
</property>
|
||||||
|
<property name="accel">
|
||||||
|
<string>Alt+B</string>
|
||||||
|
</property>
|
||||||
|
<property name="autoDefault">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>buttonCancel</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Helvetica</family>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>&Close</string>
|
||||||
|
</property>
|
||||||
|
<property name="accel">
|
||||||
|
<string>Alt+C</string>
|
||||||
|
</property>
|
||||||
|
<property name="autoDefault">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</hbox>
|
||||||
|
</widget>
|
||||||
|
</grid>
|
||||||
|
</widget>
|
||||||
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonForward</sender>
|
||||||
|
<signal>clicked()</signal>
|
||||||
|
<receiver>textBrowser</receiver>
|
||||||
|
<slot>forward()</slot>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonHome</sender>
|
||||||
|
<signal>clicked()</signal>
|
||||||
|
<receiver>textBrowser</receiver>
|
||||||
|
<slot>home()</slot>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonCancel</sender>
|
||||||
|
<signal>clicked()</signal>
|
||||||
|
<receiver>QgsHelpViewerBase</receiver>
|
||||||
|
<slot>reject()</slot>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBack</sender>
|
||||||
|
<signal>clicked()</signal>
|
||||||
|
<receiver>textBrowser</receiver>
|
||||||
|
<slot>backward()</slot>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
|
<includes>
|
||||||
|
<include location="local" impldecl="in implementation">qgshelpviewerbase.ui.h</include>
|
||||||
|
</includes>
|
||||||
|
<layoutdefaults spacing="6" margin="11"/>
|
||||||
|
</UI>
|
9
src/qgshelpviewerbase.ui.h
Normal file
9
src/qgshelpviewerbase.ui.h
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** ui.h extension file, included from the uic-generated form implementation.
|
||||||
|
**
|
||||||
|
** If you wish to add, delete or rename functions or slots use
|
||||||
|
** Qt Designer which will update this file, preserving your code. Create an
|
||||||
|
** init() function in place of a constructor, and a destroy() function in
|
||||||
|
** place of a destructor.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user