Re: [QGIS-Developer] How to setup Visual Studio 2019 environment for QGIS C++ development?

2020-08-05 Thread Jonas
i managed to create a working dev environment including debugging in
QtCreator with the OSGEO4W libraries. It was quite a hassle to set up though
- but thats maybe because i am totally new to C++/CMake building. Probably
not the OneClick(TM) solution the OP craves for. 

That being said i tried the "open CMake in VS 2017 combined with OSGEO4W
libraries"-solution which still does not really work for me (strange
permission denied and file not found errors).



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Developer-f4099106.html
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] translate plugin gui and log messages

2019-06-19 Thread Jonas
You can just use the pylupdate5 script, its in 
%OSGeo4Win%\apps\Python37\Scripts


It loads your .pro file and creates the .ts files which you can open in 
QtLinguist. After translating you release within QtLinguist to a .qm file.


See: 
https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/plugins.html?highlight=plugin#ts-file



jonas


On 19.06.2019 20:01, C Hamilton wrote:
I am also interested in how you do this on Windows because I had a 
request to add translation ability to the Shape Tools plugin, but 
these instructions don't seem to include anything for Windows.


Thanks,

Calvin

On Wed, Jun 19, 2019 at 2:24 AM matteo <mailto:matteo.ghe...@gmail.com>> wrote:


Hi Roberta,

well the process is pretty easy and straightforward.

I use the Makefile to manage all the process [0].

Basically the steps are:

* adding a list to locales in the Makefile, like: LOCALES = en it nl
* always in the Makefile add all the paths to the files that contains
the string you want to translate (managed by the self.tr
<http://self.tr>() method):

SOURCES = \
        __init__.py \
        plugin.py plugin_dialog.py

UI_FILES = plugin_base.ui

* now you can use make transup to create the ts file in all the
languages
* translate using the software you prefer
* compile the ts in qm using make transcompile

That's it. Whenever you add/change something in the files/UI you
have to
run make transup again, translate, recompile

Cheers

Matteo



[0]

https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/plugins.html#translate-using-makefile
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org <mailto:QGIS-Developer@lists.osgeo.org>
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] translate plugin gui and log messages

2019-06-18 Thread Jonas

Hi Roberta,

You do not mention using the pylupdate program, you should use that to 
create the ts files, because only this way you extract the text strings 
from the python files. Qt Creator does not care about the python scripts 
at all.


see
https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/plugins.html?highlight=plugin#ts-file
https://www.riverbankcomputing.com/static/Docs/PyQt5/i18n.html


Cheers

Jonas


On 18.06.2019 18:47, Roberta Fagandini wrote:

Hi all,
I want to translate both the gui and all the log messages of my plugin 
in a certain language (e.g. Italian). I'm using Qt Creator and Qt 
Linguist.
I created a plugin.pro <http://plugin.pro> file which contains all the 
file with text strings that have to be translated (i.e. my .ui and .py 
files). Then I used Qt Creator to generate the plugin_it.ts file and I 
modified this file with Qt Linguist generating at the end a .qm file.
The translation of the gui (file .ui) works fine but I have problems 
with the translation of the log messages in the .py file.
I marked all the strings that I want to translate putting them inside 
the tr() function but Qt Linguist does not seem to recognize them as 
strings to be translated.

Messages are simple text string appended to a QTextBrowser widget.

The plugin was initially created with the Plugin Builder, therefore I 
have a tr() function, I have imported QTranslator and all the rows 
created by Plugin Builder regarding translation have not been modified.


Any suggestion?

Thanks in advance,
Roberta
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] Approval of my plugin

2019-06-17 Thread Jonas

Got that, thanks! :)

Jonas

On 17.06.2019 14:03, Marco Bernasocchi wrote:


Looks like it's approved

cheers

On 14.06.19 17:25, Jonas wrote:

ugins are approved? I totally understand that
the approval process is run by volunteers and if it just takes its time
thats perfectly fine! But i just want to make sure everything is OK and i
didn't do something wrong or missed a step.

--
Marco Bernasocchi
OPENGIS.ch CEO
QGIS.org Co-chair
ma...@opengis.ch <mailto:ma...@opengis.ch>
+41 (0)79 467 24 70 

OPENGIS.ch Logo <https://www.opengis.ch>
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

[QGIS-Developer] Approval of my plugin

