Commit db7e8c58 authored by Benjamin Jakimow's avatar Benjamin Jakimow
Browse files

smaller fixes. added BandStatsSampleSize key

parent 2190a87f
......@@ -480,13 +480,8 @@ class LabelAttributeTypeWidgetDelegate(QStyledItemDelegate):
score = fac.fieldScore(layer, idx)
if score > 0:
w.addItem(fac.name(), key)
return w
def setEditorData(self, editor, index):
cname = self.columnName(index)
model = self.model()
......@@ -612,6 +607,7 @@ class LabelShortcutEditorConfigWidget(QgsEditorConfigWidget):
conf = dict()
conf[CONFKEY_LABELTYPE] = self.mCBShortCutType.currentData()
conf['FIELD_INDEX'] = self.field()
#cs = self.mClassWidget.classificationScheme()
#assert isinstance(cs, ClassificationScheme)
#todo: json for serialization
......@@ -622,6 +618,8 @@ class LabelShortcutEditorConfigWidget(QgsEditorConfigWidget):
def setConfig(self, config:dict):
self.mLastConfig = config
labelType = config.get(CONFKEY_LABELTYPE)
fieldIndex = config.get('FIELD_INDEX')
if not isinstance(labelType, LabelShortcutType):
labelType = LabelShortcutType.Off
......@@ -629,15 +627,8 @@ class LabelShortcutEditorConfigWidget(QgsEditorConfigWidget):
labelType = self.mAllowedShortCuts[0]
i = self.mCBShortCutType.findData(labelType)
#self.mCBShortCutType.currentIndexChanged.connect(self.onIndexChanged)
self.mCBShortCutType.setCurrentIndex(i)
#classScheme = config.get(CONFKEY_CLASSIFICATIONSCHEME)
#if isinstance(classScheme, ClassificationScheme):
# self.mClassWidget.setClassificationScheme(classScheme)
def onIndexChanged(self, *args):
ltype = self.shortcutType()
......@@ -670,10 +661,7 @@ class LabelShortcutEditorWidgetWrapper(QgsEditorWidgetWrapper):
self.mValidator = None
def configLabelType(self) -> LabelShortcutType:
return self.config(CONFKEY_LABELTYPE)
#def configClassificationScheme(self) -> ClassificationScheme:
# return self.config(CONFKEY_CLASSIFICATIONSCHEME)
return self.config().get(CONFKEY_LABELTYPE)
def createWidget(self, parent: QWidget):
"""
......@@ -708,6 +696,16 @@ class LabelShortcutEditorWidgetWrapper(QgsEditorWidgetWrapper):
self.valueChanged.emit(self.value())
s = ""
def config(self) -> dict:
d = dict()
return d
def setConfig(self, conf:dict):
s =""
pass
def valid(self, *args, **kwargs) -> bool:
"""
Returns True if a valid editor widget exists
......@@ -780,7 +778,6 @@ class LabelShortcutWidgetFactory(QgsEditorWidgetFactory):
self.mConfigurations = {}
def name(self) -> str:
return EDITOR_WIDGET_REGISTRY_KEY
......
......@@ -881,8 +881,9 @@ class PlotSettingsTableViewWidgetDelegate(QStyledItemDelegate):
if index.column() == 2:
style: TemporalProfilePlotStyle = index.data(Qt.UserRole)
h = self.mTableView.verticalHeader().defaultSectionSize()
w = self.mTableView.horizontalHeader().defaultSectionSize()
h = self.mTableView.verticalHeader().sectionSize(index.row())
w = self.mTableView.horizontalHeader().sectionSize(index.column())
if h > 0 and w > 0:
px = style.createPixmap(size=QSize(w, h))
label = QLabel()
......@@ -1527,22 +1528,6 @@ class DateTimeViewBox(pg.ViewBox):
self.scene().addParentContextMenus(self, menu, ev)
menu.exec_(ev.screenPos().toPoint())
class ProfileViewDock2(QgsDockWidget):
def __init__(self, parent: QWidget=None):
super().__init__(parent=parent)
from .externals.qps.layerproperties import AttributeTableWidget
# temporal profile collection to store loaded values
self.mTemporalProfileLayer = TemporalProfileLayer()
#self.mTemporalProfileLayer.sigTemporalProfilesAdded.connect(self.onTemporalProfilesAdded)
#self.mTemporalProfileLayer.selectionChanged.connect(self.onTemporalProfileSelectionChanged)
self.mAttributeWidget = AttributeTableWidget(self.mTemporalProfileLayer)
self.mAttributeWidget.widgetLeft.setVisible(True)
self.m
self.setWidget(self.mAttributeWidget)
class ProfileViewDock(QgsDockWidget):
......
......@@ -135,6 +135,9 @@ def value(key:Keys, default=None):
if key == Keys.QgsTaskBlockSize:
value = int(value)
if key == Keys.BandStatsSampleSize:
value = int(value)
if key == Keys.MapUpdateInterval:
value = int(value)
......
......@@ -1112,6 +1112,8 @@ class TimeSeriesFindOverlapTask(QgsTask):
block_size=25):
super().__init__(description=description)
assert block_size >= 1
assert sampleSize >= 1
assert isinstance(extent, SpatialExtent)
self.mBlockSize: int = block_size
self.mTSS: typing.List[TimeSeriesSource] = timeSeriesSources
......
......@@ -158,7 +158,6 @@ class TestLabeling(EOTSVTestCase):
confWidget = reg.createConfigWidget(EDITOR_WIDGET_REGISTRY_KEY, vl, i, parent)
self.assertIsInstance(confWidget, QgsEditorConfigWidget)
editorWidgetWrapper = reg.create(EDITOR_WIDGET_REGISTRY_KEY, vl, i, setup.config(), None, parent)
self.assertIsInstance(editorWidgetWrapper, QgsEditorWidgetWrapper)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment