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
0 votes
1 answer
61 views

How to chose a Vector layer, chose a field, then chose values using parameterAsEnums

I'm coding an archaeological site prediction model. Researchers are able to load multipolygons (i.e. soil type, landform), choose the field to 'weight' or 'rank'. My data has both soil and landform ...
Andrew's user avatar
  • 67
2 votes
1 answer
101 views

AttributeError: 'QgsFieldComboBox' object has no attribute 'setPlaceholderText'

I have a QGIS action to copy field name to clipboard and display a message to the user when copied. I manage to get the field name but when I try to use QComboBox function setPlaceholderText() to ...
dmjf08's user avatar
  • 1,077
6 votes
2 answers
360 views

Filtering QgsCheckableComboBox items in PyQGIS

I have a very long list of values and I would like to make things easier for the user by allowing to filter the items of the QgsCheckableCombobox with a lineEdit for instance. With this code I have ...
zakros's user avatar
  • 347
0 votes
1 answer
97 views

Take the input fields from comboBox and then join both the fields with some expression and store the result in the newly added field

I am trying to take two fields as input fields from QgsFieldComboBox and then I want to join the fields and store the result in another field (to the same layer). I am using QGIS version 3. I want to ...
sahilk's user avatar
  • 89
0 votes
1 answer
71 views

How to retrive field name from selected field in QgsFieldComboBox

I want to read the field name as string format from a QgsFieldComboBox. How to read? I tried like following but not working for some comparison. selectedField = self.dlg.QgsFieldcomboBox.currentField
raaj's user avatar
  • 37
0 votes
1 answer
326 views

How to use QgsFieldComboBox in building QGIS plugin

I am developing a plugin in QGIS which involves the use of QgsFieldComboBox, what I want to do is that the combo box only shows fields(column names from attribute table), and from this ...
raaj's user avatar
  • 37
1 vote
1 answer
53 views

PyQGIS - QComboboxes reciprocally exclusive

I build a QGIS plugin with 2 QComboBox. These comboboxes are populated with the same list of values. Those values come from a query to a PostgreSQL database. When I select a value in the first list, I ...
GeoGyro's user avatar
  • 1,566
6 votes
1 answer
2k 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 ...
Kadir Şahbaz's user avatar
2 votes
2 answers
1k 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() ...
user17818805's user avatar
4 votes
1 answer
275 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 ...
user17818805's user avatar
1 vote
1 answer
309 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() ...
user198471's user avatar
2 votes
1 answer
451 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) ...
IKindaNeedAHand's user avatar
8 votes
1 answer
284 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 ...
Torsten's user avatar
  • 376
4 votes
1 answer
194 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()....
Jo's's user avatar
  • 43
0 votes
1 answer
281 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 ...
Beginner's user avatar
5 votes
1 answer
230 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 ...
Raúl Casado's user avatar
  • 1,059
5 votes
1 answer
472 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() ...
user13892757's user avatar
5 votes
1 answer
235 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 ...
Cinouna's user avatar
  • 135
2 votes
0 answers
84 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 ...
Samuel's user avatar
  • 91
0 votes
1 answer
110 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 ...
Teo's user avatar
  • 11
0 votes
0 answers
35 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 ...
Howeitzer's user avatar
  • 570
5 votes
1 answer
465 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 ...
oekoplaner's user avatar
1 vote
0 answers
204 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 ...
SOHINI GOSWAMI's user avatar
1 vote
0 answers
386 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 ...
Francisco Camello's user avatar
2 votes
1 answer
718 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 ...
E_123's 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,...
Rachel's user avatar
  • 93
1 vote
2 answers
338 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 ...
earthwriter's user avatar
2 votes
1 answer
1k 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 ...
E_123's user avatar
  • 95
2 votes
1 answer
183 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?
Kai Behncke's user avatar
1 vote
0 answers
61 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 ...
tomzappa's user avatar
  • 111
4 votes
1 answer
172 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). ...
DavidP's user avatar
  • 1,333
2 votes
2 answers
1k 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 ...
PolyGeo's user avatar
  • 64.9k
0 votes
0 answers
482 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 = ...
Antonio Padez's user avatar
0 votes
1 answer
125 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 ...
Son of a Beach's user avatar
3 votes
2 answers
260 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 ...
Pavel Pereverzev's user avatar
1 vote
1 answer
59 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 ...
Niko's user avatar
  • 11
1 vote
1 answer
460 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] ...
kbrenn89's user avatar
  • 147
1 vote
0 answers
38 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?
Rob Z's user avatar
  • 11
0 votes
2 answers
4k 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 ...
sur's user avatar
  • 1
1 vote
0 answers
1k 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 ...
Mefimefi's user avatar
  • 586
2 votes
2 answers
350 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-...
muszynov's user avatar
  • 647
3 votes
1 answer
342 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 ...
Mona Coder's user avatar
3 votes
0 answers
97 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 ...
mel's user avatar
  • 103
1 vote
0 answers
324 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 ...
HMadadi's user avatar
  • 1,024
0 votes
2 answers
108 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 ...
Emil Brundage's user avatar
2 votes
1 answer
652 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 ...
banbar's user avatar
  • 959
1 vote
1 answer
1k 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 ...
Ray's user avatar
  • 21
1 vote
1 answer
701 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(...
robson's user avatar
  • 43
1 vote
1 answer
650 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 ...
PolyGeo's user avatar
  • 64.9k
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 ...
user2932466's user avatar