2019-06-14 Thread Jonas
Hello list,

I submitted a new plugin about two weeks ago to the plugin portal, that one: 
https://plugins.qgis.org/plugins/coordinator/
<https://plugins.qgis.org/plugins/coordinator/>  

I was somehow hoping this would have been approved by now, but it isn't. Is
there an estimate when new plugins are approved? I totally understand that
the approval process is run by volunteers and if it just takes its time
thats perfectly fine! But i just want to make sure everything is OK and i
didn't do something wrong or missed a step.

Thanks
Jonas



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Developer-f4099106.html
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] macOS installs -- Lutra

2019-06-05 Thread Jonas
you can also install qgis from the osgeo homebrew repositories which uses
homebrews python

brew tap osgeo/osgeo4mac
brew install osgeo-qgis

be aware that the installation takes a long time (> 2 hours on my laptop) to
install and uses plenty of packages



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Developer-f4099106.html
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] Broken links to PDF manuals

2019-05-10 Thread Jonas
confirmed over her



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Developer-f4099106.html
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] adding vertices to digitize session via python

2019-05-10 Thread Jonas

Hello again,

nevermind, figured it out.

just casting the map tool to QgsMapToolCapture does the trick:

from qgis.core import QgsPointXY from qgis.gui import QgsMapTool, 
QgsMapToolCapturefrom qgis.PyQt import sipmapToolCapture = 
sip.cast(iface.mapCanvas().mapTool(), QgsMapToolCapture) 
mapToolCapture.addVertex(QgsPointXY(1,2))



Cheers

Jonas

On 09.05.2019 12:55, Jonas wrote:

Hi,

is there a way to add vertices to the rubberband when the user 
currently digitizes a feature via the python API?


For example when adding a line feature, the user has already created a 
few vertices of a line via the rubber band. now i want to add the next 
vertex of that rubber band via python. I do NOT want to end the users 
action to create the feature, or add vertices to already existing 
features.


I think that would mean calling addVertex() on a 
QgsMapToolCapture-object. However i cannot find a way to retrieve a 
QgsMapToolCapture-object from the current mapTool.


Is there a way to do this?

Thanks

Jonas



___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

[QGIS-Developer] adding vertices to digitize session via python

2019-05-09 Thread Jonas

Hi,

is there a way to add vertices to the rubberband when the user currently 
digitizes a feature via the python API?


For example when adding a line feature, the user has already created a 
few vertices of a line via the rubber band. now i want to add the next 
vertex of that rubber band via python. I do NOT want to end the users 
action to create the feature, or add vertices to already existing features.


I think that would mean calling addVertex() on a 
QgsMapToolCapture-object. However i cannot find a way to retrieve a 
QgsMapToolCapture-object from the current mapTool.


Is there a way to do this?

Thanks

Jonas


___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

[QGIS-Developer] debug build - DPI assertion fails in qgsmaprenderercustompainterjob.cpp

2018-12-20 Thread Jonas
Hi,

leaving this here, because it happens just in Debug builds:

the assertion in qgsmaprenderercustompainterjob.cpp/line 73 fails on my 
non-retina Mac Book Air when i change the magnification by locking the scale 
and using the trackpad to zoom. changing magnification via the spinner-box is 
just fine.

