exceptions: suppress QFormLayout::ItemRole* out-pointers

This commit is contained in:
mappu 2024-09-20 19:19:58 +12:00
parent ad41e2ef0b
commit 85025715a8
4 changed files with 2 additions and 29 deletions

View File

@ -185,8 +185,8 @@ func CheckComplexity(p CppParameter, isReturnType bool) error {
return ErrTooComplex return ErrTooComplex
} }
if p.IsFlagType() && p.Pointer && !isReturnType { if p.ParameterType == "QFormLayout::ItemRole" && p.Pointer && !isReturnType { // Out-parameters in QFormLayout
return ErrTooComplex // e.g. qformlayout. The cast doesn't survive through a pointer parameter return ErrTooComplex
} }
if p.Pointer && p.PointerCount >= 2 { // Out-parameters if p.Pointer && p.PointerCount >= 2 { // Out-parameters

View File

@ -191,18 +191,6 @@ QLayoutItem* QFormLayout_ItemAt(const QFormLayout* self, int row, int role) {
return self->itemAt(static_cast<int>(row), static_cast<QFormLayout::ItemRole>(role)); return self->itemAt(static_cast<int>(row), static_cast<QFormLayout::ItemRole>(role));
} }
void QFormLayout_GetItemPosition(const QFormLayout* self, int index, int* rowPtr, int* rolePtr) {
self->getItemPosition(static_cast<int>(index), static_cast<int*>(rowPtr), static_cast<QFormLayout::ItemRole*>(rolePtr));
}
void QFormLayout_GetWidgetPosition(const QFormLayout* self, QWidget* widget, int* rowPtr, int* rolePtr) {
self->getWidgetPosition(widget, static_cast<int*>(rowPtr), static_cast<QFormLayout::ItemRole*>(rolePtr));
}
void QFormLayout_GetLayoutPosition(const QFormLayout* self, QLayout* layout, int* rowPtr, int* rolePtr) {
self->getLayoutPosition(layout, static_cast<int*>(rowPtr), static_cast<QFormLayout::ItemRole*>(rolePtr));
}
QWidget* QFormLayout_LabelForField(const QFormLayout* self, QWidget* field) { QWidget* QFormLayout_LabelForField(const QFormLayout* self, QWidget* field) {
return self->labelForField(field); return self->labelForField(field);
} }

View File

@ -255,18 +255,6 @@ func (this *QFormLayout) ItemAt(row int, role QFormLayout__ItemRole) *QLayoutIte
return newQLayoutItem_U(unsafe.Pointer(C.QFormLayout_ItemAt(this.h, (C.int)(row), (C.int)(role)))) return newQLayoutItem_U(unsafe.Pointer(C.QFormLayout_ItemAt(this.h, (C.int)(row), (C.int)(role))))
} }
func (this *QFormLayout) GetItemPosition(index int, rowPtr *int, rolePtr *QFormLayout__ItemRole) {
C.QFormLayout_GetItemPosition(this.h, (C.int)(index), (*C.int)(unsafe.Pointer(rowPtr)), (*C.int)(unsafe.Pointer(rolePtr)))
}
func (this *QFormLayout) GetWidgetPosition(widget *QWidget, rowPtr *int, rolePtr *QFormLayout__ItemRole) {
C.QFormLayout_GetWidgetPosition(this.h, widget.cPointer(), (*C.int)(unsafe.Pointer(rowPtr)), (*C.int)(unsafe.Pointer(rolePtr)))
}
func (this *QFormLayout) GetLayoutPosition(layout *QLayout, rowPtr *int, rolePtr *QFormLayout__ItemRole) {
C.QFormLayout_GetLayoutPosition(this.h, layout.cPointer(), (*C.int)(unsafe.Pointer(rowPtr)), (*C.int)(unsafe.Pointer(rolePtr)))
}
func (this *QFormLayout) LabelForField(field *QWidget) *QWidget { func (this *QFormLayout) LabelForField(field *QWidget) *QWidget {
return newQWidget_U(unsafe.Pointer(C.QFormLayout_LabelForField(this.h, field.cPointer()))) return newQWidget_U(unsafe.Pointer(C.QFormLayout_LabelForField(this.h, field.cPointer())))
} }

View File

@ -78,9 +78,6 @@ void QFormLayout_SetItem(QFormLayout* self, int row, int role, QLayoutItem* item
void QFormLayout_SetWidget(QFormLayout* self, int row, int role, QWidget* widget); void QFormLayout_SetWidget(QFormLayout* self, int row, int role, QWidget* widget);
void QFormLayout_SetLayout(QFormLayout* self, int row, int role, QLayout* layout); void QFormLayout_SetLayout(QFormLayout* self, int row, int role, QLayout* layout);
QLayoutItem* QFormLayout_ItemAt(const QFormLayout* self, int row, int role); QLayoutItem* QFormLayout_ItemAt(const QFormLayout* self, int row, int role);
void QFormLayout_GetItemPosition(const QFormLayout* self, int index, int* rowPtr, int* rolePtr);
void QFormLayout_GetWidgetPosition(const QFormLayout* self, QWidget* widget, int* rowPtr, int* rolePtr);
void QFormLayout_GetLayoutPosition(const QFormLayout* self, QLayout* layout, int* rowPtr, int* rolePtr);
QWidget* QFormLayout_LabelForField(const QFormLayout* self, QWidget* field); QWidget* QFormLayout_LabelForField(const QFormLayout* self, QWidget* field);
QWidget* QFormLayout_LabelForFieldWithField(const QFormLayout* self, QLayout* field); QWidget* QFormLayout_LabelForFieldWithField(const QFormLayout* self, QLayout* field);
void QFormLayout_AddItem(QFormLayout* self, QLayoutItem* item); void QFormLayout_AddItem(QFormLayout* self, QLayoutItem* item);