Hi Richard

On 9/28/18 10:17 AM, Richard Duivenvoorde wrote:
> On 09/28/2018 12:07 AM, Nyall Dawson wrote:
>> On Fri, 28 Sep 2018 at 00:08, Richard Duivenvoorde <[email protected]> 
>> wrote:
>>> Using the I-tool and viewing via 'Auto open form', the attributes of a
>>> feature are barely readable (see attached screenshot).
>> Oh this has bugged me a LOT too! I'd very much like to see this
>> changed, but I'm not sure if there's some rationale behind it I'm
>> missing...
>>
>> Nyall
> Looking into this a little, we use make the widget 'enabled=false' I think?
>
> What about instead only do 'readOnly=true'?
> Then you 'miss' the visual cue that a form field is read only.
> There could be a message when you try to edit the field?
>
> Or in combination with 'frame=false' you would get a form in which the
> fields do not like 'input fields'.

That sounds like an idea.

Have a look here, that's the default behavior with setEnabled, where the
actual modification of the widget is done:

https://github.com/qgis/QGIS/blob/master/src/gui/editorwidgets/core/qgseditorwidgetwrapper.cpp#L65

it needs to be checked with all different widgets if they are still in a
sane and expected readonly state. If one is not, the behavior can be
finetuned in their respective wrapper, as done e.g. here
https://github.com/qgis/QGIS/blob/master/src/gui/editorwidgets/qgsrelationreferencewidgetwrapper.cpp#L136

Cheers

Matthias


>
> Mmm, was trying to look into this, to find out that we use a wrapper
> around the widgets:
>
> https://github.com/qgis/QGIS/blob/master/src/gui/qgsattributeform.cpp#L1077
>
> Removing the
> ww->setEnabled( enabled );
> morphs the input in the default input of QGIS
> ww does not have readonly or frame anymore
>
> So more difficult then I hoped :-(
>
> Richard
>
>
> _______________________________________________
> QGIS-Developer mailing list
> [email protected]
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
-- 
Matthias Kuhn
[email protected] <mailto:[email protected]>
+41 (0)76 435 67 63 <tel:+41764356763>
OPENGIS.ch Logo <http://www.opengis.ch>
_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to