-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix .dbf fields allowed length and num #58848
Conversation
ac28aa1
to
7e754b5
Compare
src/gui/qgsnewvectorlayerdialog.cpp
Outdated
if ( mWidth->value() < 1 || mWidth->value() > ESRI_SHORT_INTEGER_MAX_WIDTH_INCLUSIVE ) | ||
mWidth->setValue( ESRI_SHORT_INTEGER_MAX_WIDTH_INCLUSIVE ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this actually required? I believe it should be handled by QSpinBox in the setMaximum call already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes, i see!
Changed QSpinBox to QgsSpinBox, undone this check and used ClearValue as additional tweak
@@ -252,6 +246,16 @@ | |||
</property> | |||
</spacer> | |||
</item> | |||
<item row="2" column="1"> | |||
<widget class="QSpinBox" name="mWidth"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<widget class="QSpinBox" name="mWidth"> | |
<widget class="QgsSpinBox" name="mWidth"> |
This is a subclass of QSpinBox which adds additional tweaks
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
7e754b5
to
9c07906
Compare
9c07906
to
63d1f82
Compare
🪟 Windows buildsDownload Windows builds of this PR for testing. 🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. |
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
While we hate to see this happen, this PR has been automatically closed because it has not had any activity in the last 21 days. If this pull request should be reconsidered, please follow the guidelines in the previous comment and reopen this pull request. Or, if you have any further questions, just ask! We love to help, and if there's anything the QGIS project can do to help push this PR forward please let us know how we can assist. |
Description
Fix dbf-format allowed field width and maximum number of fields
Shapefile format is using dbf-tables to store geometry attributes, which, according to specification, has a set number of max fields and each field has a max width, depending on its type. Width numbers and max number are taken from here:
https://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Geoprocessing%20considerations%20for%20shapefile%20output
Thus in the shapefile layer creation menu width-text-edit field changed to int spinbox and it would have it's max value changed according to chosen field type.
Origin version
Fix version
It may be advised to double-check width-values since dbf has several versions. Here ESRI was chosen as the first guideline, but there still may be nuances, which were not understood/confused/interpreted incorrectly during our research and fix