-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Method theme() of QgsMapCanvas not in sync? #27499
Comments
Author Name: Adam Szieberth (@SzieberthAdam) Connects to #27594 It is weird that @qgc.QgsProject.instance().mapThemeCollection()@ can provide the list of map themes and can emit a signal when map theme changed but can not give the current/active/actual map theme. Also I found @applyTheme()@ overcomplicated as I would expect to give the name as a single argument and see the theme changed. |
Author Name: Jürgen Fischer (@jef-n)
|
Author Name: Darius G. (Darius G.) I have installed latest QGIS 3.4 and I have noticed that the bug is still not solved in this version? |
Author Name: Giovanni Manghi (@gioman)
|
Author Name: Darius G. (Darius G.) Bug still in QGIS 3.4.2 not solved. |
Author Name: Giovanni Manghi (@gioman)
|
Author Name: Darius G. (Darius G.) Bug still in QGIS 3.4.3 not solved. |
Author Name: Giovanni Manghi (@gioman)
|
Author Name: Darius G. (Darius G.) Bug still in QGIS 3.4.4 not solved... |
Author Name: Martin Dobias (@wonder-sk) The main map canvas is "special" - it does not have map theme assigned. Instead when you pick a map theme, styles of map layers are modified according to the theme's settings. The theme attribute in QgsMapCanvas is used for other map canvases where user want to follow a specific map theme which is different from the current one. So in fact this is not a bug, but I understand there's some confusion due to the way how the implementation works. To figure out the current map theme (and that's how the map themes menu in qgis does it) is like this:
|
Author Name: Darius G. (Darius G.) Thank you very much for the feedback. I have implemented your procedure and it works.
|
Author Name: Giovanni Manghi (@gioman)
|
Hi all, thanks for the described solution on Feb 26, 2019 - only this appears to be a riddle to me. I just do not understand where to go and what to do. I would be thankful if there would be some explanations, best based on the QGIS UI. |
Author Name: Darius G. (Darius G.)
Original Redmine Issue: 19674
Affected QGIS version: 3.4.3
Redmine category:python_bindings_/_sipify
iface.mapCanvas().theme() refers always to an empty string while user set map themes in the QGIS GUI interactively.
In addition you can also check this:
https://gis.stackexchange.com/questions/293507/how-to-read-out-which-map-theme-is-used-in-qgis-3
Related issue(s): #27594 (relates)
Redmine related issue(s): 19769
The text was updated successfully, but these errors were encountered: