{"action":"created","comment":{"url":"https://api.github.com/repos/qgis/QGIS/pulls/comments/91267519","pull_request_review_id":11774962,"id":91267519,"diff_hunk":"@@ -341,11 +344,14 @@ void QgsAttributeTableModel::loadAttributes()\n   {\n     const QgsEditorWidgetSetup setup = QgsEditorWidgetRegistry::instance()->findBest( layer(), fields[idx].name() );\n     QgsEditorWidgetFactory* widgetFactory = QgsEditorWidgetRegistry::instance()->factory( setup.type() );\n+    QgsFieldFormatter* fieldKit = QgsApplication::fieldKitRegistry()->fieldKit( setup.type() );\n+\n     if ( widgetFactory )\n     {\n       mWidgetFactories.append( widgetFactory );\n       mWidgetConfigs.append( setup.config() );\n-      mAttributeWidgetCaches.append( widgetFactory->createCache( layer(), idx, setup.config() ) );\n+      mAttributeWidgetCaches.append( fieldKit->createCache( layer(), idx, setup.config() ) );\n+      mFieldFormatters.append( fieldKit );","path":"src/gui/attributetable/qgsattributetablemodel.cpp","position":64,"original_position":64,"commit_id":"9689692a18611886c573a43eeb588a11c7162ef7","original_commit_id":"192adb6100acb059c29c33858b21ab056d61f2fc","user":{"login":"m-kuhn","id":588407,"avatar_url":"https://avatars.githubusercontent.com/u/588407?v=3","gravatar_id":"","url":"https://api.github.com/users/m-kuhn","html_url":"https://github.com/m-kuhn","followers_url":"https://api.github.com/users/m-kuhn/followers","following_url":"https://api.github.com/users/m-kuhn/following{/other_user}","gists_url":"https://api.github.com/users/m-kuhn/gists{/gist_id}","starred_url":"https://api.github.com/users/m-kuhn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m-kuhn/subscriptions","organizations_url":"https://api.github.com/users/m-kuhn/orgs","repos_url":"https://api.github.com/users/m-kuhn/repos","events_url":"https://api.github.com/users/m-kuhn/events{/privacy}","received_events_url":"https://api.github.com/users/m-kuhn/received_events","type":"User","site_admin":false},"body":"That leads to trouble with python binding.\r\nListening to fieldFormatterRemoved would be another possibility.","created_at":"2016-12-07T10:43:47Z","updated_at":"2016-12-07T10:43:47Z","html_url":"https://github.com/qgis/QGIS/pull/3836#discussion_r91267519","pull_request_url":"https://api.github.com/repos/qgis/QGIS/pulls/3836","_links":{"self":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/comments/91267519"},"html":{"href":"https://github.com/qgis/QGIS/pull/3836#discussion_r91267519"},"pull_request":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/3836"}}},"pull_request":{"url":"https://api.github.com/repos/qgis/QGIS/pulls/3836","id":96529692,"html_url":"https://github.com/qgis/QGIS/pull/3836","diff_url":"https://github.com/qgis/QGIS/pull/3836.diff","patch_url":"https://github.com/qgis/QGIS/pull/3836.patch","issue_url":"https://api.github.com/repos/qgis/QGIS/issues/3836","number":3836,"state":"open","locked":false,"title":"Split editor widget configuration between core/gui libraries","user":{"login":"m-kuhn","id":588407,"avatar_url":"https://avatars.githubusercontent.com/u/588407?v=3","gravatar_id":"","url":"https://api.github.com/users/m-kuhn","html_url":"https://github.com/m-kuhn","followers_url":"https://api.github.com/users/m-kuhn/followers","following_url":"https://api.github.com/users/m-kuhn/following{/other_user}","gists_url":"https://api.github.com/users/m-kuhn/gists{/gist_id}","starred_url":"https://api.github.com/users/m-kuhn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m-kuhn/subscriptions","organizations_url":"https://api.github.com/users/m-kuhn/orgs","repos_url":"https://api.github.com/users/m-kuhn/repos","events_url":"https://api.github.com/users/m-kuhn/events{/privacy}","received_events_url":"https://api.github.com/users/m-kuhn/received_events","type":"User","site_admin":false},"body":"With QGIS 2.x, the configuration for editor widgets was always saved and loaded in code which is part of the gui library. This configuration has also been used for functionality which was not necessarily linked to widgets.\r\n\r\nThis code has been split apart into a similar system in core. A `QgsFieldKit` manages a configuration for a field type (e.g. there's a field kit for \"ValueMap\", \"RelationReference\"...), all `QgsFieldKit`s are managed by a `QgsFieldKitRegistry`.\r\n\r\nThe following functionality is offered by a `QgsFieldKit`:\r\n\r\n * sort order for the field (alphabetic vs. numeric etc.)\r\n * value representation (e.g. resolve ValueMaps)\r\n * alignment (right alignment for numbers etc.)\r\n\r\nThis should especially help to drop the dependency on gui from qgis server.\r\n\r\nQgsConfigurationMap\r\n----------------------------\r\n\r\nThere is also a neat new class `QgsConfigurationMap` which allows to store arbitrary hierarchic configuration's to Xml while it can be used as `QVariantMap` at runtime, which preserves the type of the configuration. This is generic enough to be used by other parts of the code (e.g. expression variables could build on top of that).\r\n\r\n```\r\nmy_properties = {\r\n                 'a_boolean_flag': True,\r\n                 'the_int': 3,\r\n                 'map': {\r\n                     'a': 1,\r\n                     'b': 'welcome to flexible options'\r\n                 }\r\n}\r\n\r\nconfig_map = QgsConfigurationMap(my_properties)\r\n\r\ndoc = QDomDocument(\"properties\")\r\nelement = doc.createElement(\"test\")\r\ndoc.appendChild(element)\r\n\r\nconfig_map.toXml(element)\r\n\r\nprint(doc.toString())\r\n\r\n--- output ---\r\n<!DOCTYPE properties>\r\n<test type=\"Map\">\r\n <Option type=\"Bool\" value=\"true\" name=\"a_boolean_flag\"/>\r\n <Option type=\"Map\" name=\"map\">\r\n  <Option type=\"Int\" value=\"1\" name=\"a\"/>\r\n  <Option type=\"String\" value=\"welcome to flexible options\" name=\"b\"/>\r\n </Option>\r\n <Option type=\"Int\" value=\"3\" name=\"the_int\"/>\r\n</test>\r\n```","created_at":"2016-12-05T13:36:27Z","updated_at":"2016-12-07T10:43:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8a941efb203a9d568edd4e18b631398e1040a8c9","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/qgis/QGIS/milestones/9","html_url":"https://github.com/qgis/QGIS/milestones/QGIS%203","labels_url":"https://api.github.com/repos/qgis/QGIS/milestones/9/labels","id":1468273,"number":9,"title":"QGIS 3","description":"Code which requires an API change or contains other modifications which is not acceptable without a major version number change.","creator":{"login":"m-kuhn","id":588407,"avatar_url":"https://avatars.githubusercontent.com/u/588407?v=3","gravatar_id":"","url":"https://api.github.com/users/m-kuhn","html_url":"https://github.com/m-kuhn","followers_url":"https://api.github.com/users/m-kuhn/followers","following_url":"https://api.github.com/users/m-kuhn/following{/other_user}","gists_url":"https://api.github.com/users/m-kuhn/gists{/gist_id}","starred_url":"https://api.github.com/users/m-kuhn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m-kuhn/subscriptions","organizations_url":"https://api.github.com/users/m-kuhn/orgs","repos_url":"https://api.github.com/users/m-kuhn/repos","events_url":"https://api.github.com/users/m-kuhn/events{/privacy}","received_events_url":"https://api.github.com/users/m-kuhn/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":15,"state":"open","created_at":"2015-12-20T10:10:21Z","updated_at":"2016-12-05T13:37:37Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/qgis/QGIS/pulls/3836/commits","review_comments_url":"https://api.github.com/repos/qgis/QGIS/pulls/3836/comments","review_comment_url":"https://api.github.com/repos/qgis/QGIS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/qgis/QGIS/issues/3836/comments","statuses_url":"https://api.github.com/repos/qgis/QGIS/statuses/9689692a18611886c573a43eeb588a11c7162ef7","head":{"label":"m-kuhn:editwidgetCoreGui","ref":"editwidgetCoreGui","sha":"9689692a18611886c573a43eeb588a11c7162ef7","user":{"login":"m-kuhn","id":588407,"avatar_url":"https://avatars.githubusercontent.com/u/588407?v=3","gravatar_id":"","url":"https://api.github.com/users/m-kuhn","html_url":"https://github.com/m-kuhn","followers_url":"https://api.github.com/users/m-kuhn/followers","following_url":"https://api.github.com/users/m-kuhn/following{/other_user}","gists_url":"https://api.github.com/users/m-kuhn/gists{/gist_id}","starred_url":"https://api.github.com/users/m-kuhn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m-kuhn/subscriptions","organizations_url":"https://api.github.com/users/m-kuhn/orgs","repos_url":"https://api.github.com/users/m-kuhn/repos","events_url":"https://api.github.com/users/m-kuhn/events{/privacy}","received_events_url":"https://api.github.com/users/m-kuhn/received_events","type":"User","site_admin":false},"repo":{"id":5270567,"name":"QGIS","full_name":"m-kuhn/QGIS","owner":{"login":"m-kuhn","id":588407,"avatar_url":"https://avatars.githubusercontent.com/u/588407?v=3","gravatar_id":"","url":"https://api.github.com/users/m-kuhn","html_url":"https://github.com/m-kuhn","followers_url":"https://api.github.com/users/m-kuhn/followers","following_url":"https://api.github.com/users/m-kuhn/following{/other_user}","gists_url":"https://api.github.com/users/m-kuhn/gists{/gist_id}","starred_url":"https://api.github.com/users/m-kuhn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m-kuhn/subscriptions","organizations_url":"https://api.github.com/users/m-kuhn/orgs","repos_url":"https://api.github.com/users/m-kuhn/repos","events_url":"https://api.github.com/users/m-kuhn/events{/privacy}","received_events_url":"https://api.github.com/users/m-kuhn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/m-kuhn/QGIS","description":"QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)","fork":true,"url":"https://api.github.com/repos/m-kuhn/QGIS","forks_url":"https://api.github.com/repos/m-kuhn/QGIS/forks","keys_url":"https://api.github.com/repos/m-kuhn/QGIS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/m-kuhn/QGIS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/m-kuhn/QGIS/teams","hooks_url":"https://api.github.com/repos/m-kuhn/QGIS/hooks","issue_events_url":"https://api.github.com/repos/m-kuhn/QGIS/issues/events{/number}","events_url":"https://api.github.com/repos/m-kuhn/QGIS/events","assignees_url":"https://api.github.com/repos/m-kuhn/QGIS/assignees{/user}","branches_url":"https://api.github.com/repos/m-kuhn/QGIS/branches{/branch}","tags_url":"https://api.github.com/repos/m-kuhn/QGIS/tags","blobs_url":"https://api.github.com/repos/m-kuhn/QGIS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/m-kuhn/QGIS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/m-kuhn/QGIS/git/refs{/sha}","trees_url":"https://api.github.com/repos/m-kuhn/QGIS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/m-kuhn/QGIS/statuses/{sha}","languages_url":"https://api.github.com/repos/m-kuhn/QGIS/languages","stargazers_url":"https://api.github.com/repos/m-kuhn/QGIS/stargazers","contributors_url":"https://api.github.com/repos/m-kuhn/QGIS/contributors","subscribers_url":"https://api.github.com/repos/m-kuhn/QGIS/subscribers","subscription_url":"https://api.github.com/repos/m-kuhn/QGIS/subscription","commits_url":"https://api.github.com/repos/m-kuhn/QGIS/commits{/sha}","git_commits_url":"https://api.github.com/repos/m-kuhn/QGIS/git/commits{/sha}","comments_url":"https://api.github.com/repos/m-kuhn/QGIS/comments{/number}","issue_comment_url":"https://api.github.com/repos/m-kuhn/QGIS/issues/comments{/number}","contents_url":"https://api.github.com/repos/m-kuhn/QGIS/contents/{+path}","compare_url":"https://api.github.com/repos/m-kuhn/QGIS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/m-kuhn/QGIS/merges","archive_url":"https://api.github.com/repos/m-kuhn/QGIS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/m-kuhn/QGIS/downloads","issues_url":"https://api.github.com/repos/m-kuhn/QGIS/issues{/number}","pulls_url":"https://api.github.com/repos/m-kuhn/QGIS/pulls{/number}","milestones_url":"https://api.github.com/repos/m-kuhn/QGIS/milestones{/number}","notifications_url":"https://api.github.com/repos/m-kuhn/QGIS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/m-kuhn/QGIS/labels{/name}","releases_url":"https://api.github.com/repos/m-kuhn/QGIS/releases{/id}","deployments_url":"https://api.github.com/repos/m-kuhn/QGIS/deployments","created_at":"2012-08-02T09:19:28Z","updated_at":"2016-09-08T21:00:13Z","pushed_at":"2016-12-07T10:30:45Z","git_url":"git://github.com/m-kuhn/QGIS.git","ssh_url":"git@github.com:m-kuhn/QGIS.git","clone_url":"https://github.com/m-kuhn/QGIS.git","svn_url":"https://github.com/m-kuhn/QGIS","homepage":"http://qgis.org","size":1177459,"stargazers_count":4,"watchers_count":4,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":19,"forks":1,"open_issues":19,"watchers":4,"default_branch":"master"}},"base":{"label":"qgis:master","ref":"master","sha":"ea661e5e3ccf6cc832006d98c35d21ccbebadfd1","user":{"login":"qgis","id":483444,"avatar_url":"https://avatars.githubusercontent.com/u/483444?v=3","gravatar_id":"","url":"https://api.github.com/users/qgis","html_url":"https://github.com/qgis","followers_url":"https://api.github.com/users/qgis/followers","following_url":"https://api.github.com/users/qgis/following{/other_user}","gists_url":"https://api.github.com/users/qgis/gists{/gist_id}","starred_url":"https://api.github.com/users/qgis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qgis/subscriptions","organizations_url":"https://api.github.com/users/qgis/orgs","repos_url":"https://api.github.com/users/qgis/repos","events_url":"https://api.github.com/users/qgis/events{/privacy}","received_events_url":"https://api.github.com/users/qgis/received_events","type":"Organization","site_admin":false},"repo":{"id":1690480,"name":"QGIS","full_name":"qgis/QGIS","owner":{"login":"qgis","id":483444,"avatar_url":"https://avatars.githubusercontent.com/u/483444?v=3","gravatar_id":"","url":"https://api.github.com/users/qgis","html_url":"https://github.com/qgis","followers_url":"https://api.github.com/users/qgis/followers","following_url":"https://api.github.com/users/qgis/following{/other_user}","gists_url":"https://api.github.com/users/qgis/gists{/gist_id}","starred_url":"https://api.github.com/users/qgis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qgis/subscriptions","organizations_url":"https://api.github.com/users/qgis/orgs","repos_url":"https://api.github.com/users/qgis/repos","events_url":"https://api.github.com/users/qgis/events{/privacy}","received_events_url":"https://api.github.com/users/qgis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/qgis/QGIS","description":"QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)","fork":false,"url":"https://api.github.com/repos/qgis/QGIS","forks_url":"https://api.github.com/repos/qgis/QGIS/forks","keys_url":"https://api.github.com/repos/qgis/QGIS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qgis/QGIS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qgis/QGIS/teams","hooks_url":"https://api.github.com/repos/qgis/QGIS/hooks","issue_events_url":"https://api.github.com/repos/qgis/QGIS/issues/events{/number}","events_url":"https://api.github.com/repos/qgis/QGIS/events","assignees_url":"https://api.github.com/repos/qgis/QGIS/assignees{/user}","branches_url":"https://api.github.com/repos/qgis/QGIS/branches{/branch}","tags_url":"https://api.github.com/repos/qgis/QGIS/tags","blobs_url":"https://api.github.com/repos/qgis/QGIS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qgis/QGIS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qgis/QGIS/git/refs{/sha}","trees_url":"https://api.github.com/repos/qgis/QGIS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qgis/QGIS/statuses/{sha}","languages_url":"https://api.github.com/repos/qgis/QGIS/languages","stargazers_url":"https://api.github.com/repos/qgis/QGIS/stargazers","contributors_url":"https://api.github.com/repos/qgis/QGIS/contributors","subscribers_url":"https://api.github.com/repos/qgis/QGIS/subscribers","subscription_url":"https://api.github.com/repos/qgis/QGIS/subscription","commits_url":"https://api.github.com/repos/qgis/QGIS/commits{/sha}","git_commits_url":"https://api.github.com/repos/qgis/QGIS/git/commits{/sha}","comments_url":"https://api.github.com/repos/qgis/QGIS/comments{/number}","issue_comment_url":"https://api.github.com/repos/qgis/QGIS/issues/comments{/number}","contents_url":"https://api.github.com/repos/qgis/QGIS/contents/{+path}","compare_url":"https://api.github.com/repos/qgis/QGIS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qgis/QGIS/merges","archive_url":"https://api.github.com/repos/qgis/QGIS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qgis/QGIS/downloads","issues_url":"https://api.github.com/repos/qgis/QGIS/issues{/number}","pulls_url":"https://api.github.com/repos/qgis/QGIS/pulls{/number}","milestones_url":"https://api.github.com/repos/qgis/QGIS/milestones{/number}","notifications_url":"https://api.github.com/repos/qgis/QGIS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qgis/QGIS/labels{/name}","releases_url":"https://api.github.com/repos/qgis/QGIS/releases{/id}","deployments_url":"https://api.github.com/repos/qgis/QGIS/deployments","created_at":"2011-05-02T08:06:26Z","updated_at":"2016-12-06T13:25:30Z","pushed_at":"2016-12-07T10:30:46Z","git_url":"git://github.com/qgis/QGIS.git","ssh_url":"git@github.com:qgis/QGIS.git","clone_url":"https://github.com/qgis/QGIS.git","svn_url":"https://github.com/qgis/QGIS","homepage":"http://qgis.org","size":1291930,"stargazers_count":1188,"watchers_count":1188,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":952,"mirror_url":null,"open_issues_count":55,"forks":952,"open_issues":55,"watchers":1188,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/3836"},"html":{"href":"https://github.com/qgis/QGIS/pull/3836"},"issue":{"href":"https://api.github.com/repos/qgis/QGIS/issues/3836"},"comments":{"href":"https://api.github.com/repos/qgis/QGIS/issues/3836/comments"},"review_comments":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/3836/comments"},"review_comment":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/3836/commits"},"statuses":{"href":"https://api.github.com/repos/qgis/QGIS/statuses/9689692a18611886c573a43eeb588a11c7162ef7"}}}}
{"actor":{"display_login":"m-kuhn"}}