{"action":"created","issue":{"url":"https://api.github.com/repos/qgis/QGIS/issues/1987","labels_url":"https://api.github.com/repos/qgis/QGIS/issues/1987/labels{/name}","comments_url":"https://api.github.com/repos/qgis/QGIS/issues/1987/comments","events_url":"https://api.github.com/repos/qgis/QGIS/issues/1987/events","html_url":"https://github.com/qgis/QGIS/pull/1987","id":67608538,"number":1987,"title":"[feature] add expressions at the symbollist level","user":{"login":"vmora","id":4415710,"avatar_url":"https://avatars.githubusercontent.com/u/4415710?v=3","gravatar_id":"","url":"https://api.github.com/users/vmora","html_url":"https://github.com/vmora","followers_url":"https://api.github.com/users/vmora/followers","following_url":"https://api.github.com/users/vmora/following{/other_user}","gists_url":"https://api.github.com/users/vmora/gists{/gist_id}","starred_url":"https://api.github.com/users/vmora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmora/subscriptions","organizations_url":"https://api.github.com/users/vmora/orgs","repos_url":"https://api.github.com/users/vmora/repos","events_url":"https://api.github.com/users/vmora/events{/privacy}","received_events_url":"https://api.github.com/users/vmora/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-04-10T14:31:10Z","updated_at":"2015-05-07T11:43:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/qgis/QGIS/pulls/1987","html_url":"https://github.com/qgis/QGIS/pull/1987","diff_url":"https://github.com/qgis/QGIS/pull/1987.diff","patch_url":"https://github.com/qgis/QGIS/pull/1987.patch"},"body":"Size and Rotation can be defined by an expression for all symbols\r\ncomposing a marker Width can be defined by an expression for all symbols\r\ncomposing a line\r\n\r\nFor marquers, a legend is generated for varying sizes. This allows\r\nmultivariate analysis legend in the case of classified/graduated colors.\r\n\r\nThe line symbol layer as been refactored to avoid code duplication and\r\nexpose the offset and offset units in the base class. This refacto was\r\nnecessary for this feature to avoid unnecessary dynamic cast. Note that\r\nthe added functions in the base class where already defined in all child\r\nclasses.\r\n\r\nThe offset is now set along with size to maintain the relative position\r\nof symbols composing a marker.\r\n\r\nAn asistant, with preview, is accessible through the data defined button\r\nto help the user define the size expression. Three methods are\r\navailable: Frannery, Area and Radius.\r\n\r\nAdded a widged for use in categorized/classified symbology gui to set\r\nthe expression if needed. The assistant is also available from it.\r\n\r\nNote: breaking change in the symbolslist widget. The widget ctor now\r\ntakes the layer as a parameter, this is necessary for the assistant and\r\nfor the data-defined buttons. The widget is used only in one place and\r\nalthough it's a change to the public interface, the likelyhood of\r\nbreaking plugins dependent on this widget seems low enought."},"comment":{"url":"https://api.github.com/repos/qgis/QGIS/issues/comments/99829550","html_url":"https://github.com/qgis/QGIS/pull/1987#issuecomment-99829550","issue_url":"https://api.github.com/repos/qgis/QGIS/issues/1987","id":99829550,"user":{"login":"vmora","id":4415710,"avatar_url":"https://avatars.githubusercontent.com/u/4415710?v=3","gravatar_id":"","url":"https://api.github.com/users/vmora","html_url":"https://github.com/vmora","followers_url":"https://api.github.com/users/vmora/followers","following_url":"https://api.github.com/users/vmora/following{/other_user}","gists_url":"https://api.github.com/users/vmora/gists{/gist_id}","starred_url":"https://api.github.com/users/vmora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmora/subscriptions","organizations_url":"https://api.github.com/users/vmora/orgs","repos_url":"https://api.github.com/users/vmora/repos","events_url":"https://api.github.com/users/vmora/events{/privacy}","received_events_url":"https://api.github.com/users/vmora/received_events","type":"User","site_admin":false},"created_at":"2015-05-07T11:43:13Z","updated_at":"2015-05-07T11:43:13Z","body":"I found the problem: the mExpression creation is deferred now, so that the QgsSymbolLayerV2::dataDefinedProperty now return NULL even if there is a mExpressionString.\r\n\r\nI'm changing the interface (and implementation to avoid the use of the deprecated symbollayer interface) and it'll fix the problem.\r\n\r\nBut I think that storing the string AND the expression in QgsDataDefined multiplies the states of of the class and this is not good IMHO. Same thing for the mField. I'd rather have only a QgsExpression (smart) pointer and a mActive flag, and use expression introspection (like QgsExpression::isSimpleField) instead of duplicating those functionalities in QgsDataDefined."}}