Skip to content
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

Make a new global QgsGui singleton #4514

Merged
merged 7 commits into from
May 14, 2017
Merged

Conversation

nyalldawson
Copy link
Collaborator

This PR implements a new QgsGui global singleton, which itself contains members replacing the other existing gui singletons.

I.e. instead of QgsEditorWidgetRegistry, QgsShortcutsManager, etc singletons, instead we have a global QgsGui singleton with these instances as members.

This is driven by:

  1. Ongoing removal of singleton effort. While this approach DOES introduce a new singleton, it avoids some of the issues with the current isolated singleton approach by allowing us to manually construct and destruct the members in a logical order.
  2. There's a need for some form of gui singleton. Add OS native interface lib, with objective-c++ interface to Mac Cocoa ibraries #3964 is blocked by the need for some global container within gui to contain the native interface class/QObject.

@m-kuhn
Copy link
Member

m-kuhn commented May 12, 2017

Are there open questions regarding this?
I think the approach is fine in general 👍

Move QgsEditorWidgetRegistry from being a singleton itself to
instead being a member of the QgsGui singleton
Move the global instance to QgsGui::shortcutsManager()
Moved the global instance to QgsGui::layerTreeEmbeddedWidgetRegistry()
Moved the global instance to QgsGui::QgsMapLayerActionRegistry()
Better reflects what this namespace contains, and replaces the
non-standard Qgis prefix with the Qgs standard
@nyalldawson
Copy link
Collaborator Author

Are there open questions regarding this?

Only the name really. I'll merge for now and it'll be easy enough to rename later if we decide on a better one.

@nyalldawson nyalldawson merged commit f8f7d60 into qgis:master May 14, 2017
@nyalldawson nyalldawson deleted the gui_instance branch May 14, 2017 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants