-
Notifications
You must be signed in to change notification settings - Fork 13
/
propertiesdialog.py
41 lines (33 loc) · 1.56 KB
/
propertiesdialog.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
"""
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
"""
from PyQt5.QtWidgets import QDialog
from .ui_propertiesdialog import Ui_Dialog
class PropertiesDialog(QDialog, Ui_Dialog):
def __init__(self, layer):
QDialog.__init__(self)
# set up the user interface
self.setupUi(self)
self.setWindowTitle("%s - %s" % (self.tr("Layer Properties"), layer.name()))
self.layer = layer
self.horizontalSlider_Transparency.valueChanged.connect(self.sliderChanged)
self.spinBox_Transparency.valueChanged.connect(self.spinBoxChanged)
self.textEdit_Properties.setText(layer.metadata())
self.spinBox_Transparency.setValue(layer.transparency)
def sliderChanged(self, val):
s = self.spinBox_Transparency
s.blockSignals(True)
s.setValue(val)
s.blockSignals(False)
def spinBoxChanged(self, val):
s = self.horizontalSlider_Transparency
s.blockSignals(True)
s.setValue(val)
s.blockSignals(False)