All,
I am having difficulty getting DATES to show well on the custom Qt forms when editing the attributes.
The QT widget DateEdit looks well and stores the selected date into the attribute (of type String). But it does not seem to read the correct value again on startup.
I am using the following
shapefile attribute type = String,
Qt widget = DateEdit
qGIS attribute edit widget= LineEdit
My questions
(1) Has anyone used the QT widget DateEdit or Date/TimeEdit when editing attribute dates ?
(2) In QGIS, I can't seem to create a shapefile attribute of type 'date'. Is 'date' a supported shapefile type?
(3) Is there a way to limit the number of characters in a TextEdit widget. It seems to let me add lots, then truncate it when the layer is saved to the shapefile.
See below how I have configured custom fields for, text, ints, reals, booleans, enums, etc.
Any help would be appreciated.
Thanks
Paul
Here is what is working so far. I am very happy with that way all this works (well done to the developers).
I am listing it here because I have not found this documented anywhere.
Is it documented anywhere?
Is the following correct?
I have created a .ui and registered it in the General tab for my shapefile layer.
The QT widget names are the same as the shapefile attribute names.
The qGIS attribute edit widget (not the QT form designer) is used to setup min/max and allowable values, etc.
SIMPLE TEXT STRING
shapefile attribute type = String,
Qt widget = LineEdit, *** with maxLenght property set as appropriate ***
qGIS attribute edit widget= LineEdit *** no way to set the maxLenght ***
MULTI-LINE TEXT STRING
shapefile attribute type = String,
Qt widget = PlainTextEdit, *** no way to set the maxLenght ***
qGIS attribute edit widget= LineEdit or textEdit (doesn't seem to make any difference) *** no way to set the maxLenght ***
INTEGER
shapefile attribute type = Integer,
Qt widget = SpinBox
qGIS attribute edit widget= Range, with min/max/step configured as appropriate
REAL
shapefile attribute type = real,
Qt widget = DoubleSpinBox
qGIS attribute edit widget= Range, with min/max/step configured as appropriate
EUMERATIONS -COMBOBOX
shapefile attribute type = String,
Qt widget = ComboBox
qGIS attribute edit widget= ValueMap with suitable values(for the shapefile) and descriptions(for the UI).
BOOLEAN - CHECKBOX
shapefile attribute type = String,
Qt widget = Checkbox
qGIS attribute edit widget= Checkbox with 1=checked, 0=unchecked.

