[QGIS-Developer] Is a plugin for QGIS3 with the user interface defined by code acceptable for the repository?

2020-09-06 Thread Luis Eduardo
Hello everyone
I am working on a plugin, I have created a minimal Plugin, the user interface 
(dialog) I have defined by code. Without using Qt Designer.If I would like to 
upload this plugin to the QGIS repository, for the community in general, would 
it be acceptable?
In that case, how can I handle the translation of the interface into different 
languages. Can I do it by code?
I explain, get QSettings by knowing the language uploading the plugin this way. 
Is this acceptable too?
If not, how can I implement QTranslator in this case?

___
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] Issue with determining Symbol size - Bug?

2020-09-06 Thread Nyall Dawson
On Sat, 5 Sep 2020 at 02:16, C Hamilton  wrote:
>
> Try running this code. Make sure you have a point layer selected that is 
> using single symbol symbology. The value that is returned is 0. In my case 
> the units for the symbol are millimeters and a value of 5. I am using QGIS 
> 3.14.15 on windows.
>
> canvas = iface.mapCanvas()
> context = QgsRenderContext.fromMapSettings(canvas.mapSettings())
> lyr = iface.activeLayer()
> rnd = lyr.renderer()
> sym = rnd.symbol()
> sym_size = QgsSymbolLayerUtils.estimateMaxSymbolBleed(sym, context)
> print(sym_size)
>
> I am not sure what estimateMaxSymbolBleed really does, but it doesn't seem to 
> represent symbol size.

Hm - good catch. Turns out it's not implemented for most marker symbol
layer types, only line/polygons. That's simply a result of the
function only being used by core qgis code for line/polygon symbols
currently. We should fix that sometime (PR welcome, ping me if you'd
like assistance!)

Nyall


>
> Thanks,
>
> Calvin
>
>
>
> On Thu, Sep 3, 2020 at 7:13 PM Nyall Dawson  wrote:
>>
>> On Thu, 3 Sep 2020 at 00:06, C Hamilton  wrote:
>> >
>> > Nyall,
>> >
>> > Thanks. This almost gets the right answer. 
>> > QgsSymbolLayerUtils::estimateMaxSymbolBleed is returning 0 as its value.  
>> > I'm not sure what the problem is with it. bounds() seems to work for small 
>> > symbols which is probably all I'll need, but if the symbol is very large 
>> > with a large border and join style set to miter, the bounding box it 
>> > returns is a little too small. My example used an excessively large icon 
>> > and large border which probably would not be used in any real project.
>>
>> Hm - not sure what your issue with estimateMaxSymbolBleed is. Are you
>> using data defined properties at all?
>>
>> Regarding the miter question -- that's something which none of the
>> symbol bounds checking functions currently available account for.
>>
>> Nyall
>>
>> >
>> > Calvin
>> >
>> > On Tue, Sep 1, 2020 at 6:39 PM Nyall Dawson  wrote:
>> >>
>> >> On Wed, 2 Sep 2020 at 03:39, C Hamilton  wrote:
>> >> >
>> >> > I am trying to calculate the size of a single symbol in pixels using:
>> >> >
>> >> > canvas = iface.mapCanvas()
>> >> > context = QgsRenderContext.fromMapSettings(canvas.mapSettings())
>> >> > layer = iface.activeLayer()
>> >> > rnd = layer.renderer()
>> >> > sym = rnd.symbol()
>> >> > scaled_size_in_pixels = context.convertToPainterUnits(
>> >> > sym.size(),
>> >> > sym.sizeUnit(),
>> >> > sym.sizeMapUnitScale() )
>> >> >
>> >> > The last line can also be calculated by:
>> >> >
>> >> >   scaled_size_in_pixels = sym.size(context)
>> >> >
>> >> > I am finding that this is returning the size of the filled area of the 
>> >> > symbol, but it does not include the border. Is this a bug or do I need 
>> >> > to add something additional to include the border?
>> >>
>> >> You can use  QgsSymbolLayerUtils::estimateMaxSymbolBleed if you're
>> >> wanting to calculate the "maximum" bounding box of a rendered symbol.
>> >> That includes any stroke/offset/other settings which also affect the
>> >> rendered bounds.
>> >>
>> >> There's also QgsMarkerSymbol::bounds which returns an approximate
>> >> bounding box of a marker symbol, which also accounts for things like
>> >> the stroke and offset.
>> >>
>> >> Nyall
>> >>
>> >>
>> >> >
>> >> > Thanks,
>> >> >
>> >> > Calvin
>> >> >
>> >> > ___
>> >> > 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

