-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelp.py
More file actions
32 lines (23 loc) · 668 Bytes
/
help.py
File metadata and controls
32 lines (23 loc) · 668 Bytes
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
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from ui import *
class help(QWidget):
def __init__(self, parent):
super(help, self).__init__()
self.parent = parent
# Initialize
layout = QGridLayout()
layout.setAlignment(Qt.AlignTop)
self.setLayout(layout)
# Get help contents
fh = open("help.html", 'r')
html = fh.read()
fh.close()
# Help contents box
txtHelp = QTextBrowser()
txtHelp.setReadOnly(True)
txtHelp.setSource(QUrl("help.html"))
txtHelp.setMinimumHeight(400)
txtHelp.verticalScrollBar().setValue(txtHelp.verticalScrollBar().maximum())
# Add widgets to layout
layout.addWidget(txtHelp, 0, 0, Qt.AlignTop)