Bug report #17721

Color picker does not pick the color (always set to transparent)

Added by Harrissou Santanna almost 7 years ago. Updated almost 7 years ago.

Status:Closed
Priority:Normal
Assignee:Alessandro Pasotti
Category:GUI
Affected QGIS version:master Regression?:Yes
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:25617

Description

Open a dialog and expand a color widget
Select the color picker option
Now move to a place you'd like to pick a color from (notice that you'd encounter #17597)
Pick the color: instead of the selected color, your color widget is set to transparent

Tested on Windows 10, code b59bd94e

colorpickerdropdown.gif (482 KB) Kurt Menke, 2018-01-15 05:57 PM

ColorPicker.gif (795 KB) Kurt Menke, 2018-01-30 06:12 PM


Related issues

Related to QGIS Application - Bug report #17597: Color Picker cursor disabled when used from the Layer Sty... Closed 2017-11-30

Associated revisions

Revision 948452b7
Added by Alessandro Pasotti almost 7 years ago

[bugfix] Restore color picker from layer styling panel

Fixes #17721

Successfully tested on Windows 10 and Linux with Qt 5.10

History

#1 Updated by Kurt Menke almost 7 years ago

I am still seeing this issue with QGIS Version: 2.99.0-Master QGIS code revision: d87c60512c
Compiled against Qt: 5.9.2
Running against Qt: 5.9.2
Compiled against GDAL: 2.2.3
Running against GDAL: 2.2.3

Windows 10 64 bit

The Pick color tool does not select the correct color when selecting a color from the desktop. When using the Color --> Pick Color tool either from the Styling Dock or Layer Properties the tool makes the color transparent.

#2 Updated by Alessandro Pasotti almost 7 years ago

From your video seems like you are picking the color from outside the QGIS application window, just curious: does it work if you pick a color from within the QGIS app?

#3 Updated by Kurt Menke almost 7 years ago

No, when using the Pick color tool from the dropdown color widget, the color is set to transparent even if I pick a color within the QGIS application. However, if I select Choose color... --> Sample color it works. From there I can select a color from within QGIS or from other places on my desktop.

#4 Updated by Alessandro Pasotti almost 7 years ago

  • Assignee set to Alessandro Pasotti

#5 Updated by Alessandro Pasotti almost 7 years ago

  • Status changed from Open to In Progress

There are a couple of issues here:
1 - inconsistency (by design apparently): you need to keep the left mouse button pressed to pick the color
2 - the cursor does not change to the color picker as expected

#6 Updated by Alessandro Pasotti almost 7 years ago

Ok, I have a fix for item 2 above.

But I'm hesitant: why do we have/need two different ways to pick a color? Wouldn't be better to just keep the "Sample color" from "Choose color" action?

What we should probably do is to make the "Pick color" action activate the color widget (like the "Choose color..." action does) and activate the "Sample color" action within the color widget: this way we have a consistent behavior and less (duplicated) code to maintain.

In other words, I suggest to make the "Pick color" action a shortcut for "Choose color..." -> "Sample color".

#7 Updated by Alessandro Pasotti almost 7 years ago

  • Pull Request or Patch supplied changed from No to Yes

PR https://github.com/qgis/QGIS/pull/6356

This hopefully fixes the issue, works for me on win 10 and Linux but on Win 10 the cursor does not always immediately changes to a picker: sometimes it takes a few seconds or a few mouse moves, I'm not sure if this is something due to my relatively slow Win 10 VM.

Please give this a try.

#8 Updated by Alessandro Pasotti almost 7 years ago

  • Related to Bug report #17597: Color Picker cursor disabled when used from the Layer Styling panel added

#9 Updated by Anonymous almost 7 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

#10 Updated by Giovanni Manghi almost 7 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF