-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLogChecker.py
42 lines (39 loc) · 1.24 KB
/
LogChecker.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
from PyQt5.QtCore import pyqtSignal, QPoint
from PyQt5.QtGui import QFont
from PyQt5.QtWidgets import QWidget, QHBoxLayout, QTextBrowser
class LogChecker(QWidget):
"""
the log checker window for log()
"""
closed = pyqtSignal()
def __init__(self, logname, par = None):
super(LogChecker, self).__init__()
self.resize(1300, 800)
self.setWindowTitle(f"log {logname}")
if par:
parentPos = QPoint()
while "builtin_function_or_method" not in str(par.parent.__class__):
parentPos += par.pos()
par = par.parent
# do also for mainWindow
parentPos += par.pos()
# to the right, and bottom
parentPos += QPoint(200, 100)
# print(par.width())
# print(par.height())
self.move(parentPos)
pass
self._textLog = QTextBrowser(self)
font = QFont ("monospace")
font.setPointSize(10)
self._textLog.setCurrentFont(font)
lay = QHBoxLayout(self)
lay.addWidget(self._textLog)
self.show()
@property
def textLog(self):
return self._textLog
def closeEvent(self, event):
self.closed.emit()
pass
pass