-
-
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
improve GUI consistency & UX for data-defined style (fixes #9881) #1833
Conversation
vmora: such a great change to hide behind such a humble commit message! ;) A few quick notes from some initial tests of the feature (I haven't checked the code changes):
|
This commit is for....? |
QGS_BLOCK_SIGNAL_DURING_CALL( spinOffset, setValue( mLayer->offset() ) ) | ||
QGS_BLOCK_SIGNAL_DURING_CALL( cboPenStyle, setPenStyle( mLayer->penStyle() ) ) | ||
QGS_BLOCK_SIGNAL_DURING_CALL( cboJoinStyle, setPenJoinStyle( mLayer->penJoinStyle() ) ) | ||
QGS_BLOCK_SIGNAL_DURING_CALL( cboCapStyle, setPenCapStyle( mLayer->penCapStyle() ) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous 3 calls may introduce a bug as they doesn't runs in the same order than the old code.
Here's the old behaviour:
3 blockSignals(true)
then 3 calls
then 3 blockSignals(false).
Please check it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My reasoning was that, since no signal is emitted, it is equivalent.
I understand that if one of the widget has a pointer on one of the others, a signal may be fired by the pointer-to widget. I checked in the custom widgets of qgis and I did not find a widget which holds a pointer on another one.
If you thing my reasoning is wrong, I can restore the old behavior, since it's not directly related to the feature.
QGS_BLOCK_SIGNAL_DURING_CALL( mOutlineWidthUnitWidget, setUnit( mLayer->outlineWidthUnit() ) ) | ||
QGS_BLOCK_SIGNAL_DURING_CALL( mOutlineWidthUnitWidget, setMapUnitScale( mLayer->outlineWidthMapUnitScale() ) ) | ||
QGS_BLOCK_SIGNAL_DURING_CALL( mHorizontalAnchorComboBox, setCurrentIndex( mLayer->horizontalAnchorPoint() ) ) | ||
QGS_BLOCK_SIGNAL_DURING_CALL( mVerticalAnchorComboBox, setCurrentIndex( mLayer->verticalAnchorPoint() ) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same as above, please check if the above 2 lines behave like the old code.
Hi all, Sorry for the title (and commit message), I'll rebase and force update I my repository when the other issues with this PR are fixed.
@nyalldawson I don't understand what you mean by that. Can you explain a bit more plz.
@nyalldawson I think the right thing to do is to use à QMap< QString, QgscDataDefined* > instead of a QMap< QString, QgscDataDefined* > for mDataDefinedProperties of QgsSymbolLayerV2. But this is a new feature, and touches other parts of the code. I'd prefer to do that as a second independent PR (incremental improvement) to avoid running into conflicts with this PR, I think it's more 'agile' :). This PR tries to be specific to one issue, I will also work on the diagram afterward to do the same kind of things, and then on the 'Advanced' menu. I can do the change you request in between, or after that, and have a specific PR for that. |
@vmora - fair enough. Its been a pet peeve of mine for a long time so I was hoping this work would address it. Re tab order - the changes to the ui files have resulted in a messed up tab order for the symbol dialogs. You can see it if you try and tab through the widgets in any symbol layer properties window. |
@nyalldawson ok, I see the tab order problem now. thanks, I'm on it. |
@vmora tab order looks good to me now, thanks. (the exception is that map unit widgets are always last in the order, but that issue isn't new). |
@dakcarto @wonder-sk any thoughts on this. It would be good to merge for 2.8. |
|
||
mDataDefinedPropertyButtons.clear(); | ||
|
||
#define QGS_REGISTER_DATA_DEFINED_BUTTON( button, name, type, description )\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vmora I don't think this should be a macro - I can't see any benefit in implementing it this way, and it breaks things like Qt Creator's find/follow/etc. I'd prefer that this was a function in QgsSymbolLayerV2Widget.
@nyalldawson thanks for the suggestions, this greatly improves the code, see #1842 I left out the QGS_BLOCK_SIGNAL_DURING_CALL, since this was just added to help me read the code and is unrelated. Closing the PR since #1842 is a replacement. |
No description provided.