qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.35k stars 2.98k forks source link

Select from open layers on Processing #18765

Closed qgib closed 5 years ago

qgib commented 10 years ago

Author Name: Pedro Venâncio (Pedro Venâncio) Original Redmine Issue: 10344 Affected QGIS version: master Redmine category:processing/core Assignee: Victor Olaya


Hi,

Using the option "Select from open layers" in the second parameter of any tool in Batch Processing, gives this error, with QGIS master (2.3.0+git20140524+d1da612) and Processing 2.2.0-2:

An error has occured while executing Python code:

Traceback (most recent call last):
  File "/home/pedro/.qgis2/python/plugins/processing/gui/BatchInputSelectionPanel.py", line 93, in showLayerSelectionDialog
    self.text.setText(layers[selected[0]])
TypeError: QLineEdit.setText(QString): argument 1 has unexpected type 'QgsVectorLayer'

Python version:
2.7.6 (default, Mar 22 2014, 23:03:14) 
[GCC 4.8.2]

QGIS version:
2.3.0-Master Master, exported

This does not happens with QGIS 2.2 and Processing 2.2.0-2. Tested on Linux.

To replicate:

  1. Search for "Clip" in Processing Toolbox;
  2. Execute as batch process;
  3. On "Clip layer" -> [...] -> Select from open layers and select one layer from TOC.
qgib commented 10 years ago

Author Name: Pedro Venâncio (Pedro Venâncio)


This is related to #10277.

I already have the commit 9733ae8 applied

            if len(selected) == 1:
                self.text.setText(layers[selected[0]].name())
            else:

but I get this error.

qgib commented 10 years ago

Author Name: Giovanni Manghi (@gioman)


Hi Pedro,

I'm on Ubuntu 12.04 and qgis master (clean install) from nightly build repo and cannot confirm this issue.


qgib commented 10 years ago

Author Name: Pedro Venâncio (Pedro Venâncio)


Hi Giovanni,

This is happening to me with QGIS master on Ubuntu 14.04.

On the machine with Ubuntu 12.04, I'm using QGIS 2.2, and the problem does not happen.

qgib commented 10 years ago

Author Name: Giovanni Manghi (@gioman)


Pedro Venâncio wrote:

Hi Giovanni,

This is happening to me with QGIS master on Ubuntu 14.04.

On the machine with Ubuntu 12.04, I'm using QGIS 2.2, and the problem does not happen.

Olá Pedro,

I just installed qgis master (nightly repo) on a brand new 14.04 virtual machine and cannot replicate the issue.

qgib commented 10 years ago

Author Name: Pedro Venâncio (Pedro Venâncio)


Olá Giovanni,

Sorry, I checked the correction of the commit in the Core Processing folder, instead of Processing folder in .qgis2.

So, commit 9733ae8 solves the problem!

Thanks and sorry for the noise!


qgib commented 9 years ago

Author Name: Giovanni Manghi (@gioman)