-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviewer.py
More file actions
33 lines (25 loc) · 792 Bytes
/
viewer.py
File metadata and controls
33 lines (25 loc) · 792 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
33
#!/usr/bin/env python
from PyQt5.QtWidgets import QWidget, QApplication, QVBoxLayout, QLabel, QTextEdit
from PyQt5.QtGui import QFont
#from PyQt5.QtCore import Qt, pyqtSlot
import sys
class Viewer(QWidget):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
layout = QVBoxLayout()
layout.setSpacing(0)
font = QFont("Monospace", 12)
textview = QTextEdit()
textview.setReadOnly(True)
textview.setFont(font)
textview.setHtml("<b>test</b>test")
#textview.setPlainText("<b>test</b>test")
layout.addWidget(textview)
self.setLayout(layout)
self.show()
if __name__ == '__main__':
app = QApplication(sys.argv)
viewer = Viewer()
sys.exit(app.exec_())