Questions tagged [combo-box]

a control in a form that allows a user to select more than one value

Filter by
Sorted by
Tagged with
6 votes
1 answer
48 views

Disabling automatic selection in QgsMapLayerComboBox

I build a plugin. It has a lot of comboboxes (QgsMapLayerComboBox). They are all empty when no project is loaded. When I open a project in QGIS, a layer is automatically shown in all comboboxes. All ...
user avatar
1 vote
2 answers
412 views

unsupported operand type(s) for +: 'int' and 'QVariant'

Type error :unsupported operand type(s) for +: 'int' and 'QVariant' Traceback (most recent call last): ,line 260, in rac s=s+ar Code : def rac(): cur_prov = self.dlg.comboBox_2.currentText() ...
user avatar
3 votes
1 answer
168 views

Making depending ComboBoxes using PyQGIS

How do I make comboBoxes depending using PyQGIS? I have two comboBoxes one is for selecting the province and the second is about parks (only the parks that belong to the province will be on the second ...
user avatar
0 votes
1 answer
99 views

Populating comboBox with the first column of layer table attribute using PyQGIS

I am new to Python and QGIS. I want to populate the comboBox with the first column of the table attribute of the park's layer Code: #Populate park's comboBox park = layers[0].layer() ...
user avatar
1 vote
1 answer
104 views

Retrieving QgsMapLayerComboBox's currently selected layer to get its name for editing in function

I'm using a qgis plugin with very basic gui with 4 QgsMapLayerComboBoxes, I'll use each one to select a layer. I want to retrieve the currently selected item's name for each combobox (a vector layer) ...
user avatar
7 votes
1 answer
145 views

Database form as QGIS plugin with PyQGIS and QtDesigner

I try to build a QGIS plugin to add data into a SpatiaLite database. All relevant tables are load into the QGIS Layers Panel. At first, I want to select a feature in table_1. This table has geometries ...
user avatar
  • 346
4 votes
1 answer
133 views

List the row of dataframe/attributes in combobox

I am new to QGIS plugin creation. I have created a 3 Combobox like these Combobox, Combobox_1, Combobox_2. I get the data input from Combobox using the lines layers = QgsProject.instance()....
user avatar
  • 43
0 votes
1 answer
167 views

Using only Selected Layer in mMapLayerComboBox

I am building a plugin and so far I have tried simplifying the tasks. But my greatest challenge is making sure that the selected layer in the "mMapLayerComboBox" is what is exactly used in ...
user avatar
5 votes
1 answer
100 views

Fill combobox with NULL values in PyQGIS

I'm writing a plugin that has a form with a combo box that I fill with the unique values in a field of a vector layer in the project. The problem is that there are NULL values in that column and I get ...
user avatar
5 votes
1 answer
272 views

How to put QgsCheckableComboBox() into standby

I'm trying QgsCheckableComboBox() in my simple python script in QGIS. How to pause code execution while a comboBox-window is open (like a dialog box)? In my example, I want to ensure that the print() ...
user avatar
5 votes
1 answer
172 views

Target a specific attribute table

I'm new to PyQGIS and I'm stuck here. So I've created a ComboBox so the user could select which layer he wants to work with. Everything's fine so far. I've also added all layers but now I'm having ...
user avatar
  • 135
2 votes
0 answers
73 views

Conditional value maps in a comboBox using QGIS

I'm using a layer which has some attributes. The first attribute (lets say "Country", for example) has a comboBox and the user can freely choose which value he wants (For example, any ...
user avatar
  • 81
0 votes
1 answer
85 views

Populate a combobox with vector layer name in QGIS 3.X plugin [closed]

I'm updating a QGIS 2.14 Python code plugin to QGIS 3.X. I'm stuck in the attribution of vector name in combobox. The problem is that I don't have any error message but the combobox aren't filled at ...
user avatar
  • 11
0 votes
0 answers
31 views

Error handling for comboboxes in a Python Addin using ArcGIS for Desktop 10.5

I'm creating an addin that contains two comboboxes and a button, the latter of which adds data to the current map based on user selections in both comboboxes. Both comboboxes have pre-defined lists ...
user avatar
  • 560
5 votes
1 answer
323 views

Preselecting value in relation value widget using PyQGIS

I am redesigning my years old form for collecting data in ornithologic field surveys because I finally want to update my tablet for field work from QGIS 2.8 to QGIS 3.10. One attribute contains a ...
user avatar
1 vote
0 answers
138 views

Listing items using QGIS combo box from PostgreSQL

I am building a plugin for QGIS which will have a combo box listing data from PostGreSQL. I have already connected PostGreSQL. Now I would want to make this a plugin and add the list of jobs to the ...
user avatar
1 vote
0 answers
247 views

How to fill a field with comboBox.currentText()

Basically, I want to create a widget plugin (QGIS 3.x) in which any user can choose a standard text from a combo box and, after press a ok button, enable a layer for editing and calls the add feature ...
user avatar
2 votes
1 answer
507 views

Get the whole path and name of selected layer from QcomboBox in QGIS plugin

I am creating a temporary plugin for QGIS using the QGIS plugin builder plugin. Aim is to learn how to make plugins in QGIS. I have added two comboBoxes that allows the user to select a vector layer ...
user avatar
  • 95
3 votes
1 answer
1k views

Filtering by multiple attributes in QGIS

I have a layer that contains multiple attributes in multiple fields that I would like to select between without needing to type out a query each time. I am able to do this with extract by expression,...
user avatar
  • 93
1 vote
2 answers
250 views

Using two Python Addin Combo Boxes to choose Folder then Layer

I am trying to create a Python add-in for ArcMap for users to quickly select layer files from within several different folders. This will require 2 combo boxes. User selects the folder from the first ...
user avatar
2 votes
1 answer
756 views

Connecting ComboBox and pushButton for QGIS plugin

I am creating a QGIS plugin. I have added a combo box and a push button in the plugin. The issue that I am facing is that I want the ComboBox to either allow selection of layers from the layers ...
user avatar
  • 95
2 votes
1 answer
139 views

Value of a ComboBox within a QGroupBox (in a form) by using PyQt5

In QGIS3 I would like to get the current form-value of a ComboBox, that is within a QGroupBox (in the form). I would like to get that value by using PyQt5. Has anybody an idea?
user avatar
1 vote
0 answers
42 views

Qgis python ComboBox: Combination of fixed and free Items

I want to built a ComboBox to select a given plotting scale out of a list or ask for a different scale (e.g. '1:625') as Textinput in the same ComboBox. The combobox is changed to 'editable' and I'm ...
user avatar
  • 111
4 votes
1 answer
153 views

PyQGIS - how to override maximum number of features in combobox

Is there a simple way, how to override a maximum number of displayed features in QgsFeatureListComboBox? It seems that there is a hardcoded limit set to 100 features (in QgsFeatureFilterModel). ...
user avatar
  • 1,268
2 votes
2 answers
871 views

Using two Python Addin Combo Boxes to choose feature class first then field from chosen feature class?

Last night a student from my Udemy course about writing Python AddIns asked for: some tips for using a combo box to filter another combo box. What I am trying to do is use a combo box to select ...
user avatar
  • 63.8k
0 votes
0 answers
387 views

Create a combobox in qgis plugin to input text (string)

I'm developing a plugin in QGIS, with a dialog box where I want to insert text (string) and send to web service soap. I don't found much on the internet. Except this code that i have adapted: qid = ...
user avatar
0 votes
1 answer
109 views

How to avoid ArcMap Python add-in combobox drop-down menu obscuring subsequent UI elements?

My ArcMap (10.5.1) Python add-in uses a combobox. When an item is selected from the combobox's drop-down menu, the expected actions are executed successfully. Sometimes these actions actions can ...
user avatar
3 votes
2 answers
208 views

Pythonaddins combobox advanced functionality

I made an Add-in for ArcMap that shows important news for our company. It is actually a toolbar with combobox and refresh button. It loads news from a text file located in our server and as every user ...
user avatar
1 vote
1 answer
55 views

How to modify combo boxes lists in .esriAddIn, with no access to Visual Studio or SDK

I have an .esriAddIn project made for ArcGIS 10.0, and I want to modify the combo boxes lists with up-to-date values. My organisation has moved forward with Visual Studio 2013, ArcGIS 10.3, and ...
user avatar
  • 11
1 vote
1 answer
418 views

Python Add-In Combo Box Not Working Properly

I am trying to create a python add-in toolbar with a combo box that lists all of the [SITE_NUMBER] values in my "Site Inspection" polygon layer. The user should be able to select a [SITE_NUMBER] ...
user avatar
  • 147
1 vote
0 answers
36 views

Value maps (comboboxes) doesn't follow when exporting to .qlr (layer definition)

I added value maps (comboboxes) to some fields in QGIS 2.18.15 but when exporting to .qlr (layer definition) the comboboxes doesn't follow. Any idea why?
user avatar
  • 11
0 votes
2 answers
3k views

Dynamically adding items into one python addin Combobox from another?

I have two combo boxes. I am trying to add items dynamically into the second combobox from the first combobox's onSelChange(self, selection) event. due to some reason, this is not working. Here is my ...
user avatar
  • 1
1 vote
0 answers
896 views

Unable to store comboBox value via QLineEdit ('list' object has no attribute 'setText')

I am trying to create a QGIS custom form which allows users to select a value (name) among others in a comboBox, and saves said value with its corresponding code (taken from another table in the ...
user avatar
  • 526
2 votes
2 answers
325 views

Debugging Global name ''QgsMapLayerComboBox' is not defined?

I try to develop little plugin for Qgis. I used custom widgets in QT that comes with QGIS 2.18 and loaded QgisMapLayerComboBox. But when I reload my plugin in QGis it gives me an error: 2018-01-...
user avatar
3 votes
1 answer
293 views

Adding Combobox to Python Toolbox tool dialog?

I am trying to create a Python Toolbox tool which is supposed to add two fields State and StateAbb to selected Shapefile from selected combobox. How I can add a Combobox which contains a list of US ...
user avatar
3 votes
0 answers
85 views

Using QGIS comboManager to access attributes from PostGIS

I have been tasked with creating a plugin in QGIS that would connect to a PostGiS database, then let the user (based on its user ID) read the attributes of a table for a particular field, then choose ...
user avatar
  • 103
1 vote
0 answers
294 views

How to fill multi combo box in pyqgis?

I want to select raster layers by a GUI, so I designed a form by Qt designer that can add raster layers in 5 combo boxes. I want when a user select first raster layer in first combo box, and then user ...
user avatar
  • 1,004
0 votes
2 answers
84 views

Get text from user with pythonaddin

I'm trying to figure out the best way to get text input from a user through a pythonaddin. After watching this video it appears that a editable combo box is an option, but it's maybe not ideal due to ...
user avatar
2 votes
1 answer
558 views

PyQGIS - ComboBox - update selection in procedural programming

I have a polygon shapefile (p_cities) and I want to present a simple GUI to the user to select a city from a combobox and that city will be highlighted & zoomed in. The following code does it ...
user avatar
  • 929
1 vote
1 answer
906 views

Add-In Combo Box: populate with specific field's values and pass selection to select by attribute

I checked Passing Selection from Combo Box into Definition Query using Python AddIn?, but I am still stuck on code/syntax. I created a simple add-in with a button that clips and exports tax parcels ...
user avatar
  • 21
1 vote
1 answer
655 views

Making combobox with list of fields (from layer also selected in combobox) in pyQGIS? [duplicate]

I am new to python and pyqqis. I do not have the methods defined in initGUI how do I do? layers = self.iface.legendInterface().layers() layer_list = [] for layer in layers: layer_list.append(...
user avatar
  • 43
1 vote
1 answer
584 views

Refreshing Python AddIn combobox => TypeError: unbound method refresh() must be called with <class> instance as first argument (got nothing instead)?

I have created a minimalist test Python AddIn using ArcGIS 10.4.1 for Desktop, with a toolbar and two comboboxes on it. The code (TestAddIn_addin.py and config.xml) appears at the bottom of this ...
user avatar
  • 63.8k
1 vote
1 answer
1k views

Add and remove map layers using radio buttons

I've struggled to use radio buttons to toggle multiple map service layers. So far it's fine to add but I can't then add another map service and remove the previous at the same time - I just can't ...
user avatar
1 vote
1 answer
1k views

Dynamically editing items in combobox of Python AddIn?

I'm trying to dynamically edit the list of items in a combobox I made using python add in for a toolbar I'm working on. The list is calculated by another button. Here is the relevant code: class ...
user avatar
2 votes
1 answer
898 views

Field list in combobox in pyqgis

I'm new to pyqgis and I'm tryig to make a combobox with list of fields (from layer also selected in combobox). layers = self.iface.legendInterface().layers() layer_list = [] for layer in ...
user avatar
  • 618
0 votes
1 answer
163 views

Unable to populate required data in combobox

I am new in C#, I was given a VB code to migrate in C#. I have done most of it but not able to populate data in COMBOBOX. On clicking the dropdown button, Combobox is blank, on clicking the blank box ...
user avatar
6 votes
1 answer
628 views

Clear combo box in ArcMap Python Add-in

Recently created my first Python Add-In for ArcMap. It has been deployed for about a month now and the users like it. There is one thing I want to fix. The Add-in has two combo boxes: In #1 the ...
user avatar
1 vote
1 answer
977 views

Multi-selection from Combo box in Python AddIn?

Is it possible to select more than one option from a combo box list in python Add ins for ArcGIS 10.x? Here is part of the code: def onFocus(self, focused): if focused: self....
user avatar
  • 11
0 votes
1 answer
285 views

ArcPy Python Addin Combobox How to leave a if-loop, when selection is found

ArcPy Combobox How to leave a if-loop, when selection is found I developed a Combox which: combines values from different featurelayers the User can select an ID or activitycode (acode) the active ...
user avatar
3 votes
1 answer
177 views

Python Addin Wizard Combobox scripting help with zooming to selection

I am coding an addin to allow me to use 3 comboboxes to select specific regions within a state. Once these are all selected in the comboboxes I need a final button to zoom to the selected area, ...
user avatar
  • 31