-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcustomcompassplugin.py
More file actions
62 lines (45 loc) · 1.46 KB
/
Copy pathcustomcompassplugin.py
File metadata and controls
62 lines (45 loc) · 1.46 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import os
CURRENT_DIR = os.path.dirname(os.path.realpath(__file__))
from customcompass import CustomCompass
from PySide6.QtDesigner import QDesignerCustomWidgetInterface
from PySide6.QtGui import QIcon
DOM_XML = """
<ui language='c++'>
<widget class='CustomCompass' name='customcompass'>
<property name='longitude'>
<string>"17.205532194807446"</string>
</property>
<property name='latitude'>
<string>"44.795059201407355"</string>
</property>
</widget>
</ui>
"""
class CustomCompassPlugin(QDesignerCustomWidgetInterface):
def __init__(self):
super().__init__()
self._form_editor = None
def createWidget(self, *args, **kwargs):
t = CustomCompass(*args, **kwargs)
return t
def domXml(self):
return DOM_XML
def group(self):
return 'Custom Compass Widgets'
def icon(self):
imgLocation = os.path.join(CURRENT_DIR,'compassIcon.ico')
return QIcon(imgLocation)
def includeFile(self):
return 'customcomopass'
def initialize(self, form_editor):
self._form_editor = form_editor
def isContainer(self):
return False
def isInitialized(self):
return self._form_editor is not None
def name(self):
return 'CustomCompass'
def toolTip(self):
return 'This is a custom compass plugin developet for the purposes of the tutorial'
def whatsThis(self):
return self.toolTip()