[QGIS-Developer] UI: dockwidgets in tabwidgets and signals

2019-02-13 Thread Richard Duivenvoorde
Hi Devs,

Minor issue, but while looking at the Tile Scale Widget I see that the
orientation of the slider-widget is supposed to change, see

https://github.com/qgis/QGIS/blob/master/src/providers/wms/qgstilescalewidget.cpp#L115

it is connected to the dockLocationChanged-signal, see

https://github.com/qgis/QGIS/blob/master/src/providers/wms/qgstilescalewidget.cpp#L153

This is nice, but I never have seen that working... apparently I always
pull the full (tabbed?) widget (which encloses the tilescale
dockwidget?) to the top or bottom area.
And then this signal is not called, so the orientation of the slider is
not changed to horizontal with me.

BUT: if you ONLY take the TileScaleWidgetPanel (out of the tabbed one,
grabbig it by the bottom tab), THEN the signal is called and you have a
nice horizontal slider.

Others have seen that?

Question: why is our tilescalewidget not receiving the
dockLocationChanged signal when it is part of another dock.

Is the tabbedDock we dock our panels in supposed to bubble up this
signal and not doing it?

Qt docks write:
This signal is emitted when the dock widget is moved to another dock
area, **or is moved to a different location in its current dock area**.
This happens when the dock widget is moved programmatically or is
dragged to a new location by the user.
https://doc.qt.io/qt-5/qdockwidget.html#dockLocationChanged

But I'm not sure if they mean "within it current dock area" or "when it
is in its current dock area"...

Anyway, I do not think other qgis widgets use this signal but I thought
to ask anyway :-)

Regards,

Richard Duivenvoorde
___
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] Plugin [1640] Aderyn Data Search approval notification.

2019-02-13 Thread noreply

Plugin Aderyn Data Search approval by pcav.
The plugin version "[1640] Aderyn Data Search 0.1 Experimental" is now approved
Link: http://plugins.qgis.org/plugins/aderyn/
___
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 Layer tree embedded widgets programmatically

2019-02-13 Thread Raymond Nijssen

Sorry, forgot to add the link :blush:

https://gis.stackexchange.com/questions/232367/showing-transparency-slider-by-default-in-layers-panel-of-qgis

On 13-02-19 12:59, Raymond Nijssen wrote:

Hi Richard,

Here is some example code. I will try to make it work now.

Groetjes!
Raymond


On 13-02-19 12:37, Richard Duivenvoorde wrote:

Hi Devs,

Thinking about creating a small plugin which would add a 'Layer tree
embedded widget' to a layer in the legend, I hit:

https://github.com/qgis/QGIS/pull/3170

with a nice example on how to create such a widget (with 2 minor tweaks
see below).

But my question is if it is possible (in the python plugin) to attach
such widget to a specific layer? Now it is working but you can only
activate it via the layerproperties dialog.

I could not find a example or hint for it.

Any pointers appreciated.

Regards,

Richard Duivenvoorde

PS

To make Martins example https://github.com/qgis/QGIS/pull/3170) work in
QGIS3:

from PyQt4.QtGui import QComboBox
becomes
from qgis.PyQt.QtWidgets import QComboBox

QgsLayerTreeEmbeddedWidgetRegistry.instance().addProvider(provider)
becomes
QgsGui.layerTreeEmbeddedWidgetRegistry().addProvider(provider)
___
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 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 Layer tree embedded widgets programmatically

2019-02-13 Thread Ricardo Filipe Soares Garcia da
Hi Richard

You can add widgets to a specific layer if you know the widget provider's
id. It is simply a matter of setting up the relevant custom properties.

Take a look at the code in the PR you linked, more specifically here:

https://github.com/qgis/QGIS/pull/3170/files#diff-0c8d41d794f1b84a1291aa29bb39392aR114


For example, the standard widget that provides a transparency slider has an
id of "transparency". Lets imagine I select the current layer in the canvas
and then want to make this widgets appear in its legend:

```python
layer = iface.activeLayer()
layer.setCustomProperty("embeddedWidgets/count", 1)
layer.setCustomProperty("embeddedWidgets/0/id", "transparency")
iface.layerTreeView().refreshLayerSymbology(layer.id())
```

This code assumes that the layer doesn't currently have any embedded
widgets.


P.S. - Now that I've tried it, it seems that the transparency slider works
differently for raster and vector layers.


Richard Duivenvoorde  escreveu no dia quarta,
13/02/2019 à(s) 11:38:

> Hi Devs,
>
> Thinking about creating a small plugin which would add a 'Layer tree
> embedded widget' to a layer in the legend, I hit:
>
> https://github.com/qgis/QGIS/pull/3170
>
> with a nice example on how to create such a widget (with 2 minor tweaks
> see below).
>
> But my question is if it is possible (in the python plugin) to attach
> such widget to a specific layer? Now it is working but you can only
> activate it via the layerproperties dialog.
>
> I could not find a example or hint for it.
>
> Any pointers appreciated.
>
> Regards,
>
> Richard Duivenvoorde
>
> PS
>
> To make Martins example https://github.com/qgis/QGIS/pull/3170) work in
> QGIS3:
>
> from PyQt4.QtGui import QComboBox
> becomes
> from qgis.PyQt.QtWidgets import QComboBox
>
> QgsLayerTreeEmbeddedWidgetRegistry.instance().addProvider(provider)
> becomes
> QgsGui.layerTreeEmbeddedWidgetRegistry().addProvider(provider)
> ___
> 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



