Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSAMPERE committed Jun 26, 2023
1 parent b4b5899 commit 8c91781
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 12 deletions.
1 change: 1 addition & 0 deletions modules/results/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ def show_results(self, api_results):
# Else, add a combobox, storing all possibilities.
else:
combo = QComboBox()
combo.installEventFilter(self.form_mng)
for option in add_options_dict:
option_type = option.split(" : ")[0]
# services
Expand Down
12 changes: 11 additions & 1 deletion modules/search_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from qgis.utils import iface

# PyQT
from qgis.PyQt.QtCore import pyqtSignal, QSettings, Qt
from qgis.PyQt.QtCore import pyqtSignal, QSettings, Qt, QEvent
from qgis.PyQt.QtWidgets import QComboBox
from qgis.PyQt.QtGui import QIcon, QStandardItem

Expand Down Expand Up @@ -77,6 +77,10 @@ def __init__(self, trad):

self.tr = trad

# disable wheel event on combobox
for cbb in self.findChildren(QComboBox):
cbb.installEventFilter(self)

# match between widgets and metadata fields
self.match_widget_field = {
self.cbb_type: "datatype",
Expand Down Expand Up @@ -135,6 +139,12 @@ def __init__(self, trad):
# Setting result manager
self.results_mng = ResultsManager(self)

def eventFilter(self, obj, event): # https://github.com/isogeo/isogeo-plugin-qgis/issues/455
if event.type() == QEvent.Wheel:
return True
else:
return False

def update_cbb_keywords(self, tags_keywords: dict = {}, selected_keywords: list = []):
"""Keywords combobox is specific because items are checkable.
See: https://github.com/isogeo/isogeo-plugin-qgis/issues/159
Expand Down
45 changes: 39 additions & 6 deletions ui/isogeo_dockwidget_base.ui
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<property name="minimumSize">
<size>
<width>572</width>
<height>611</height>
<height>612</height>
</size>
</property>
<property name="maximumSize">
Expand Down Expand Up @@ -236,7 +236,7 @@
</font>
</property>
<property name="styleSheet">
<string notr="true">QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 5px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}</string>
<string notr="true">QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 5px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}</string>
</property>
<property name="title">
<string>Advanced search</string>
Expand Down Expand Up @@ -364,6 +364,9 @@
<pointsize>9</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
</property>
<property name="currentIndex">
<number>-1</number>
</property>
Expand Down Expand Up @@ -460,6 +463,9 @@
<pointsize>9</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
</property>
<property name="maxVisibleItems">
<number>15</number>
</property>
Expand All @@ -471,8 +477,8 @@
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
Expand Down Expand Up @@ -566,6 +572,9 @@
<pointsize>9</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
</property>
<property name="maxVisibleItems">
<number>15</number>
</property>
Expand Down Expand Up @@ -666,6 +675,9 @@
<pointsize>9</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
</property>
<property name="maxVisibleItems">
<number>15</number>
</property>
Expand Down Expand Up @@ -768,6 +780,9 @@
<pointsize>9</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
</property>
<property name="maxVisibleItems">
<number>15</number>
</property>
Expand Down Expand Up @@ -896,6 +911,9 @@
<pointsize>9</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
</property>
<property name="editable">
<bool>true</bool>
</property>
Expand Down Expand Up @@ -995,6 +1013,9 @@
<pointsize>9</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
</property>
<property name="maxVisibleItems">
<number>15</number>
</property>
Expand Down Expand Up @@ -1095,6 +1116,9 @@
<pointsize>9</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
</property>
<property name="maxVisibleItems">
<number>15</number>
</property>
Expand Down Expand Up @@ -1195,6 +1219,9 @@
<pointsize>9</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
</property>
<property name="maxVisibleItems">
<number>15</number>
</property>
Expand Down Expand Up @@ -1291,6 +1318,9 @@
<pointsize>9</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
</property>
<property name="maxVisibleItems">
<number>15</number>
</property>
Expand Down Expand Up @@ -1520,6 +1550,9 @@
<bold>false</bold>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
</property>
<property name="toolTip">
<string>Quick searches</string>
</property>
Expand Down Expand Up @@ -2427,13 +2460,13 @@
<enum>Qt::NoFocus</enum>
</property>
<property name="styleSheet">
<string notr="true">QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 5px; margin-right: 5px; left: 0px; top: 3px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}</string>
<string notr="true">QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 5px; margin-right: 5px; left: 0px; top: 3px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;} QgsCollapsibleGroupBoxBasic { border: none; }QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}</string>
</property>
<property name="title">
<string>Advanced resources</string>
</property>
<property name="collapsed">
<bool>false</bool>
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_9">
<property name="leftMargin">
Expand Down
Loading

0 comments on commit 8c91781

Please sign in to comment.