-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmc_material_widget.py
66 lines (52 loc) · 1.77 KB
/
mc_material_widget.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
from ui.mc_material_id import Ui_mc_material_wg
from PySide import QtCore, QtGui
from color_button import QColorButton
class Material_widget(QtGui.QWidget,Ui_mc_material_wg):
"""
MainWindow for Asset import, QWidget for docking
"""
def __init__(self, locked = False):
super(Material_widget, self).__init__()
self.setupUi(self)
colorB = QColorButton()
self.horizontalLayout.addWidget(QColorButton())
self.locked = locked
self.connect_ui_functions()
def connect_ui_functions(self):
pass
#self.lockedCB.toggled.connect(self.toggle_lock)
def mousePressEvent(self, QMouseEvent):
if QMouseEvent.button() == QtCore.Qt.RightButton:
pass
#self.toggle_lock()
#do what you want here
#if self.dis
def lock(self):
for child in self.children():
if child.objectName() != 'lockedCB':
child.setEnabled(False)
def toggle_lock(self):
if not self.locked:
for child in self.children():
if child.objectName() != 'lockedCB':
child.setEnabled(False)
self.locked = 1
else:
for child in self.children():
if child.objectName() != 'lockedCB':
child.setEnabled(True)
self.locked = 0
self.window().update()
if __name__ == '__main__':
import sys, os
from utils.convert_ui_files import convert
'''Convert UI Files'''
pwd = os.path.dirname(os.path.realpath(__file__))
ui_files = os.path.join(pwd, 'ui')
print ui_files
convert(ui_files)
'''Show GUI'''
app = QtGui.QApplication(sys.argv)
myWidget = Material_widget()
myWidget.show()
app.exec_()