-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
@tmpsantos, thanks for your PR! By analyzing this pull request, we identified @jfirebaugh to be potential reviewers. |
c34306c
to
2287b04
Compare
2287b04
to
a8501dc
Compare
{ | ||
d_ptr->mapObj->setLatLng(mbgl::LatLng { coordinate_.first, coordinate_.second }, d_ptr->margins); | ||
} | ||
|
||
/*! | ||
Convenience method for setting the \a coordinate and \a zoom simultaneously. | ||
Convenience method for setting the \a coordinate_ and \a zoom_ simultaneously. |
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.
Public _
variables are kind of unfortunate. Any chance you could rename these variables and explicitly use this
inside the implementation where there’s ambiguity?
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.
That is true. I've been trying when possible and being creative with the names.
In this case, the Qt standard is to use coordinate()
as a getter instead of getCoordinate()
and this often overlaps with parameters names. For Qt itself it is not a problem because it doesn't care about parameter shadowing.
One solution would be do a post processing of the generated documentation or disable this warning for the Qt build.
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.
Ah, that’s unfortunate. In Objective-C and Swift, it’s also possible for a getter and a variable to share the same namespace, and _
always denotes an internal implementation detail that shouldn’t be touched. So one old convention is to say e.g. theCoordinate
or aZoom
, but I don’t know if that looks reasonable in Qt code.
Is it possible to document this method on its declaration rather than its implementation? Then you can give the parameter two different names, coordinate
in the header (which shouldn’t conflict with coordinate()
) and coordinate_
here in the implementation.
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.
Excellent idea, it works! We can get rid of the _
.
/*! | ||
Sets the \a duration and \a delay of style class transitions. An animation | ||
morphing a style property value to another value is performed when a new | ||
class is set. |
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.
Use active voice:
Style property values transition to new values with animation when a new class is set.
This example hides the layer \b "route": | ||
|
||
\code | ||
map->setLayoutProperty("makerBackground", "visibility", "none"); |
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.
Typo: maker
→ marker
.
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.
It should be "route" actually.
\value MapChangeRegionDidChangeAnimated Not in use by QMapboxGL. | ||
|
||
\value MapChangeWillStartLoadingMap The map is getting loaded. This state | ||
is set only once right after QMapboxGL is created and a style is set. |
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.
Link QMapboxGL
?
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.
qdoc
links automatically in this case.
https://tmpsantos.com.br/qmapboxgl/qmapboxgl.html#MapChange-enum
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.
Doh, I keep forgetting that tools other than jazzy can autolink without any markup. 👍
@@ -657,19 +716,30 @@ void QMapboxGL::setPitch(double pitch_) | |||
d_ptr->mapObj->setPitch(pitch_); | |||
} | |||
|
|||
/*! | |||
Returns the North Orientation mode. |
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.
Lowercase “north orientation”.
valid GL context is expected with an appropriated GL viewport state set | ||
for the size of the canvas. | ||
|
||
This function should be called only after the signal needsRendering() is |
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.
Is this documentation being generated by Doxygen or something along those lines? This sounds like a good case for Doxygen’s \pre
command.
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.
needsRendering() gets detected and linked by qtdoc
automatically because it is a signal of the same class.
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.
Sorry, I was referring to the paragraph as a whole, not the reference to needsRendering()
. In Doxygen syntax, \pre
means “precondition” and is given special prominence in the generated output.
@@ -1085,11 +1346,42 @@ void QMapboxGL::render() | |||
} | |||
#endif | |||
|
|||
/*! | |||
Informs the map that the network connection was established, causing | |||
all timeouted network requests to retry immediately. |
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.
s/was established/has been established/
s/timeouted network requests/network requests that previously timed out/
s/to retry/to be retried/
\fn void QMapboxGL::copyrightsChanged(const QString ©rightsHtml); | ||
|
||
This signal is emitted when the copyrights of the current content of the map | ||
has change. This can be caused by a style change or adding a new data source. |
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.
s/has change/have changed/
@@ -366,6 +366,54 @@ void QMapboxGLSettings::setAccessToken(const QString &token) | |||
*/ | |||
|
|||
/*! | |||
\enum QMapboxGL::MapChange | |||
|
|||
This enum represents the last changed occurred on the map state. |
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.
s/last change occurred on/last change that occurred to/
is set only once right after QMapboxGL is created and a style is set. | ||
|
||
\value MapChangeDidFinishLoadingMap All the resources were loaded and parsed | ||
and the map is fully rendered. This is the final state of the map. |
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.
“Final” implies that the state will never change again, doesn’t it? This enum value sort of represents a quiescent state, but the map state can continue changing if for instance the user starts panning.
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.
Correct, I will reword this. What I was trying to say here is this is the most complete state of the map in terms of things rendered and resources loaded.
morphing a style property value to another value is performed when a new | ||
class is set. | ||
|
||
\deprecated |
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.
As far as I know, global transition options are not deprecated and not under consideration for removal.
as defined by \l {https://www.mapbox.com/mapbox-gl-style-spec/} {the vector tiles specification} | ||
for paint properties. | ||
|
||
The argument \a klass_ is deprecated and is used for defining the style class for the paint |
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 point was that you’d have two methods:
void setPaintProperty(const QString& layer, const QString& property, const QVariant& value);
//! \deprecated
void setPaintProperty(const QString& layer, const QString& property, const QVariant& value, const QString& klass) __attribute__((deprecated));
This works in C++03; is there a Qt-specific reason why we can’t overload the method like this?
82d1148
to
07ad792
Compare
@1ec5 thanks a lot for pushing this documentation to the next level: https://tmpsantos.com.br/qmapboxgl/qmapboxgl.html |
\endtable | ||
|
||
For a giver layer \c route, setting the property \c line-dasharray that requires | ||
a Mabpox Style type \b Array can be done as follows using a QVariantList: |
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.
s/giver/given/, and avoid passive voice:
If the style specification defines the property’s type as
Array
, use a QVariantList. For example, the following code sets aroute
layer’sline-dasharray
property:
\endcode | ||
|
||
This table describes the mapping between \l {https://www.mapbox.com/mapbox-gl-style-spec/#types} | ||
{style types} and Qt types accepted by setLayoutProperty(): |
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.
This table also applies to setPaintProperty()
, so copy this table to that method’s documentation. (In particular, color-typed properties are paint properties.)
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.
I did that ;)
But I'm going to remove Color.
They will never return true because Qt only does client side animations.
07ad792
to
6b593fc
Compare
It propagated via copy & paste. :-P
Showing how to add numbers in an array.
6b593fc
to
d341a2f
Compare
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.
🎉
Add even more docs to QMapboxGL.