the assertion check is only enabled in debug builds ( #ifndef QT_NO_DEBUG ) so 
i didn’t want to file a bug report, just FYI.

log output is:
src/gui/qgsmapcanvas.cpp: 1588: (wheelEvent) [3ms] Wheel event delta 2
src/core/qgsmapsettings.cpp: 63: (setMagnificationFactor) [0ms] Magnification 
factor: 1.52486 dpi: 109.79 ratio: 0.983607
src/gui/qgsmapcanvas.cpp: 514: (refresh) [0ms] CANVAS refresh scheduling
src/gui/qgsmapcanvas.cpp: 732: (stopRendering) [11ms] CANVAS stop rendering!
src/core/qgsmaprendererparalleljob.cpp: 115: (cancelWithoutBlocking) [0ms] 
PARALLEL cancel at status 1
src/core/qgsvectorlayerrenderer.cpp: 270: (drawRenderer) [0ms] 
[thread:0x7fe3ab038820] Drawing of vector layer 
Ortsteile_Berlin_3808bce3_0433_4bd1_ab94_24c1a4c2b617 canceled.
src/core/qgsmaprendererparalleljob.cpp: 64: (start) [2ms] QThreadPool max 
thread count is 4
src/core/qgsmaprendererparalleljob.cpp: 222: (renderingFinished) [0ms] PARALLEL 
finished
src/gui/qgsmapcanvas.cpp: 1588: (wheelEvent) [18ms] Wheel event delta 2
src/core/qgsmapsettings.cpp: 63: (setMagnificationFactor) [0ms] Magnification 
factor: 1.55027 dpi: 111.62 ratio: 0.983607
src/gui/qgsmapcanvas.cpp: 514: (refresh) [0ms] CANVAS refresh scheduling
src/gui/qgsmapcanvas.cpp: 732: (stopRendering) [2ms] CANVAS stop rendering!
src/core/qgsmaprendererparalleljob.cpp: 115: (cancelWithoutBlocking) [0ms] 
PARALLEL cancel at status 1
src/core/qgsvectorlayerrenderer.cpp: 270: (drawRenderer) [0ms] 
[thread:0x7fe3ab22a850] Drawing of vector layer 
Ortsteile_Berlin_3808bce3_0433_4bd1_ab94_24c1a4c2b617 canceled.
src/core/qgsmaprendererparalleljob.cpp: 64: (start) [3ms] QThreadPool max 
thread count is 4
src/core/qgsmaprendererparalleljob.cpp: 222: (renderingFinished) [0ms] PARALLEL 
finished
src/core/qgsmaprendererparalleljob.cpp: 201: (renderLayersFinished) [67ms] 
PARALLEL layers finished
src/core/qgsmaprenderercustompainterjob.cpp: 345: (drawLabeling) [1ms] 
[thread:0x7fe3ab263850] Draw labeling took (seconds): 0
src/core/qgsmaprendererparalleljob.cpp: 222: (renderingFinished) [2ms] PARALLEL 
finished
src/core/qgsmaprendererjob.cpp: 439: (cleanupLabelJob) [0ms] caching label 
result image
src/gui/qgsmapcanvas.cpp: 600: (rendererJobFinished) [0ms] CANVAS finish! 1
src/gui/qgsmapcanvas.cpp: 1588: (wheelEvent) [30ms] Wheel event delta 2
src/gui/qgsmapcanvas.cpp: 1588: (wheelEvent) [8ms] Wheel event delta 0
src/gui/qgsmapcanvas.cpp: 1588: (wheelEvent) [0ms] Wheel event delta 0
Fatal: ASSERT failure in Job::startRender(): "pre-set DPI not equal to 
painter's DPI (112 vs 111.62)", file 
src/core/qgsmaprenderercustompainterjob.cpp, line 73
14:24:25: The program has unexpectedly finished.


thanks
Jonas
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] QgsSymbolButton/QgsFontButton no menu?

2018-12-17 Thread Jonas
Hi Nyall,

ok, thank you!

Jonas

