hytos / HYTOS / HYTOS / Shapes / EngineeringEqpDescTextItem.py @ 47a53a74
이력 | 보기 | 이력해설 | 다운로드 (1.17 KB)
1 |
# coding: utf-8
|
---|---|
2 |
""" This is engineering equipment description text item module """
|
3 |
|
4 |
import os.path |
5 |
import sys |
6 |
import copy |
7 |
try:
|
8 |
from PyQt5.QtCore import Qt, QPointF, QRectF, pyqtSignal, QT_VERSION_STR, QRect |
9 |
from PyQt5.QtGui import QImage, QPixmap, QPainterPath, QBrush, QPen, QTransform, QFont |
10 |
from PyQt5.QtWidgets import QGraphicsView, QGraphicsScene, QFileDialog, QGraphicsItem, QAbstractGraphicsShapeItem, QGraphicsTextItem |
11 |
except ImportError: |
12 |
try:
|
13 |
from PyQt4.QtCore import Qt, QRectF, pyqtSignal, QT_VERSION_STR, QRect |
14 |
from PyQt4.QtGui import QGraphicsView, QGraphicsScene, QImage, QPixmap, QPainterPath, QFileDialog, QFont |
15 |
except ImportError: |
16 |
raise ImportError("ImageViewerQt: Requires PyQt5 or PyQt4.") |
17 |
|
18 |
class QEngineeringEqpDescTextItem(QGraphicsTextItem): |
19 |
""" This is engineering equipment description text item class """
|
20 |
|
21 |
def __init__(self, text, parent=None): |
22 |
import uuid |
23 |
|
24 |
QGraphicsTextItem.__init__(self, text, parent)
|
25 |
self.type = 'EQP DESC' |
26 |
self.setHtml(text)
|
27 |
|
28 |
font = QFont('Arial', 15) |
29 |
font.setPointSizeF(3)
|
30 |
self.setFont(font)
|
31 |
|
32 |
self.setDefaultTextColor(Qt.lightGray)
|