Re: [QGIS-Developer] Library for importing dwg

2020-09-06 Thread Nyall Dawson
On Sat, 5 Sep 2020 at 06:11, Jesús de Diego Alarcón  wrote:
>
> OK Let's try then

FYI there's also libredwg -- https://github.com/LibreDWG/libredwg ,
which is seeing a lot of development focus recently (maybe at some
stage we should abstract out the backend dwg library in qgis to give
users a choice of backend to use for conversion...)

Nyall

>
> Thanks a lot
>
> Jesús de Diego
>
> El vie., 4 sept. 2020 a las 20:10, Andreas Neumann () 
> escribió:
>>
>> Hi Jesús,
>>
>> No - that's a misconception. Despite the name of the library it also reads 
>> DWG files. It's not perfect, but it reads DWG ;-)
>>
>> Greetings,
>>
>> Andreas
>>
>> Am 04.09.20 um 17:43 schrieb Jesús de Diego Alarcón:
>>
>> Hi Andreas
>>
>> First of all, thank you so much for your (quick) answer. I will take a look 
>> but it seems that libdxfrw is working for dxf files, not dwg...Any case I 
>> will take a look.
>>
>> Thanks again
>>
>> Jesús de Diego
>>
>> El vie., 4 sept. 2020 a las 14:48, Andreas Neumann () 
>> escribió:
>>>
>>> Hi,
>>>
>>> It is using the libdxfrw library.
>>>
>>> Jürgen might have forked/patched it though, because activity in the 
>>> original project is basically stalled -  I think you can find our version 
>>> here: https://github.com/qgis/QGIS/tree/master/external/libdxfrw
>>>
>>> Greetings,
>>>
>>> Andreas
>>>
>>> On 2020-09-04 14:38, Jesús de Diego Alarcón wrote:
>>>
>>> Dear all
>>>
>>> I would like to know which library is using QGIS for importing dwg files 
>>> (this functionality is accessible in File >  Import/Export > Importing a 
>>> DXF or DWG file ).
>>>
>>> I had supposed that this functionality was using the newly-developed OGR 
>>> CAD driver... But I have tried with ogr2ogr both command line and Python 
>>> console and dwg files are not supported (at least the same dwf file I am 
>>> able to import with the mentioned functionality).
>>>
>>> Any help will be appreciated. Thank you in advance
>>>
>>> Jesús de Diego
>>>
>>> --
>>> Jesús de Diego Alarcón
>>> jesd...@gmail.com
>>>
>>> "La vida es linda, lo malo es que muchos confunden lindo con fácil."
>>> Mafalda
>>>
>>> ___
>>> 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
>>>
>>>
>>
>>
>> --
>> Jesús de Diego Alarcón
>> jesd...@gmail.com
>>
>> "La vida es linda, lo malo es que muchos confunden lindo con fácil."
>> Mafalda
>
>
>
> --
> Jesús de Diego Alarcón
> jesd...@gmail.com
>
> "La vida es linda, lo malo es que muchos confunden lindo con fácil."
> Mafalda
> ___
> 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

Re: [QGIS-Developer] Processing Question: How to Select All with QgsProcessingParameterField

2020-09-06 Thread Andrea Giudiceandrea
Please keep in mind that defaultToAllFields was introduced with QGIS 3.12, so
it's not available in previous versions.

