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

Temporal layers indicators #34909

Merged
merged 7 commits into from
Mar 10, 2020
Merged

Conversation

Samweli
Copy link
Contributor

@Samweli Samweli commented Mar 6, 2020

Adds support for the temporal layers indicators in the Layers panel work tree.

These indicators change depending on from where the current layers temporal range is set from, eg from the project settings or from layer temporal properties options.

This PR contains work from #34590
Temporal_layer_indicator

Note: This is part of the work from discussions found here and here .

@github-actions github-actions bot added this to the 3.14.0 milestone Mar 6, 2020
@Samweli Samweli force-pushed the temporal_layer_indicator_v2 branch from 4d09e6c to ab3b8e9 Compare March 6, 2020 22:29
src/app/qgslayertreeviewtemporalindicator.cpp Outdated Show resolved Hide resolved
src/app/qgslayertreeviewtemporalindicator.cpp Outdated Show resolved Hide resolved
src/app/qgslayertreeviewtemporalindicator.cpp Outdated Show resolved Hide resolved
src/app/qgslayertreeviewtemporalindicator.cpp Outdated Show resolved Hide resolved
src/app/qgslayertreeviewtemporalindicator.cpp Outdated Show resolved Hide resolved
src/app/qgslayertreeviewtemporalindicator.cpp Outdated Show resolved Hide resolved
src/app/qgslayertreeviewtemporalindicator.h Outdated Show resolved Hide resolved
Copy link
Collaborator

@nyalldawson nyalldawson left a comment

Choose a reason for hiding this comment

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

Looking close!

Now that QgsTemporalProperty/QgsMapLayerTemporalProperties/QgsRasterLayerTemporalProperties are QObjects, you'll need to ensure these all have the Q_OBJECT macro inclusion, and also accept a parent QObject* argument in their constructors.

Then, we need to make sure that the QgsRasterLayerTemporalProperties are correctly parented to the raster layer when constructed. So in qgsrasterlayer.cpp

mTemporalProperties = qgis::make_unique<QgsRasterLayerTemporalProperties>();

becomes

mTemporalProperties =  new QgsRasterLayerTemporalProperties( this );

You'll also need to change

std::unique_ptr< QgsRasterLayerTemporalProperties > mTemporalProperties;

to

QgsRasterLayerTemporalProperties * mTemporalProperties = nullptr;

in the header, since we'll be using Qt's parent memory management instead of c++ unique_ptr

src/core/qgsmaplayertemporalproperties.h Show resolved Hide resolved
src/core/qgstemporalproperty.h Show resolved Hide resolved
src/app/qgslayertreeviewtemporalindicator.cpp Outdated Show resolved Hide resolved
@nyalldawson
Copy link
Collaborator

Looks great, thanks!

@nyalldawson
Copy link
Collaborator

Can you rebase this branch off master? There's a merge conflict here.

@Samweli Samweli force-pushed the temporal_layer_indicator_v2 branch from d8ccdd0 to ef3484b Compare March 9, 2020 21:26
@Samweli
Copy link
Contributor Author

Samweli commented Mar 9, 2020

Can you rebase this branch off master? There's a merge conflict here.

Sure, done!

@nyalldawson
Copy link
Collaborator

Thanks -- I'll merge as soon as the CI results are green!

@Samweli
Copy link
Contributor Author

Samweli commented Mar 9, 2020

Thanks @nyalldawson

@nyalldawson nyalldawson merged commit 9845ffa into qgis:master Mar 10, 2020
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

2 participants