-- 
___ ___ __
Ricardo Garcia Silva
___
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] Plugins translation

2019-02-13 Thread Jorge Almerio
Hi devs,

 

For do the plugin translations I use

 

1) Linguist from QT5

2) The command line: 

Pylupdate4 -noobsolete PluginName.pro (Is there a new version 5??)

3) and the classical code:

 

# initialize locale
locale = QSettings().value('locale/userLocale')[0:2]
locale_path = os.path.join(
self.plugin_dir,
'i18n',
'PluginName_{}.qm'.format(locale))

if os.path.exists(locale_path):
self.translator = QTranslator()
self.translator.load(locale_path)

if qVersion() > '4.3.3':

QCoreApplication.installTranslator(self.translator)

 

def tr(self, message):

return QCoreApplication.translate(QWaterPlugin.SETTINGS, message)

 

 

The problem is that the option to use self.tr('message string') is not working. 
It only works when I use QCoreApplication.translate('Escope', 'message string') 
even if a tr function defined.

 

It used to work with linguist from QT4.

 

What  Am I doing wrong? BTW Is there a new better way to translate plugins?

 

Another thing, every time I update the translations strings with Pylupdate4, I 
have to translate all my plugin forms again even without any changes, any 
help???

 

Thanks,

 

Jorge Almerio

 

 

___
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 Layer tree embedded widgets programmatically

2019-02-13 Thread Raymond Nijssen

Hi Richard,

Here is some example code. I will try to make it work now.

Groetjes!
Raymond


On 13-02-19 12:37, Richard Duivenvoorde wrote:

Hi Devs,

Thinking about creating a small plugin which would add a 'Layer tree
embedded widget' to a layer in the legend, I hit:

https://github.com/qgis/QGIS/pull/3170

with a nice example on how to create such a widget (with 2 minor tweaks
see below).

But my question is if it is possible (in the python plugin) to attach
such widget to a specific layer? Now it is working but you can only
activate it via the layerproperties dialog.

I could not find a example or hint for it.

Any pointers appreciated.

Regards,

Richard Duivenvoorde

PS

To make Martins example https://github.com/qgis/QGIS/pull/3170) work in
QGIS3:

from PyQt4.QtGui import QComboBox
becomes
from qgis.PyQt.QtWidgets import QComboBox

QgsLayerTreeEmbeddedWidgetRegistry.instance().addProvider(provider)
becomes
QgsGui.layerTreeEmbeddedWidgetRegistry().addProvider(provider)
___
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] Adding Layer tree embedded widgets programmatically

2019-02-13 Thread Richard Duivenvoorde
Hi Devs,

Thinking about creating a small plugin which would add a 'Layer tree
embedded widget' to a layer in the legend, I hit:

https://github.com/qgis/QGIS/pull/3170

with a nice example on how to create such a widget (with 2 minor tweaks
see below).

But my question is if it is possible (in the python plugin) to attach
such widget to a specific layer? Now it is working but you can only
activate it via the layerproperties dialog.

I could not find a example or hint for it.

Any pointers appreciated.

Regards,

Richard Duivenvoorde

PS

To make Martins example https://github.com/qgis/QGIS/pull/3170) work in
QGIS3:

from PyQt4.QtGui import QComboBox
becomes
from qgis.PyQt.QtWidgets import QComboBox

QgsLayerTreeEmbeddedWidgetRegistry.instance().addProvider(provider)
becomes
QgsGui.layerTreeEmbeddedWidgetRegistry().addProvider(provider)
___
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] Reminder QGIS Voting Member Ballot

2019-02-13 Thread Marco Bernasocchi
This is a gentle reminder that the voting will close tonight.

Thanks for voting
Cheers Marco


On Thu, 7 Feb 2019, 14:03 Marco Bernasocchi,  wrote:

> *Dear QGIS Community we invite you to elect your favorite community voting
> members. One community voting member is appointed in tandem with each QGIS
> Country User Group Voting Member. Due cancellation of two groups and the
> addition of three groups, this year there is only one spot up for vote. The
> purpose of the voting members is to elect the board (ex PSC) and to
> collectively make decisions related to QGIS governance where needed. Please
> note that in my call for nominations I mistakenly wrote that incoming
> community voting members will be selected based on the number of
> nominations they receive, whereas in the form I correctly wrote that we
> would start a ballot. Please read the instructions carefully and establish
> your eligibility to vote which I repeat here for your convenience: "Only
> community members with commit rights to an official QGIS git repository or
> with write access in transifex are eligible to vote nominees”*
>
> *Voting will close on Wednesday 13 February 2019. The voting form is here:
> https://goo.gl/forms/ieqIGSybQJJdcJ1t2
>  *
>
> *If you have any questions about the voting process please do not hesitate
> to contact me Cheers Marco*
>
> --
> Marco Bernasocchi
>
> QGIS.org Co-chairhttp://berna.io
>
>
___
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