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

[feature] Add ScaleBar and MessageLog components to QgsQuick library. #6983

Merged
merged 1 commit into from
May 17, 2018

Conversation

PeterPetrik
Copy link
Contributor

This pull request is a subset of (#6490)
This adds ScaleBar and MessageLog components to QgsQuick library with related classes.
For background information see the associated QEP.

@nyalldawson
Copy link
Collaborator

Not being up to scratch with these components - where is the scalebar rendering actually done?

@PeterPetrik
Copy link
Contributor Author

@nyalldawson, the actual rendering is done qgsquickscalebar.qml. QML Item is basic block for all of this stuff, similar to QWidget in the qgis_gui library

@PeterPetrik PeterPetrik changed the title Add ScaleBar and MessageLog components to QgsQuick library. [feature] Add ScaleBar and MessageLog components to QgsQuick library. May 14, 2018
@nyalldawson
Copy link
Collaborator

the actual rendering is done qgsquickscalebar.qml. QML Item is basic block for all of this stuff, similar to QWidget in the qgis_gui library

Ok, so it's done from scratch? There's no way to re-use QgsScaleBarRenderer here?

@PeterPetrik
Copy link
Contributor Author

It would be (probably) possible to use QgsScaleBarRenderer inside QQuickPaintedItem. The problem I see is that this approach would first paint image and then use the image on QML canvas. The current implementation uses the native QML rendering, which gives some rendering benefits and better user experience. And I am not sure how much code could be used from the QgsScaleBarRenderer to keep the QML rendering benefits.

@m-kuhn
Copy link
Member

m-kuhn commented May 14, 2018

A QQuickPaintedItem and rasterized widget rendering is not something I'd want to introduce here. Not sure how easy it would be to factor out common code to determine unit / segment number / segment size / ...

@nyalldawson
Copy link
Collaborator

A QQuickPaintedItem and rasterized widget rendering is not something I'd want to introduce here. Not sure how easy it would be to factor out common code to determine unit / segment number / segment size / ...

I understand that - I guess I'm just seeing that there's a huge functionality gap between the QML scale bar here and the functionality exposed by QgsScaleBarRenderer.

@PeterPetrik
Copy link
Contributor Author

True. I think that for first few releases the applications will implement their own QML scalebar and just use the ScaleBarKit to be able to easily access all required input. The QML scale bar in the QgsQuick library is now just a little more than "example" how to properly create customized scale bar with any design.

@wonder-sk
Copy link
Member

Are we good to merge this?

I am not sure if we could make good use of QgsScaleBarRenderer in QML world: while the associated QgsScaleBarSettings allow for easy customization of scale bar rendering, the rendered output is still fixed to a particular scale bar design. The beauty of QML is that using the ScaleBarKit developers can produce any scale bar design they can think of...

@nyalldawson
Copy link
Collaborator

Yep, go ahead

@wonder-sk wonder-sk merged commit 9a79fc7 into qgis:master May 17, 2018
@PeterPetrik PeterPetrik deleted the qgsquick_2_scalebar_messagelog branch May 30, 2018 10:33
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.

4 participants