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

Fix saving and restoring of 3D map view settings #219

Merged
merged 2 commits into from
Jan 20, 2025

Conversation

m-kuhn
Copy link
Collaborator

@m-kuhn m-kuhn commented Jan 17, 2025

No description provided.

map->setSelectionColor( mMapCanvas->selectionColor() );
map->setBackgroundColor( mMapCanvas->canvasColor() );
#endif
map->setOutputDpi( QGuiApplication::primaryScreen()->logicalDotsPerInch() );
Copy link
Contributor

Choose a reason for hiding this comment

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

is this the right place for this?
what happens with a secondary screen?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this is based on simplified assumptions (straight 1:1 copy from the QGIS source) that the 3D is shown on the same screen as the main application window.
I can adapt, but I think to be really meaningful, this would also need to react when the widget is dragged to another screen which afaik is one of the tricky things to do with Qt. So maybe we can assume that people who work with multiple screens have identical ones?

Copy link
Contributor

Choose a reason for hiding this comment

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

yep, I've always had troubles with QGIS on multiple screens.
Fine with me like this, we can wait for any bugreport and properly fix this upstream.

connect( QgsProject::instance(), &QgsProject::readProject, [this] {
if ( m3DMapCanvasWidget )
{
QDomElement viewConfig = QgsProject::instance()->viewsManager()->get3DViewSettings( "kadas-3d" );
Copy link
Contributor

Choose a reason for hiding this comment

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

should we use static string for this identifier?

@m-kuhn m-kuhn merged commit 7a806f7 into main Jan 20, 2025
3 checks passed
@m-kuhn m-kuhn deleted the fix-save-load-3d-settings branch January 20, 2025 10:37
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.

2 participants