In QGS (3.28.4 LTR), I'm trying to add a QML button to a form that will open the attached photo when pressed, but have encountered the problem that the button appears when the attachment field happens to be empty (a result of some kind of error, such as maybe forgetting to hit the green checkmark to accept the photo after taking it):
But not when there is a photo (the normal and desired case):
Here is the current code for the button (no onclick code yet, & the show label checkbox will get unchecked when this first problem is solved)
Annoyingly, the button appears properly in QField, where I ultimately want it not to appear, because the QField photo widget opens the photos on a click in the way I want, while QGIS doesn't seem to have that facility (you can sort of see why I want it from the photo; the bluish stuff near the bottom is the Australian 'blue devil' (Eryngium ovinum), completely different from the North American 'blue devil', and they are kind of hard to see, so you sometimes want a maximally big picture).
A further remark is that experimenting with different positions for the button in the list, such as above 'date', makes no difference. Could this be a limitation/bug in the QGIS attribute table form view?
case
statement to alter the text to "no image available" if the photo file path field is empty