Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

[Qt] Add more docs - #7594

Merged
tmpsantos merged 4 commits into
masterfrom
tmpsantos-qt_docs2
Jan 9, 2017
Merged

tmpsantos merged 4 commits into
masterfrom
tmpsantos-qt_docs2

Conversation

@tmpsantos

Copy link
Copy Markdown
Contributor

Add even more docs to QMapboxGL.

@mention-bot

Copy link
Copy Markdown

@tmpsantos, thanks for your PR! By analyzing this pull request, we identified @jfirebaugh to be potential reviewers.

@tmpsantos tmpsantos self-assigned this Jan 4, 2017
@tmpsantos
tmpsantos requested a review from 1ec5 January 4, 2017 17:29
@tmpsantos tmpsantos added the Qt Mapbox Maps SDK for Qt, aka Qt Location Mapbox GL label Jan 4, 2017
Comment thread platform/qt/src/qmapboxgl.cpp Outdated

Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Contributor Author

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

Comment thread platform/qt/src/qmapboxgl.cpp Outdated

Copy link
Copy Markdown
Contributor

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.

Comment thread platform/qt/src/qmapboxgl.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: maker → marker.

Copy link
Copy Markdown
Contributor Author

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.

Comment thread platform/qt/src/qmapboxgl.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link QMapboxGL?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@1ec5 1ec5 Jan 6, 2017 •

Copy link
Copy Markdown
Contributor

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

Comment thread platform/qt/src/qmapboxgl.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lowercase “north orientation”.

Comment thread platform/qt/src/qmapboxgl.cpp Outdated

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Contributor Author

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.

@1ec5 1ec5 Jan 6, 2017 •

Copy link
Copy Markdown
Contributor

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.

Comment thread platform/qt/src/qmapboxgl.cpp Outdated

Copy link
Copy Markdown
Contributor

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/

Comment thread platform/qt/src/qmapboxgl.cpp Outdated

Copy link
Copy Markdown
Contributor

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/

Comment thread platform/qt/src/qmapboxgl.cpp Outdated

Copy link
Copy Markdown
Contributor

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/

Comment thread platform/qt/src/qmapboxgl.cpp Outdated

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Contributor Author

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.

Comment thread platform/qt/src/qmapboxgl.cpp Outdated

Copy link
Copy Markdown
Contributor

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.

Comment thread platform/qt/src/qmapboxgl.cpp Outdated

Copy link
Copy Markdown
Contributor

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?

@tmpsantos
tmpsantos force-pushed the tmpsantos-qt_docs2 branch 2 times, most recently from 82d1148 to 07ad792 Compare January 6, 2017 22:07
@tmpsantos

Copy link
Copy Markdown
Contributor Author

@1ec5 thanks a lot for pushing this documentation to the next level: https://tmpsantos.com.br/qmapboxgl/qmapboxgl.html

Comment thread platform/qt/src/qmapboxgl.cpp Outdated

@1ec5 1ec5 Jan 6, 2017 •

Copy link
Copy Markdown
Contributor

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 a route layer’s line-dasharray property:

Comment thread platform/qt/src/qmapboxgl.cpp Outdated

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor Author

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.
It propagated via copy & paste. :-P
Showing how to add numbers in an array.

@brunoabinader brunoabinader left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@tmpsantos
tmpsantos merged commit eaf03f4 into master Jan 9, 2017
@tmpsantos
tmpsantos deleted the tmpsantos-qt_docs2 branch January 9, 2017 15:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Qt Mapbox Maps SDK for Qt, aka Qt Location Mapbox GL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants