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

improve GUI consistency & UX for data-defined style (fixes #9881) #1833

Closed
wants to merge 2 commits into from

Conversation

vmora
Copy link
Contributor

@vmora vmora commented Jan 14, 2015

No description provided.

@nyalldawson
Copy link
Collaborator

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):

  • tab order for symbol widgets needs to be updated
  • expressions/field selections are lost if the data defined button is set to not active and then the dialog is closed. While this was also the previous behaviour, it differs from how data defined buttons behave in labelling & composer, and is frustrating to use. This should be addressed with this PR so that the expression/field is saved along with the active status of the button, so that data defined properties can be easily disabled and then re-enabled.

@luca76
Copy link
Contributor

luca76 commented Jan 14, 2015

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() ) )
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@NathanW2 NathanW2 changed the title fix 9881 mprove GUI consistency & UX for data-defined style (fix #9881) Jan 14, 2015
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() ) )
Copy link
Contributor

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.

@jef-n jef-n changed the title mprove GUI consistency & UX for data-defined style (fix #9881) improve GUI consistency & UX for data-defined style (fixes #9881) Jan 14, 2015
@NathanW2
Copy link
Member

@vmora nice work. Bringing some consistency here will be great.

@dakcarto you did the label version. Do did you want to run a eye over this version too?

@vmora
Copy link
Contributor Author

vmora commented Jan 15, 2015

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.

  • tab order for symbol widgets needs to be updated

@nyalldawson I don't understand what you mean by that. Can you explain a bit more plz.

  • expressions/field selections are lost if the data defined button is set to not active and then the dialog is closed. While this was also the previous behaviour, it differs from how data defined buttons behave in labelling & composer, and is frustrating to use. This should be addressed with this PR so that the expression/field is saved along with the active status of the button, so that data defined properties can be easily disabled and then re-enabled.

@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.

@nyalldawson
Copy link
Collaborator

@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.

@vmora
Copy link
Contributor Author

vmora commented Jan 15, 2015

@nyalldawson ok, I see the tab order problem now. thanks, I'm on it.

@nyalldawson
Copy link
Collaborator

@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).

@NathanW2
Copy link
Member

@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 )\
Copy link
Collaborator

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.

@vmora
Copy link
Contributor Author

vmora commented Jan 20, 2015

@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.

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

5 participants