Skip to content

Commit

Permalink
add value changed signal for extent parameter widget wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Dec 30, 2018
1 parent e90efda commit 37f14f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion python/plugins/processing/gui/ExtentSelectionPanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from qgis.PyQt import uic
from qgis.PyQt.QtWidgets import QMenu, QAction, QInputDialog
from qgis.PyQt.QtGui import QCursor
from qgis.PyQt.QtCore import QCoreApplication
from qgis.PyQt.QtCore import QCoreApplication, pyqtSignal

from qgis.gui import QgsMessageBar
from qgis.utils import iface
Expand All @@ -56,10 +56,14 @@

class ExtentSelectionPanel(BASE, WIDGET):

hasChanged = pyqtSignal()

def __init__(self, dialog, param):
super(ExtentSelectionPanel, self).__init__(None)
self.setupUi(self)

self.leText.textChanged.connect(lambda: self.hasChanged.emit())

self.dialog = dialog
self.param = param
self.crs = QgsProject.instance().crs()
Expand Down
4 changes: 3 additions & 1 deletion python/plugins/processing/gui/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,9 @@ class ExtentWidgetWrapper(WidgetWrapper):

def createWidget(self):
if self.dialogType in (DIALOG_STANDARD, DIALOG_BATCH):
return ExtentSelectionPanel(self.dialog, self.parameterDefinition())
widget = ExtentSelectionPanel(self.dialog, self.parameterDefinition())
widget.hasChanged.connect(lambda: self.widgetValueHasChanged.emit(self))
return widget
else:
widget = QComboBox()
widget.setEditable(True)
Expand Down

0 comments on commit 37f14f8

Please sign in to comment.