-
Notifications
You must be signed in to change notification settings - Fork 1
/
CadHelp.py
53 lines (41 loc) · 1.82 KB
/
CadHelp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# -*- coding: utf-8 -*-
"""
/***************************************************************************
CadHelp
A QGIS plugin
Store and restore layer visibilities
-------------------
begin : 2012-12-26
copyright : (C) 2012 by Olivier Dalang
email : [email protected]
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
"""
# Import the PyQt and QGIS libraries
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
class CadHelp(QDialog):
def __init__(self):
QDialog.__init__(self)
self.setMinimumWidth(600)
self.setMinimumHeight(450)
self.helpFile = QFileInfo(QgsApplication.qgisUserDbFilePath()).path() + "python/plugins/CadInput/README.html"
self.setWindowTitle('CadInput')
txt = QTextBrowser()
txt.setReadOnly(True)
txt.setText( open(self.helpFile, 'r').read() )
cls = QPushButton('Close')
cls.pressed.connect(self.accept)
lay = QVBoxLayout()
lay.addWidget(txt)
lay.addWidget(cls)
self.setLayout(lay)
self.show()