> On 15. Dec 2018, at 22:41, Nyall Dawson  wrote:
> 
> On Sat, 15 Dec 2018 at 20:50, Jonas  wrote:
>> 
>> Hi,
>> 
>> i am currently working on fixing the inner paddings of the ToolButtons for
>> Symbols (QgsSymbolButton) and Fonts (QgsFontButton) on non-windows platforms
>> (the fontbutton for macOS has been fixed in
>> https://github.com/qgis/QGIS/pull/8605
>> <https://github.com/qgis/QGIS/pull/8605>  ).
>> 
>> <http://osgeo-org.1560.x6.nabble.com/file/t384296/toolbuttons_2.png>
>> 
>> can somebody explain to me the rationale to have differing icon widths if
>> the button has no menu?
>> 
>> see
>> https://github.com/qgis/QGIS/blob/8a0a745677a8ff2c4631f451c9ed8fd7580ec220/src/gui/qgssymbolbutton.cpp#L468
>> <https://github.com/qgis/QGIS/blob/8a0a745677a8ff2c4631f451c9ed8fd7580ec220/src/gui/qgssymbolbutton.cpp#L468>
> 
> I don't think these are required, and are just remnants of code copied
> originally from the color button. As you've rightly concluded, it's
> not possible to use the font/symbol button widgets without the menus.
> 
> Nyall
> 
>> 
>> i could imagine this would make sense if you could remove the arrow on the
>> right to make the icon wider then, but i actually found no way to do this in
>> c++ or python. but you can remove the menu without removing the arrow (eg
>> setting QgsFontButton.setMenu(None) in PyQGIS) which triggers the
>> alternative styling. it does not make sense but it makes the button look
>> weird and also ... blurry on all platforms ?!??
>> 
>> i would like to fix the padding and think that removing the check altogether
>> is fine, but i am reluctant to move on as i am new around here.
>> 
>> can somebody explain if there is a use case for the non-menu styling? Thanks
>> 
>> Jonas (iona5)
>> 
>> 
>> 
>> 
>> 
>> 
>> --
>> Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Developer-f4099106.html
>> ___
>> QGIS-Developer mailing list
>> QGIS-Developer@lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

[QGIS-Developer] QgsSymbolButton/QgsFontButton no menu?

2018-12-15 Thread Jonas
Hi,

i am currently working on fixing the inner paddings of the ToolButtons for
Symbols (QgsSymbolButton) and Fonts (QgsFontButton) on non-windows platforms
(the fontbutton for macOS has been fixed in 
https://github.com/qgis/QGIS/pull/8605
<https://github.com/qgis/QGIS/pull/8605>  ).

<http://osgeo-org.1560.x6.nabble.com/file/t384296/toolbuttons_2.png> 

can somebody explain to me the rationale to have differing icon widths if
the button has no menu?

see 
https://github.com/qgis/QGIS/blob/8a0a745677a8ff2c4631f451c9ed8fd7580ec220/src/gui/qgssymbolbutton.cpp#L468
<https://github.com/qgis/QGIS/blob/8a0a745677a8ff2c4631f451c9ed8fd7580ec220/src/gui/qgssymbolbutton.cpp#L468>
  

i could imagine this would make sense if you could remove the arrow on the
right to make the icon wider then, but i actually found no way to do this in
c++ or python. but you can remove the menu without removing the arrow (eg
setting QgsFontButton.setMenu(None) in PyQGIS) which triggers the
alternative styling. it does not make sense but it makes the button look
weird and also ... blurry on all platforms ?!??

i would like to fix the padding and think that removing the check altogether
is fine, but i am reluctant to move on as i am new around here.

can somebody explain if there is a use case for the non-menu styling? Thanks

Jonas (iona5)


 



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Developer-f4099106.html
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

[QGIS-Developer] "failed to load!" - loading vector files into pyQGIS (outside QGIS)

2018-03-24 Thread Jonas enok
Hello I am currently trying to learn PyQGIS. At almost the beginning I have 
encountered a problem loading a shapefile into pyqgis, using a standalone 
application (in this case, Pyscripter 3.2.2, 32 bit). I have tried both QGIS 
3.0 (newest OSGeo4w version) and 2.18 standalone with OSGeo4w applications, 
with Python 3.6/2.7 respectively, all being 32 bit. The operating system is 
windows 10 home, 64 bit.

I have tried using several different shapefiles (.shp extensions). They can all 
be loaded into the different versions of QGIS. I have followed 
https://docs.qgis.org/2.14/en/docs/pyqgis_developer_cookbook/loadlayer.html#vector-layers
 , and tried with small variations (changing the path from “/path/to/file.shp” 
to r”path\to\file.shp”) that GIS stack exchange have suggested.

The current python code is:

  1.  from qgis.core import *
  2.  import qgis.utils
  3.  import os
  4.
  5.  QgsApplication.setPrefixPath('C:/qgis218/apps/qgis-ltr', True)
  6.  qgs = QgsApplication([], True)  #has also tried with False
  7.
  8.  qgs.initQgis()
  9.
  10. data_source = r"C:\python_qgis\airport_tutorial\ne_10m_airports.shp"
  11. layer = QgsVectorLayer(data_source, "airports", "ogr")
  12.
  13. if not layer.isValid():
  14. print ("Layer failed to load!")
  15. print "File Path points to a file: ", os.path.isfile(data_source)

(the prefix path is correct according to QGIS’ own python console, using print 
QgsApplication.showSettings() )

The code always returns “layer failed to load!” even though the file path is 
correct.
I would therefore like to ask what might be the problem here? If more 
information is needed, please say.
Thanks in advance!
Best regards,
Jonas

___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer