개정판 ed478827
issue #1173: Export 클래스 생성
Change-Id: Idda3836cf251112bb2849d84d4c8a8d6a194f921
DTI_PID/DTI_PID/Commands/ExportCommand.py | ||
---|---|---|
1 |
# coding: utf-8 |
|
2 |
""" This is Export command module """ |
|
3 |
import os.path |
|
4 |
import sys |
|
5 |
from enum import Enum |
|
6 |
from PyQt5.QtCore import * |
|
7 |
from PyQt5.QtGui import * |
|
8 |
from PyQt5.QtWidgets import * |
|
9 |
|
|
10 |
|
|
11 |
class ExportCommand(QThread): |
|
12 |
display_message = pyqtSignal(Enum, str) |
|
13 |
show_progress = pyqtSignal(int) |
|
14 |
|
|
15 |
def __init__(self, format): |
|
16 |
QThread.__init__(self) |
|
17 |
|
|
18 |
self._format = format # xml, svg, image |
|
19 |
|
|
20 |
def __del__(self): |
|
21 |
self.wait() |
|
22 |
|
|
23 |
def run(self): |
|
24 |
""" do given work""" |
|
25 |
from AppDocData import AppDocData |
|
26 |
from AppDocData import MessageType |
|
27 |
|
|
28 |
try: |
|
29 |
app_doc_data = AppDocData.instance() |
|
30 |
except Exception as ex: |
|
31 |
from AppDocData import MessageType |
|
32 |
|
|
33 |
message = 'error occurred({}) in {}:{}'.format(repr(ex), sys.exc_info()[-1].tb_frame.f_code.co_filename, |
|
34 |
sys.exc_info()[-1].tb_lineno) |
|
35 |
self.display_message.emit(MessageType.Error, message) |
|
36 |
|
DTI_PID/DTI_PID/Shapes/EngineeringLineItem.py | ||
---|---|---|
1800 | 1800 |
|
1801 | 1801 |
QGraphicsLineItem.mouseReleaseEvent(self, event) |
1802 | 1802 |
|
1803 |
def contextMenuEvent(self, event): |
|
1804 |
menu = QMenu() |
|
1805 |
testAction = QAction('Test', None) |
|
1806 |
testAction.triggered.connect(self.print_out) |
|
1807 |
menu.addAction(testAction) |
|
1808 |
menu.exec_(event.screenPos()) |
|
1809 |
|
|
1810 |
def print_out(self): |
|
1811 |
print('Triggered') |
|
1803 | 1812 |
|
1804 | 1813 |
''' |
1805 | 1814 |
@brief The class transfer pyqtSignal Event. Cause Subclass of QGraphicsRectItem can't use pyqtSignal |
내보내기 Unified diff