Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
LETG
Rename bands
Commits
368af84a
Commit
368af84a
authored
Sep 14, 2021
by
PIERSON Julie
Browse files
removing unused commented code
parent
71f26e65
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
94 deletions
+0
-94
BandTableWidget.py
BandTableWidget.py
+0
-94
No files found.
BandTableWidget.py
View file @
368af84a
...
...
@@ -56,10 +56,6 @@ class BandTableWidget(BASE, WIDGET):
self
.
btnRemove
.
setIcon
(
QgsApplication
.
getThemeIcon
(
'/symbologyRemove.svg'
))
self
.
btnUp
.
setIcon
(
QgsApplication
.
getThemeIcon
(
'/mActionArrowUp.svg'
))
self
.
btnDown
.
setIcon
(
QgsApplication
.
getThemeIcon
(
'/mActionArrowDown.svg'
))
# self.btnLoad.setIcon(QgsApplication.getThemeIcon('/mActionFileOpen.svg'))
# self.btnSave.setIcon(QgsApplication.getThemeIcon('/mActionFileSave.svg'))
# self.btnAuto.setIcon(QgsApplication.getThemeIcon('/mActionReload.svg'))
self
.
layer
=
None
@
pyqtSlot
()
...
...
@@ -97,76 +93,6 @@ class BandTableWidget(BASE, WIDGET):
self
.
bandClassTree
.
insertTopLevelItem
(
currentIndex
-
1
,
item
)
self
.
bandClassTree
.
setCurrentItem
(
item
)
# @pyqtSlot()
# def on_btnLoad_clicked(self):
# fileName, _ = QFileDialog.getOpenFileName(None,
# self.tr('Import Colors and elevations from XML'),
# QDir.homePath(),
# self.tr('XML files (*.xml *.XML)'))
# if fileName == '':
# return
#
# doc = QDomDocument()
# with codecs.open(fileName, 'r', encoding='utf-8') as f:
# content = f.read()
#
# if not doc.setContent(content):
# QMessageBox.critical(None,
# self.tr('Error parsing XML'),
# self.tr('The XML file could not be loaded'))
# return
#
# self.bandClassTree.clear()
# reliefColorList = doc.elementsByTagName('ReliefColor')
# for i in range(reliefColorList.length()):
# elem = reliefColorList.at(i).toElement()
# item = QTreeWidgetItem()
# item.setText(0, elem.attribute('MinElevation'))
# item.setText(1, elem.attribute('MaxElevation'))
# item.setBackground(2, QBrush(QColor(int(elem.attribute('red')),
# int(elem.attribute('green')),
# int(elem.attribute('blue')))))
# self.bandClassTree.addTopLevelItem(item)
#
# @pyqtSlot()
# def on_btnSave_clicked(self):
# fileName, _ = QFileDialog.getSaveFileName(None,
# self.tr('Export Colors and elevations as XML'),
# QDir.homePath(),
# self.tr('XML files (*.xml *.XML)'))
#
# if fileName == '':
# return
#
# if not fileName.lower().endswith('.xml'):
# fileName += '.xml'
#
# doc = QDomDocument()
# colorsElem = doc.createElement('ReliefColors')
# doc.appendChild(colorsElem)
#
# colors = self.reliefColors()
# for c in colors:
# elem = doc.createElement('ReliefColor')
# elem.setAttribute('MinElevation', str(c.minElevation))
# elem.setAttribute('MaxElevation', str(c.maxElevation))
# elem.setAttribute('red', str(c.color.red()))
# elem.setAttribute('green', str(c.color.green()))
# elem.setAttribute('blue', str(c.color.blue()))
# colorsElem.appendChild(elem)
#
# with codecs.open(fileName, 'w', encoding='utf-8') as f:
# f.write(doc.toString(2))
#
# @pyqtSlot()
# def on_btnAuto_clicked(self):
# if self.layer is None:
# return
#
# relief = QgsRelief(self.layer, system.getTempFilename(), 'GTiff')
# colors = relief.calculateOptimizedReliefClasses()
# self.populateColors(colors)
@
pyqtSlot
(
QTreeWidgetItem
,
int
)
def
on_bandClassTree_itemDoubleClicked
(
self
,
item
,
column
):
if
not
item
:
...
...
@@ -188,12 +114,6 @@ class BandTableWidget(BASE, WIDGET):
decimals
=
2
)
if
ok
:
item
.
setText
(
1
,
str
(
d
))
# elif column == 2:
# c = QColorDialog.getColor(item.background(2).color(),
# None,
# self.tr('Select color for relief class'))
# if c.isValid():
# item.setBackground(2, QBrush(c))
def
reliefColors
(
self
):
colors
=
[]
...
...
@@ -205,15 +125,6 @@ class BandTableWidget(BASE, WIDGET):
colors
.
append
(
c
)
return
colors
# def populateColors(self, colors):
# self.bandClassTree.clear()
# for c in colors:
# item = QTreeWidgetItem()
# item.setText(0, str(c.minElevation))
# item.setText(1, str(c.maxElevation))
# item.setBackground(2, QBrush(c.color))
# self.bandClassTree.addTopLevelItem(item)
def
setLayer
(
self
,
layer
):
self
.
layer
=
layer
...
...
@@ -225,8 +136,6 @@ class BandTableWidget(BASE, WIDGET):
item
=
QTreeWidgetItem
()
item
.
setText
(
0
,
v
[
0
])
item
.
setText
(
1
,
v
[
1
])
# color = QColor(int(v[2]), int(v[3]), int(v[4]))
# item.setBackground(2, QBrush(color))
self
.
bandClassTree
.
addTopLevelItem
(
item
)
def
value
(
self
):
...
...
@@ -234,9 +143,6 @@ class BandTableWidget(BASE, WIDGET):
colors
=
''
for
c
in
rColors
:
colors
+=
'{:f}, {:f};'
.
format
(
c
.
minElevation
,
c
.
maxElevation
)
# c.color.red(),
# c.color.green(),
# c.color.blue())
return
colors
[:
-
1
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment