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
5
votes
1answer
28 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 ...
1
vote
2answers
107 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() ...
2
votes
1answer
151 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 ...
0
votes
1answer
53 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() ...
1
vote
1answer
32 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) ...
6
votes
1answer
96 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 ...
4
votes
1answer
104 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()....
0
votes
1answer
126 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 ...
5
votes
1answer
66 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 ...
5
votes
1answer
186 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() ...
5
votes
1answer
133 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 ...
2
votes
0answers
70 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 ...
0
votes
1answer
57 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 ...
0
votes
0answers
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 ...
5
votes
1answer
274 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 ...
1
vote
0answers
121 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 ...
1
vote
0answers
210 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 ...
2
votes
1answer
450 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 ...
3
votes
1answer
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,...
1
vote
2answers
192 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 ...
2
votes
1answer
650 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 ...
2
votes
1answer
119 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?
1
vote
0answers
41 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 ...
4
votes
1answer
117 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). ...
2
votes
2answers
777 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 ...
0
votes
0answers
343 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 = ...
0
votes
1answer
104 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 ...
3
votes
2answers
191 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 ...
1
vote
1answer
52 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 ...
1
vote
1answer
402 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] ...
1
vote
0answers
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?
0
votes
2answers
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 ...
1
vote
0answers
796 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 ...
2
votes
2answers
305 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-...
3
votes
1answer
265 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 ...
3
votes
0answers
81 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 ...
1
vote
0answers
279 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 ...
0
votes
2answers
79 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 ...
2
votes
1answer
524 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 ...
1
vote
1answer
869 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 ...
1
vote
1answer
620 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(...
1
vote
1answer
558 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 ...
1
vote
1answer
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 ...
1
vote
1answer
965 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 ...
2
votes
1answer
839 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 ...
0
votes
1answer
155 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 ...
6
votes
1answer
611 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 ...
1
vote
1answer
912 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....
0
votes
1answer
274 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 ...
3
votes
1answer
166 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, ...