Repository navigation
[Qt] Add more docs - #7594
[Qt] Add more docs#7594
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
There was a problem hiding this comment.
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.
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.
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.
Excellent idea, it works! We can get rid of the _.
There was a problem hiding this comment.
Use active voice:
Style property values transition to new values with animation when a new class is set.
There was a problem hiding this comment.
It should be "route" actually.
There was a problem hiding this comment.
qdoc links automatically in this case.
There was a problem hiding this comment.
Doh, I keep forgetting that tools other than jazzy can autolink without any markup. 👍
There was a problem hiding this comment.
Lowercase “north orientation”.
There was a problem hiding this comment.
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.
needsRendering() gets detected and linked by qtdoc automatically because it is a signal of the same class.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
s/was established/has been established/
s/timeouted network requests/network requests that previously timed out/
s/to retry/to be retried/
There was a problem hiding this comment.
s/last change occurred on/last change that occurred to/
There was a problem hiding this comment.
“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.
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.
There was a problem hiding this comment.
As far as I know, global transition options are not deprecated and not under consideration for removal.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 aroutelayer’sline-dasharrayproperty:
There was a problem hiding this comment.
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.
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
Add even more docs to QMapboxGL.