Bug report #3400

On project load the Selection color is not properly set.

Added by Steven Mizuno almost 14 years ago. Updated about 9 years ago.

Status:Closed
Priority:Low
Assignee:-
Category:Project Loading/Saving
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:13460

Description

On project load the Selection color is not properly set. The Selection color does show OK in Project Properties dialog, but selected features have the wrong color. The default yellow becomes white, for example.

If you OK the Project Properties then the selection color is displayed properly.

Associated revisions

Revision 07db9848
Added by Steven Mizuno about 9 years ago

set selection color from project file

fix #3400
also remove duplicate setting of background color (it is set by ProjectProperties)

Revision 938d8ed2
Added by Nyall Dawson about 9 years ago

set selection color from project file

fix #3400
also remove duplicate setting of background color (it is set by ProjectProperties)

(cherry-picked from 07db9848301daae5c07b3ee5a4130cf80a357f65)

History

#1 Updated by Marco Hugentobler almost 14 years ago

  • Status changed from Open to Closed
  • Resolution set to fixed

Fixed in

#2 Updated by Harry Gaitanis about 10 years ago

  • Assignee deleted (nobody -)
  • Target version changed from Version 1.7.0 to Version 2.6
  • Status changed from Closed to Reopened
  • Crashes QGIS or corrupts data set to No
  • Affected QGIS version set to 2.4.0

I am having this exact issue in version 2.4.0

#3 Updated by Harry Gaitanis about 10 years ago

  • Status changed from Reopened to Closed

#4 Updated by Jeff Tackett almost 10 years ago

This issue is in 2.6.1 and the project we are upgrading from 2.0.1. We are not able to see the selection of features since yellow is a color of one of our features.

I have also tested this on a new project in 2.6.1 and it also shows the issue.

The project that we have is for field data collection and our techs would have to change the default in the options to be able to see the selection, and making sure all the techs select the same color is not something that we should have to do if this worked correctly.

We needed to upgrade from 2.0.1 due to it having a memory leak that would cause it to slow down after a few hours of using it or we would stay with that version since everything else works.

#5 Updated by Giovanni Manghi almost 10 years ago

  • Operating System deleted (All)
  • Pull Request or Patch supplied set to No
  • Resolution deleted (fixed)
  • Status info deleted (0)

Jeff Tackett wrote:

This issue is in 2.6.1 and the project we are upgrading from 2.0.1. We are not able to see the selection of features since yellow is a color of one of our features.

I have also tested this on a new project in 2.6.1 and it also shows the issue.

The project that we have is for field data collection and our techs would have to change the default in the options to be able to see the selection, and making sure all the techs select the same color is not something that we should have to do if this worked correctly.

We needed to upgrade from 2.0.1 due to it having a memory leak that would cause it to slow down after a few hours of using it or we would stay with that version since everything else works.

resuming:
you defined a custom color selection in projects made in qgis 2.0.1, and when opening them in qgis 2.6.1 this color is not retained, correct?

#6 Updated by Steven Mizuno over 9 years ago

  • Status changed from Closed to Reopened
  • Target version changed from Version 2.6 to Version 2.12
  • Pull Request or Patch supplied changed from No to Yes

The problem as originally described still exists (or has somehow occurred again) in v. 2.11 dev and earlier versions as has been subsequently reported.

In QgisApp::fileNew(bool,bool) the selection color and canvas color are set from QGIS defaults and set into the map canvas as expected.

In QgisApp::addProject(QString) only the canvas color is passed to the map canvas. The selection color should also be passed to the map canvas.

Additionally, I believe there is redundant code setting the canvas color into the map canvas in QgisApp::projectProperties() as the same is done in QgsProjecProperties::apply().

In the patch attached are the changes to QgisApp that I have worked out. I am not able to test these changes as I don't have a suitable build system.

synopsis of changes to qgisapp.cpp

QgisApp::addProject(QString)

add building up the selection color and setting into the map canvas

QgisApp::projectProperties()

remove lines that set canvas color in the map canvas

#7 Updated by Steven Mizuno about 9 years ago

  • Affected QGIS version changed from 2.4.0 to master

#8 Updated by Giovanni Manghi about 9 years ago

  • Target version deleted (Version 2.12)

#9 Updated by Steven Mizuno about 9 years ago

  • Status changed from Reopened to Closed

I am closing this issue as the PR was merged into master.

Also available in: Atom PDF