KML Tools plugin 3.1.0 (declared minimum QGIS version: 3.4.0) with QGIS
3.10:

WARNING Traceback (most recent call last):
File
"C:/Users/io/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\kmltools\exportKmz.py",
line 87, in initAlgorithm
defaultToAllFields=True
TypeError: 'defaultToAllFields' is an unknown keyword argument


Regards.

Andrea Giudiceandrea



C Hamilton wrote
> Nyall,
> 
> Thanks! That is exactly what I was looking for.
> 
> Calvin





--
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] Fwd: Plugin Development for accessing PostgresSQL Database in a QtableWidget in QT Designer

2020-09-06 Thread SOHINI GOSWAMI
Dear Developers,
I would request to kindly help me with building a plugin using Qtablewidget
in QT designer. The table would retrieve a postgresql using a query
[Depending on the date of the date] . I have created the UI file in QT
designer but unable to fetch the data from the buttons click triggers in my
main python plugin file. It would be great if I could get a complete guide
of writing methods on onclick -buttons and retrive the data from Postgres
database.
*Sample  Image of the plugin attempted :*

[image: image.png]

-- 
*Sohini Goswami*
*Executive ,GIS Cell*
*Ph: +918169824459*
*CESC Ventures.*


[image: Mailtrack]

Sender
notified by
Mailtrack

09/04/20,
02:03:36 PM


-- 
*Sohini Goswami*
*Executive ,GIS Cell*
*Ph: +918169824459*
*CESC Ventures.*

[image: Mailtrack]

Sender
notified by
Mailtrack

09/06/20,
11:38:01 PM
___
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] bug or feature? layer_styles table created not in the public schema

2020-09-06 Thread Paolo Cavallini
+1
Cheers

On 6 September 2020 19:18:26 CEST, "Régis Haubourg"  
wrote:
>Hi,
>I'm my opinion, we should add a dialog to let the user choose the
>destination schema. Public schema should really be left untouched by
>default.
>Cheers
>Regis
>
>Le dim. 6 sept. 2020 à 18:26, Giovanni Manghi
> a
>écrit :
>
>> Hi all,
>>
>> On Sat, Sep 5, 2020 at 11:05 PM Paolo Cavallini
>
>> wrote:
>> >
>> > This follows the search_path setting.
>>
>> oh I see. Anyway this case seems possible (even if uncommon), and
>when
>> it happens it leads a user to being cut off from accessing styles
>> stored in public.
>> So my question stands, should this be considered a bug (considered
>> that the QGIS does not allows to choose the schema where to look for
>> styles)?
>>
>> -- G --
>> ___
>> 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

-- 
Please excuse my brevity.___
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] bug or feature? layer_styles table created not in the public schema

2020-09-06 Thread Régis Haubourg
Hi,
I'm my opinion, we should add a dialog to let the user choose the
destination schema. Public schema should really be left untouched by
default.
Cheers
Regis

Le dim. 6 sept. 2020 à 18:26, Giovanni Manghi  a
écrit :

> Hi all,
>
> On Sat, Sep 5, 2020 at 11:05 PM Paolo Cavallini 
> wrote:
> >
> > This follows the search_path setting.
>
> oh I see. Anyway this case seems possible (even if uncommon), and when
> it happens it leads a user to being cut off from accessing styles
> stored in public.
> So my question stands, should this be considered a bug (considered
> that the QGIS does not allows to choose the schema where to look for
> styles)?
>
> -- G --
> ___
> 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

Re: [QGIS-Developer] bug or feature? layer_styles table created not in the public schema

2020-09-06 Thread Giovanni Manghi
Hi all,

On Sat, Sep 5, 2020 at 11:05 PM Paolo Cavallini  wrote:
>
> This follows the search_path setting.

oh I see. Anyway this case seems possible (even if uncommon), and when
it happens it leads a user to being cut off from accessing styles
stored in public.
So my question stands, should this be considered a bug (considered
that the QGIS does not allows to choose the schema where to look for
styles)?

-- G --
___
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