<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Nov 28, 2016 at 3:44 PM, Matthias Kuhn <span dir="ltr"><<a href="mailto:matthias@opengis.ch" target="_blank">matthias@opengis.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Alessandro,<br>
<br>
QApplication is part of PyQt, did you check if it also changed if you<br>
run a non-QGIS pyqt application?<br></blockquote><div><br><br></div><div>Yes, it seems so:<br></div><div><br>>>> from PyQt5.QtWidgets import QApplication, QWidget<br>>>> a = QApplication([])<br>>>> a.argv()<br>Traceback (most recent call last):<br>  File "<stdin>", line 1, in <module><br>AttributeError: 'QApplication' object has no attribute 'argv'<br><br><br>In [2]: import sys<br>   ...: from PyQt4 import Qt<br>   ...:  <br>   ...: a = Qt.QApplication(sys.argv)<br>   ...: <br><br>In [3]: a.argv()<br>Out[3]: ['/usr/local/bin/ipython']<br><br><br></div><div>Now I wonder if this is a PyQt bug or something changed in Qt itself<br><br></div><div>Is there anything we can do to get the argv/argc in a python script running inside QGIS?<br><br></div><div>This is needed by the testing environment in <a href="https://github.com/boundlessgeo/qgis-testing-environment-docker/blob/master/qgis_testrunner.py#L150">https://github.com/boundlessgeo/qgis-testing-environment-docker/blob/master/qgis_testrunner.py#L150</a><br></div><div>fortunately, there are some workarounds.<br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Matthias<br>
<div><div class="gmail-h5"><br>
On 11/28/2016 03:35 PM, Alessandro Pasotti wrote:<br>
> Hi,<br>
><br>
> the following code is working fine in 2.x but not in master:<br>
><br>
>>>> QgsApplication.instance().<wbr>argv()<br>
> Traceback (most recent call last):<br>
>   File "/usr/lib/python3.5/code.py", line 91, in runcode<br>
>     exec(code, self.locals)<br>
>   File "<input>", line 1, in <module><br>
> AttributeError: 'QApplication' object has no attribute 'argv'<br>
><br>
><br>
> I looked at the sip file but I did not find the reason why it's now<br>
> failing, any idea what has changed in this regard?<br>
><br>
><br>
> --<br>
> Alessandro Pasotti<br>
</div></div>> w3:   <a href="http://www.itopen.it" rel="noreferrer" target="_blank">www.itopen.it</a> <<a href="http://www.itopen.it" rel="noreferrer" target="_blank">http://www.itopen.it</a>><br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> Qgis-developer mailing list<br>
> <a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
> List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
> Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
><br>
______________________________<wbr>_________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Alessandro Pasotti<br>w3:   <a href="http://www.itopen.it" target="_blank">www.itopen.it</a></div>
</div></div>