From e4756d1e763870faa749138108a27352d707bdb0 Mon Sep 17 00:00:00 2001 From: mappu Date: Fri, 24 Jan 2025 18:51:12 +1300 Subject: [PATCH] qt: rebuild (add checks for zero length byte slices) --- qt-extras/scintillaedit/gen_ScintillaEdit.go | 30 ++++++++-- .../qscintilla/gen_qsciscintilla.go | 18 +++++- .../qscintilla/gen_qsciscintillabase.go | 18 +++++- .../qscintilla6/gen_qsciscintilla.go | 18 +++++- .../qscintilla6/gen_qsciscintillabase.go | 18 +++++- qt/cbor/gen_qcborstreamreader.go | 12 +++- qt/cbor/gen_qcborstreamwriter.go | 6 +- qt/cbor/gen_qcborvalue.go | 30 ++++++++-- qt/gen_qabstractbutton.go | 6 +- qt/gen_qabstracteventdispatcher.go | 6 +- qt/gen_qabstractitemmodel.go | 18 +++++- qt/gen_qabstractitemview.go | 6 +- qt/gen_qabstractnativeeventfilter.go | 6 +- qt/gen_qabstractproxymodel.go | 6 +- qt/gen_qabstractscrollarea.go | 6 +- qt/gen_qabstractslider.go | 6 +- qt/gen_qabstractspinbox.go | 6 +- qt/gen_qbuffer.go | 6 +- qt/gen_qbytearraymatcher.go | 24 ++++++-- qt/gen_qcalendarwidget.go | 6 +- qt/gen_qcheckbox.go | 6 +- qt/gen_qcolordialog.go | 6 +- qt/gen_qcolorspace.go | 6 +- qt/gen_qcolumnview.go | 6 +- qt/gen_qcombobox.go | 6 +- qt/gen_qcommandlinkbutton.go | 6 +- qt/gen_qconcatenatetablesproxymodel.go | 6 +- qt/gen_qcoreevent.go | 6 +- qt/gen_qcryptographichash.go | 12 +++- qt/gen_qdatastream.go | 6 +- qt/gen_qdatawidgetmapper.go | 6 +- qt/gen_qdatetimeedit.go | 18 +++++- qt/gen_qdebug.go | 6 +- qt/gen_qdesktopwidget.go | 6 +- qt/gen_qdial.go | 6 +- qt/gen_qdialog.go | 6 +- qt/gen_qdialogbuttonbox.go | 6 +- qt/gen_qdirmodel.go | 6 +- qt/gen_qdockwidget.go | 6 +- qt/gen_qerrormessage.go | 6 +- qt/gen_qfile.go | 6 +- qt/gen_qfiledialog.go | 18 +++++- qt/gen_qfilesystemmodel.go | 6 +- qt/gen_qfocusframe.go | 6 +- qt/gen_qfontcombobox.go | 6 +- qt/gen_qfontdatabase.go | 6 +- qt/gen_qfontdialog.go | 6 +- qt/gen_qframe.go | 6 +- qt/gen_qgraphicsview.go | 6 +- qt/gen_qgroupbox.go | 6 +- qt/gen_qheaderview.go | 12 +++- qt/gen_qidentityproxymodel.go | 6 +- qt/gen_qimage.go | 24 ++++++-- qt/gen_qimageiohandler.go | 30 ++++++++-- qt/gen_qimagereader.go | 24 ++++++-- qt/gen_qimagewriter.go | 30 ++++++++-- qt/gen_qinputdialog.go | 6 +- qt/gen_qiodevice.go | 6 +- qt/gen_qitemeditorfactory.go | 6 +- qt/gen_qjsondocument.go | 24 ++++++-- qt/gen_qkeysequenceedit.go | 6 +- qt/gen_qlabel.go | 6 +- qt/gen_qlcdnumber.go | 6 +- qt/gen_qlineedit.go | 6 +- qt/gen_qlistview.go | 6 +- qt/gen_qlistwidget.go | 6 +- qt/gen_qmainwindow.go | 18 +++++- qt/gen_qmdiarea.go | 6 +- qt/gen_qmdisubwindow.go | 6 +- qt/gen_qmenu.go | 6 +- qt/gen_qmenubar.go | 6 +- qt/gen_qmessageauthenticationcode.go | 30 ++++++++-- qt/gen_qmessagebox.go | 6 +- qt/gen_qmetatype.go | 12 +++- qt/gen_qmimedata.go | 6 +- qt/gen_qmimedatabase.go | 12 +++- qt/gen_qmovie.go | 30 ++++++++-- qt/gen_qpdfwriter.go | 18 +++++- qt/gen_qpixmap.go | 18 +++++- qt/gen_qplaintextedit.go | 6 +- qt/gen_qprogressbar.go | 6 +- qt/gen_qprogressdialog.go | 6 +- qt/gen_qpropertyanimation.go | 18 +++++- qt/gen_qpushbutton.go | 6 +- qt/gen_qradiobutton.go | 6 +- qt/gen_qrasterwindow.go | 6 +- qt/gen_qrawfont.go | 18 +++++- qt/gen_qrubberband.go | 6 +- qt/gen_qscrollarea.go | 6 +- qt/gen_qscrollbar.go | 6 +- qt/gen_qsignaltransition.go | 6 +- qt/gen_qsizegrip.go | 6 +- qt/gen_qslider.go | 6 +- qt/gen_qsortfilterproxymodel.go | 6 +- qt/gen_qspinbox.go | 12 +++- qt/gen_qsplashscreen.go | 6 +- qt/gen_qsplitter.go | 18 +++++- qt/gen_qstackedwidget.go | 6 +- qt/gen_qstandarditemmodel.go | 12 +++- qt/gen_qstatusbar.go | 6 +- qt/gen_qstringlistmodel.go | 6 +- qt/gen_qtabbar.go | 6 +- qt/gen_qtableview.go | 6 +- qt/gen_qtablewidget.go | 6 +- qt/gen_qtabwidget.go | 6 +- qt/gen_qtextbrowser.go | 6 +- qt/gen_qtextcodec.go | 42 ++++++++++--- qt/gen_qtextdocument.go | 6 +- qt/gen_qtextdocumentfragment.go | 6 +- qt/gen_qtextdocumentwriter.go | 18 +++++- qt/gen_qtextedit.go | 6 +- qt/gen_qtextstream.go | 24 ++++++-- qt/gen_qtimezone.go | 60 +++++++++++++++---- qt/gen_qtoolbar.go | 6 +- qt/gen_qtoolbox.go | 6 +- qt/gen_qtoolbutton.go | 6 +- qt/gen_qtransposeproxymodel.go | 6 +- qt/gen_qtreeview.go | 6 +- qt/gen_qtreewidget.go | 6 +- qt/gen_qundoview.go | 6 +- qt/gen_qurl.go | 42 ++++++++++--- qt/gen_quuid.go | 24 ++++++-- qt/gen_qvariant.go | 6 +- qt/gen_qwidget.go | 12 +++- qt/gen_qwindow.go | 6 +- qt/gen_qwizard.go | 12 +++- qt/gen_qxmlstream.go | 12 +++- qt/multimedia/gen_qaudiobuffer.go | 12 +++- qt/multimedia/gen_qaudiosystemplugin.go | 42 ++++++++++--- qt/multimedia/gen_qcamera.go | 18 +++++- qt/multimedia/gen_qcamerainfo.go | 6 +- qt/multimedia/gen_qcameraviewfinder.go | 6 +- .../gen_qmediaserviceproviderplugin.go | 48 ++++++++++++--- qt/multimedia/gen_qvideowidget.go | 6 +- qt/network/gen_qabstractnetworkcache.go | 12 +++- qt/network/gen_qdtls.go | 30 ++++++++-- qt/network/gen_qhttpmultipart.go | 24 ++++++-- qt/network/gen_qnetworkaccessmanager.go | 42 ++++++++++--- qt/network/gen_qnetworkcookie.go | 36 +++++++++-- qt/network/gen_qnetworkdatagram.go | 30 ++++++++-- qt/network/gen_qnetworkproxy.go | 24 ++++++-- qt/network/gen_qnetworkreply.go | 12 +++- qt/network/gen_qnetworkrequest.go | 24 ++++++-- qt/network/gen_qsslcertificate.go | 42 ++++++++++--- qt/network/gen_qsslconfiguration.go | 24 ++++++-- qt/network/gen_qssldiffiehellmanparameters.go | 12 +++- qt/network/gen_qsslkey.go | 48 ++++++++++++--- .../gen_qsslpresharedkeyauthenticator.go | 12 +++- qt/network/gen_qsslsocket.go | 6 +- qt/network/gen_qudpsocket.go | 6 +- qt/printsupport/gen_qabstractprintdialog.go | 6 +- qt/printsupport/gen_qpagesetupdialog.go | 6 +- qt/printsupport/gen_qprintdialog.go | 6 +- qt/printsupport/gen_qprintpreviewdialog.go | 6 +- qt/printsupport/gen_qprintpreviewwidget.go | 6 +- qt/svg/gen_qsvgrenderer.go | 18 +++++- qt/svg/gen_qsvgwidget.go | 12 +++- qt/webengine/gen_qwebenginehttprequest.go | 36 +++++++++-- qt/webengine/gen_qwebenginepage.go | 18 +++++- qt/webengine/gen_qwebengineprofile.go | 18 +++++- qt/webengine/gen_qwebengineurlrequestinfo.go | 12 +++- qt/webengine/gen_qwebengineurlrequestjob.go | 6 +- qt/webengine/gen_qwebengineurlscheme.go | 18 +++++- qt/webengine/gen_qwebengineview.go | 24 ++++++-- qt/webkit/gen_qgraphicswebview.go | 24 ++++++-- qt/webkit/gen_qwebframe.go | 24 ++++++-- qt/webkit/gen_qwebinspector.go | 6 +- qt/webkit/gen_qwebview.go | 30 ++++++++-- qt6/cbor/gen_qcborstreamreader.go | 12 +++- qt6/cbor/gen_qcborstreamwriter.go | 6 +- qt6/cbor/gen_qcborvalue.go | 36 +++++++++-- qt6/gen_qabstractbutton.go | 6 +- qt6/gen_qabstracteventdispatcher.go | 6 +- qt6/gen_qabstractitemmodel.go | 18 +++++- qt6/gen_qabstractitemview.go | 6 +- qt6/gen_qabstractnativeeventfilter.go | 6 +- qt6/gen_qabstractproxymodel.go | 6 +- qt6/gen_qabstractscrollarea.go | 6 +- qt6/gen_qabstractslider.go | 6 +- qt6/gen_qabstractspinbox.go | 6 +- qt6/gen_qanystringview.go | 6 +- qt6/gen_qbuffer.go | 6 +- qt6/gen_qbytearraymatcher.go | 12 +++- qt6/gen_qcalendarwidget.go | 6 +- qt6/gen_qcheckbox.go | 6 +- qt6/gen_qcolordialog.go | 6 +- qt6/gen_qcolorspace.go | 6 +- qt6/gen_qcolumnview.go | 6 +- qt6/gen_qcombobox.go | 6 +- qt6/gen_qcommandlinkbutton.go | 6 +- qt6/gen_qconcatenatetablesproxymodel.go | 6 +- qt6/gen_qcoreevent.go | 6 +- qt6/gen_qdatastream.go | 6 +- qt6/gen_qdatawidgetmapper.go | 6 +- qt6/gen_qdatetimeedit.go | 18 +++++- qt6/gen_qdebug.go | 6 +- qt6/gen_qdial.go | 6 +- qt6/gen_qdialog.go | 6 +- qt6/gen_qdialogbuttonbox.go | 6 +- qt6/gen_qdockwidget.go | 6 +- qt6/gen_qerrormessage.go | 6 +- qt6/gen_qfile.go | 6 +- qt6/gen_qfiledialog.go | 18 +++++- qt6/gen_qfilesystemmodel.go | 6 +- qt6/gen_qfocusframe.go | 6 +- qt6/gen_qfontcombobox.go | 6 +- qt6/gen_qfontdatabase.go | 6 +- qt6/gen_qfontdialog.go | 6 +- qt6/gen_qframe.go | 6 +- qt6/gen_qgraphicsview.go | 6 +- qt6/gen_qgroupbox.go | 6 +- qt6/gen_qheaderview.go | 12 +++- qt6/gen_qidentityproxymodel.go | 6 +- qt6/gen_qimage.go | 24 ++++++-- qt6/gen_qimageiohandler.go | 24 ++++++-- qt6/gen_qimagereader.go | 24 ++++++-- qt6/gen_qimagewriter.go | 30 ++++++++-- qt6/gen_qinputdialog.go | 6 +- qt6/gen_qiodevice.go | 6 +- qt6/gen_qitemeditorfactory.go | 6 +- qt6/gen_qjsondocument.go | 12 +++- qt6/gen_qkeysequenceedit.go | 6 +- qt6/gen_qlabel.go | 6 +- qt6/gen_qlcdnumber.go | 6 +- qt6/gen_qlineedit.go | 6 +- qt6/gen_qlistview.go | 6 +- qt6/gen_qlistwidget.go | 6 +- qt6/gen_qmainwindow.go | 18 +++++- qt6/gen_qmdiarea.go | 6 +- qt6/gen_qmdisubwindow.go | 6 +- qt6/gen_qmenu.go | 6 +- qt6/gen_qmenubar.go | 6 +- qt6/gen_qmessageauthenticationcode.go | 30 ++++++++-- qt6/gen_qmessagebox.go | 6 +- qt6/gen_qmetatype.go | 12 +++- qt6/gen_qmimedata.go | 6 +- qt6/gen_qmimedatabase.go | 12 +++- qt6/gen_qmovie.go | 30 ++++++++-- qt6/gen_qpdfwriter.go | 18 +++++- qt6/gen_qpixmap.go | 18 +++++- qt6/gen_qplaintextedit.go | 6 +- qt6/gen_qprogressbar.go | 6 +- qt6/gen_qprogressdialog.go | 6 +- qt6/gen_qpropertyanimation.go | 18 +++++- qt6/gen_qpushbutton.go | 6 +- qt6/gen_qradiobutton.go | 6 +- qt6/gen_qrasterwindow.go | 6 +- qt6/gen_qrawfont.go | 18 +++++- qt6/gen_qrubberband.go | 6 +- qt6/gen_qscrollarea.go | 6 +- qt6/gen_qscrollbar.go | 6 +- qt6/gen_qsizegrip.go | 6 +- qt6/gen_qslider.go | 6 +- qt6/gen_qsortfilterproxymodel.go | 6 +- qt6/gen_qspinbox.go | 12 +++- qt6/gen_qsplashscreen.go | 6 +- qt6/gen_qsplitter.go | 18 +++++- qt6/gen_qstackedwidget.go | 6 +- qt6/gen_qstandarditemmodel.go | 12 +++- qt6/gen_qstatusbar.go | 6 +- qt6/gen_qstringlistmodel.go | 6 +- qt6/gen_qtabbar.go | 6 +- qt6/gen_qtableview.go | 6 +- qt6/gen_qtablewidget.go | 6 +- qt6/gen_qtabwidget.go | 6 +- qt6/gen_qtextbrowser.go | 6 +- qt6/gen_qtextdocumentwriter.go | 18 +++++- qt6/gen_qtextedit.go | 6 +- qt6/gen_qtextstream.go | 24 ++++++-- qt6/gen_qtimezone.go | 60 +++++++++++++++---- qt6/gen_qtoolbar.go | 6 +- qt6/gen_qtoolbox.go | 6 +- qt6/gen_qtoolbutton.go | 6 +- qt6/gen_qtransposeproxymodel.go | 6 +- qt6/gen_qtreeview.go | 6 +- qt6/gen_qtreewidget.go | 6 +- qt6/gen_qundoview.go | 6 +- qt6/gen_qurl.go | 48 ++++++++++++--- qt6/gen_quuid.go | 12 +++- qt6/gen_qvariant.go | 6 +- qt6/gen_qwidget.go | 12 +++- qt6/gen_qwindow.go | 6 +- qt6/gen_qwizard.go | 12 +++- qt6/gen_qxmlstream.go | 12 +++- qt6/multimedia/gen_qaudiobuffer.go | 12 +++- qt6/multimedia/gen_qvideowidget.go | 6 +- qt6/network/gen_qabstractnetworkcache.go | 12 +++- qt6/network/gen_qdtls.go | 30 ++++++++-- qt6/network/gen_qhttpmultipart.go | 24 ++++++-- qt6/network/gen_qnetworkaccessmanager.go | 42 ++++++++++--- qt6/network/gen_qnetworkcookie.go | 36 +++++++++-- qt6/network/gen_qnetworkdatagram.go | 30 ++++++++-- qt6/network/gen_qnetworkproxy.go | 24 ++++++-- qt6/network/gen_qnetworkreply.go | 12 +++- qt6/network/gen_qnetworkrequest.go | 24 ++++++-- qt6/network/gen_qsslcertificate.go | 42 ++++++++++--- qt6/network/gen_qsslconfiguration.go | 24 ++++++-- .../gen_qssldiffiehellmanparameters.go | 12 +++- qt6/network/gen_qsslkey.go | 48 ++++++++++++--- .../gen_qsslpresharedkeyauthenticator.go | 12 +++- qt6/network/gen_qsslsocket.go | 6 +- qt6/network/gen_qudpsocket.go | 6 +- qt6/printsupport/gen_qabstractprintdialog.go | 6 +- qt6/printsupport/gen_qpagesetupdialog.go | 6 +- qt6/printsupport/gen_qprintdialog.go | 6 +- qt6/printsupport/gen_qprintpreviewdialog.go | 6 +- qt6/printsupport/gen_qprintpreviewwidget.go | 6 +- qt6/svg/gen_qsvgrenderer.go | 18 +++++- qt6/svg/gen_qsvgwidget.go | 12 +++- qt6/webengine/gen_qwebenginehttprequest.go | 36 +++++++++-- qt6/webengine/gen_qwebenginepage.go | 18 +++++- qt6/webengine/gen_qwebengineprofile.go | 18 +++++- qt6/webengine/gen_qwebengineurlrequestinfo.go | 12 +++- qt6/webengine/gen_qwebengineurlrequestjob.go | 6 +- qt6/webengine/gen_qwebengineurlscheme.go | 18 +++++- qt6/webengine/gen_qwebengineview.go | 24 ++++++-- 316 files changed, 3265 insertions(+), 653 deletions(-) diff --git a/qt-extras/scintillaedit/gen_ScintillaEdit.go b/qt-extras/scintillaedit/gen_ScintillaEdit.go index 3021dca0..07b932dd 100644 --- a/qt-extras/scintillaedit/gen_ScintillaEdit.go +++ b/qt-extras/scintillaedit/gen_ScintillaEdit.go @@ -6022,7 +6022,11 @@ func miqt_exec_callback_ScintillaEditBase_UpdateUi(cb C.intptr_t, updated C.int) func (this *ScintillaEditBase) Modified(typeVal Scintilla__ModificationFlags, position uintptr, length uintptr, linesAdded uintptr, text []byte, line uintptr, foldNow Scintilla__FoldLevel, foldPrev Scintilla__FoldLevel) { text_alias := C.struct_miqt_string{} - text_alias.data = (*C.char)(unsafe.Pointer(&text[0])) + if len(text) > 0 { + text_alias.data = (*C.char)(unsafe.Pointer(&text[0])) + } else { + text_alias.data = (*C.char)(unsafe.Pointer(nil)) + } text_alias.len = C.size_t(len(text)) C.ScintillaEditBase_Modified(this.h, (C.int)(typeVal), (C.intptr_t)(position), (C.intptr_t)(length), (C.intptr_t)(linesAdded), text_alias, (C.intptr_t)(line), (C.int)(foldNow), (C.int)(foldPrev)) } @@ -7691,7 +7695,11 @@ func miqt_exec_callback_ScintillaEditBase_HideEvent(self *C.ScintillaEditBase, c func (this *ScintillaEditBase) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.ScintillaEditBase_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) @@ -8157,7 +8165,11 @@ func (this *ScintillaDocument) IsReadOnly() bool { func (this *ScintillaDocument) InsertString(position int, str []byte) { str_alias := C.struct_miqt_string{} - str_alias.data = (*C.char)(unsafe.Pointer(&str[0])) + if len(str) > 0 { + str_alias.data = (*C.char)(unsafe.Pointer(&str[0])) + } else { + str_alias.data = (*C.char)(unsafe.Pointer(nil)) + } str_alias.len = C.size_t(len(str)) C.ScintillaDocument_InsertString(this.h, (C.int)(position), str_alias) } @@ -8292,7 +8304,11 @@ func miqt_exec_callback_ScintillaDocument_SavePoint(cb C.intptr_t, atSavePoint C func (this *ScintillaDocument) Modified(position int, modification_type int, text []byte, length int, linesAdded int, line int, foldLevelNow int, foldLevelPrev int) { text_alias := C.struct_miqt_string{} - text_alias.data = (*C.char)(unsafe.Pointer(&text[0])) + if len(text) > 0 { + text_alias.data = (*C.char)(unsafe.Pointer(&text[0])) + } else { + text_alias.data = (*C.char)(unsafe.Pointer(nil)) + } text_alias.len = C.size_t(len(text)) C.ScintillaDocument_Modified(this.h, (C.int)(position), (C.int)(modification_type), text_alias, (C.int)(length), (C.int)(linesAdded), (C.int)(line), (C.int)(foldLevelNow), (C.int)(foldLevelPrev)) } @@ -13361,7 +13377,11 @@ func miqt_exec_callback_ScintillaEdit_HideEvent(self *C.ScintillaEdit, cb C.intp func (this *ScintillaEdit) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.ScintillaEdit_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt-restricted-extras/qscintilla/gen_qsciscintilla.go b/qt-restricted-extras/qscintilla/gen_qsciscintilla.go index f2cc2e1d..8729b27d 100644 --- a/qt-restricted-extras/qscintilla/gen_qsciscintilla.go +++ b/qt-restricted-extras/qscintilla/gen_qsciscintilla.go @@ -4248,7 +4248,11 @@ func miqt_exec_callback_QsciScintilla_FromMimeData(self *C.QsciScintilla, cb C.i virtualReturn := gofunc((&QsciScintilla{h: self}).callVirtualBase_FromMimeData, slotval1, slotval2) virtualReturn_alias := C.struct_miqt_string{} - virtualReturn_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn[0])) + if len(virtualReturn) > 0 { + virtualReturn_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn[0])) + } else { + virtualReturn_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_alias.len = C.size_t(len(virtualReturn)) return virtualReturn_alias @@ -4257,7 +4261,11 @@ func miqt_exec_callback_QsciScintilla_FromMimeData(self *C.QsciScintilla, cb C.i func (this *QsciScintilla) callVirtualBase_ToMimeData(text []byte, rectangular bool) *qt.QMimeData { text_alias := C.struct_miqt_string{} - text_alias.data = (*C.char)(unsafe.Pointer(&text[0])) + if len(text) > 0 { + text_alias.data = (*C.char)(unsafe.Pointer(&text[0])) + } else { + text_alias.data = (*C.char)(unsafe.Pointer(nil)) + } text_alias.len = C.size_t(len(text)) return qt.UnsafeNewQMimeData(unsafe.Pointer(C.QsciScintilla_virtualbase_ToMimeData(unsafe.Pointer(this.h), text_alias, (C.bool)(rectangular)))) @@ -5270,7 +5278,11 @@ func miqt_exec_callback_QsciScintilla_HideEvent(self *C.QsciScintilla, cb C.intp func (this *QsciScintilla) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QsciScintilla_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt-restricted-extras/qscintilla/gen_qsciscintillabase.go b/qt-restricted-extras/qscintilla/gen_qsciscintillabase.go index 298b2142..f4f73a97 100644 --- a/qt-restricted-extras/qscintilla/gen_qsciscintillabase.go +++ b/qt-restricted-extras/qscintilla/gen_qsciscintillabase.go @@ -2253,7 +2253,11 @@ func miqt_exec_callback_QsciScintillaBase_FromMimeData(self *C.QsciScintillaBase virtualReturn := gofunc((&QsciScintillaBase{h: self}).callVirtualBase_FromMimeData, slotval1, slotval2) virtualReturn_alias := C.struct_miqt_string{} - virtualReturn_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn[0])) + if len(virtualReturn) > 0 { + virtualReturn_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn[0])) + } else { + virtualReturn_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_alias.len = C.size_t(len(virtualReturn)) return virtualReturn_alias @@ -2262,7 +2266,11 @@ func miqt_exec_callback_QsciScintillaBase_FromMimeData(self *C.QsciScintillaBase func (this *QsciScintillaBase) callVirtualBase_ToMimeData(text []byte, rectangular bool) *qt.QMimeData { text_alias := C.struct_miqt_string{} - text_alias.data = (*C.char)(unsafe.Pointer(&text[0])) + if len(text) > 0 { + text_alias.data = (*C.char)(unsafe.Pointer(&text[0])) + } else { + text_alias.data = (*C.char)(unsafe.Pointer(nil)) + } text_alias.len = C.size_t(len(text)) return qt.UnsafeNewQMimeData(unsafe.Pointer(C.QsciScintillaBase_virtualbase_ToMimeData(unsafe.Pointer(this.h), text_alias, (C.bool)(rectangular)))) @@ -3381,7 +3389,11 @@ func miqt_exec_callback_QsciScintillaBase_HideEvent(self *C.QsciScintillaBase, c func (this *QsciScintillaBase) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QsciScintillaBase_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt-restricted-extras/qscintilla6/gen_qsciscintilla.go b/qt-restricted-extras/qscintilla6/gen_qsciscintilla.go index b7296ea4..a0153741 100644 --- a/qt-restricted-extras/qscintilla6/gen_qsciscintilla.go +++ b/qt-restricted-extras/qscintilla6/gen_qsciscintilla.go @@ -4217,7 +4217,11 @@ func miqt_exec_callback_QsciScintilla_FromMimeData(self *C.QsciScintilla, cb C.i virtualReturn := gofunc((&QsciScintilla{h: self}).callVirtualBase_FromMimeData, slotval1, slotval2) virtualReturn_alias := C.struct_miqt_string{} - virtualReturn_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn[0])) + if len(virtualReturn) > 0 { + virtualReturn_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn[0])) + } else { + virtualReturn_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_alias.len = C.size_t(len(virtualReturn)) return virtualReturn_alias @@ -4226,7 +4230,11 @@ func miqt_exec_callback_QsciScintilla_FromMimeData(self *C.QsciScintilla, cb C.i func (this *QsciScintilla) callVirtualBase_ToMimeData(text []byte, rectangular bool) *qt6.QMimeData { text_alias := C.struct_miqt_string{} - text_alias.data = (*C.char)(unsafe.Pointer(&text[0])) + if len(text) > 0 { + text_alias.data = (*C.char)(unsafe.Pointer(&text[0])) + } else { + text_alias.data = (*C.char)(unsafe.Pointer(nil)) + } text_alias.len = C.size_t(len(text)) return qt6.UnsafeNewQMimeData(unsafe.Pointer(C.QsciScintilla_virtualbase_ToMimeData(unsafe.Pointer(this.h), text_alias, (C.bool)(rectangular)))) @@ -5265,7 +5273,11 @@ func miqt_exec_callback_QsciScintilla_HideEvent(self *C.QsciScintilla, cb C.intp func (this *QsciScintilla) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QsciScintilla_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt-restricted-extras/qscintilla6/gen_qsciscintillabase.go b/qt-restricted-extras/qscintilla6/gen_qsciscintillabase.go index 3bf21a69..fc706d75 100644 --- a/qt-restricted-extras/qscintilla6/gen_qsciscintillabase.go +++ b/qt-restricted-extras/qscintilla6/gen_qsciscintillabase.go @@ -2222,7 +2222,11 @@ func miqt_exec_callback_QsciScintillaBase_FromMimeData(self *C.QsciScintillaBase virtualReturn := gofunc((&QsciScintillaBase{h: self}).callVirtualBase_FromMimeData, slotval1, slotval2) virtualReturn_alias := C.struct_miqt_string{} - virtualReturn_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn[0])) + if len(virtualReturn) > 0 { + virtualReturn_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn[0])) + } else { + virtualReturn_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_alias.len = C.size_t(len(virtualReturn)) return virtualReturn_alias @@ -2231,7 +2235,11 @@ func miqt_exec_callback_QsciScintillaBase_FromMimeData(self *C.QsciScintillaBase func (this *QsciScintillaBase) callVirtualBase_ToMimeData(text []byte, rectangular bool) *qt6.QMimeData { text_alias := C.struct_miqt_string{} - text_alias.data = (*C.char)(unsafe.Pointer(&text[0])) + if len(text) > 0 { + text_alias.data = (*C.char)(unsafe.Pointer(&text[0])) + } else { + text_alias.data = (*C.char)(unsafe.Pointer(nil)) + } text_alias.len = C.size_t(len(text)) return qt6.UnsafeNewQMimeData(unsafe.Pointer(C.QsciScintillaBase_virtualbase_ToMimeData(unsafe.Pointer(this.h), text_alias, (C.bool)(rectangular)))) @@ -3376,7 +3384,11 @@ func miqt_exec_callback_QsciScintillaBase_HideEvent(self *C.QsciScintillaBase, c func (this *QsciScintillaBase) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QsciScintillaBase_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt/cbor/gen_qcborstreamreader.go b/qt/cbor/gen_qcborstreamreader.go index 73c54e0e..0c6bc2e1 100644 --- a/qt/cbor/gen_qcborstreamreader.go +++ b/qt/cbor/gen_qcborstreamreader.go @@ -97,7 +97,11 @@ func NewQCborStreamReader3(data *byte, lenVal int64) *QCborStreamReader { // NewQCborStreamReader4 constructs a new QCborStreamReader object. func NewQCborStreamReader4(data []byte) *QCborStreamReader { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return newQCborStreamReader(C.QCborStreamReader_new4(data_alias)) @@ -119,7 +123,11 @@ func (this *QCborStreamReader) Device() *qt.QIODevice { func (this *QCborStreamReader) AddData(data []byte) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) C.QCborStreamReader_AddData(this.h, data_alias) } diff --git a/qt/cbor/gen_qcborstreamwriter.go b/qt/cbor/gen_qcborstreamwriter.go index 654fb079..a37a16fa 100644 --- a/qt/cbor/gen_qcborstreamwriter.go +++ b/qt/cbor/gen_qcborstreamwriter.go @@ -74,7 +74,11 @@ func (this *QCborStreamWriter) AppendWithQCborNegativeInteger(n QCborNegativeInt func (this *QCborStreamWriter) AppendWithBa(ba []byte) { ba_alias := C.struct_miqt_string{} - ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + if len(ba) > 0 { + ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + } else { + ba_alias.data = (*C.char)(unsafe.Pointer(nil)) + } ba_alias.len = C.size_t(len(ba)) C.QCborStreamWriter_AppendWithBa(this.h, ba_alias) } diff --git a/qt/cbor/gen_qcborvalue.go b/qt/cbor/gen_qcborvalue.go index 4625eaa6..7d5843df 100644 --- a/qt/cbor/gen_qcborvalue.go +++ b/qt/cbor/gen_qcborvalue.go @@ -190,7 +190,11 @@ func NewQCborValue8(st QCborSimpleType) *QCborValue { // NewQCborValue9 constructs a new QCborValue object. func NewQCborValue9(ba []byte) *QCborValue { ba_alias := C.struct_miqt_string{} - ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + if len(ba) > 0 { + ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + } else { + ba_alias.data = (*C.char)(unsafe.Pointer(nil)) + } ba_alias.len = C.size_t(len(ba)) return newQCborValue(C.QCborValue_new9(ba_alias)) @@ -540,7 +544,11 @@ func QCborValue_FromCbor(reader *QCborStreamReader) *QCborValue { func QCborValue_FromCborWithBa(ba []byte) *QCborValue { ba_alias := C.struct_miqt_string{} - ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + if len(ba) > 0 { + ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + } else { + ba_alias.data = (*C.char)(unsafe.Pointer(nil)) + } ba_alias.len = C.size_t(len(ba)) _goptr := newQCborValue(C.QCborValue_FromCborWithBa(ba_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer @@ -607,7 +615,11 @@ func (this *QCborValue) TaggedValue1(defaultValue *QCborValue) *QCborValue { func (this *QCborValue) ToByteArray1(defaultValue []byte) []byte { defaultValue_alias := C.struct_miqt_string{} - defaultValue_alias.data = (*C.char)(unsafe.Pointer(&defaultValue[0])) + if len(defaultValue) > 0 { + defaultValue_alias.data = (*C.char)(unsafe.Pointer(&defaultValue[0])) + } else { + defaultValue_alias.data = (*C.char)(unsafe.Pointer(nil)) + } defaultValue_alias.len = C.size_t(len(defaultValue)) var _bytearray C.struct_miqt_string = C.QCborValue_ToByteArray1(this.h, defaultValue_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) @@ -652,7 +664,11 @@ func (this *QCborValue) ToUuid1(defaultValue *qt.QUuid) *qt.QUuid { func QCborValue_FromCbor22(ba []byte, error *QCborParserError) *QCborValue { ba_alias := C.struct_miqt_string{} - ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + if len(ba) > 0 { + ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + } else { + ba_alias.data = (*C.char)(unsafe.Pointer(nil)) + } ba_alias.len = C.size_t(len(ba)) _goptr := newQCborValue(C.QCborValue_FromCbor22(ba_alias, error.cPointer())) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer @@ -1027,7 +1043,11 @@ func (this *QCborValueRef) ToDouble1(defaultValue float64) float64 { func (this *QCborValueRef) ToByteArray1(defaultValue []byte) []byte { defaultValue_alias := C.struct_miqt_string{} - defaultValue_alias.data = (*C.char)(unsafe.Pointer(&defaultValue[0])) + if len(defaultValue) > 0 { + defaultValue_alias.data = (*C.char)(unsafe.Pointer(&defaultValue[0])) + } else { + defaultValue_alias.data = (*C.char)(unsafe.Pointer(nil)) + } defaultValue_alias.len = C.size_t(len(defaultValue)) var _bytearray C.struct_miqt_string = C.QCborValueRef_ToByteArray1(this.h, defaultValue_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) diff --git a/qt/gen_qabstractbutton.go b/qt/gen_qabstractbutton.go index daf0bba3..3d1d6d17 100644 --- a/qt/gen_qabstractbutton.go +++ b/qt/gen_qabstractbutton.go @@ -1304,7 +1304,11 @@ func miqt_exec_callback_QAbstractButton_HideEvent(self *C.QAbstractButton, cb C. func (this *QAbstractButton) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QAbstractButton_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qabstracteventdispatcher.go b/qt/gen_qabstracteventdispatcher.go index ef8bab41..68c7a739 100644 --- a/qt/gen_qabstracteventdispatcher.go +++ b/qt/gen_qabstracteventdispatcher.go @@ -160,7 +160,11 @@ func (this *QAbstractEventDispatcher) RemoveNativeEventFilter(filterObj *QAbstra func (this *QAbstractEventDispatcher) FilterNativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QAbstractEventDispatcher_FilterNativeEvent(this.h, eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) } diff --git a/qt/gen_qabstractitemmodel.go b/qt/gen_qabstractitemmodel.go index a78ff61f..a66d48be 100644 --- a/qt/gen_qabstractitemmodel.go +++ b/qt/gen_qabstractitemmodel.go @@ -2037,7 +2037,11 @@ func miqt_exec_callback_QAbstractItemModel_RoleNames(self *C.QAbstractItemModel, for virtualReturn_k, virtualReturn_v := range virtualReturn { virtualReturn_Keys_CArray[virtualReturn_ctr] = (C.int)(virtualReturn_k) virtualReturn_v_alias := C.struct_miqt_string{} - virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + if len(virtualReturn_v) > 0 { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + } else { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_v_alias.len = C.size_t(len(virtualReturn_v)) virtualReturn_Values_CArray[virtualReturn_ctr] = virtualReturn_v_alias virtualReturn_ctr++ @@ -3461,7 +3465,11 @@ func miqt_exec_callback_QAbstractTableModel_RoleNames(self *C.QAbstractTableMode for virtualReturn_k, virtualReturn_v := range virtualReturn { virtualReturn_Keys_CArray[virtualReturn_ctr] = (C.int)(virtualReturn_k) virtualReturn_v_alias := C.struct_miqt_string{} - virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + if len(virtualReturn_v) > 0 { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + } else { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_v_alias.len = C.size_t(len(virtualReturn_v)) virtualReturn_Values_CArray[virtualReturn_ctr] = virtualReturn_v_alias virtualReturn_ctr++ @@ -4863,7 +4871,11 @@ func miqt_exec_callback_QAbstractListModel_RoleNames(self *C.QAbstractListModel, for virtualReturn_k, virtualReturn_v := range virtualReturn { virtualReturn_Keys_CArray[virtualReturn_ctr] = (C.int)(virtualReturn_k) virtualReturn_v_alias := C.struct_miqt_string{} - virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + if len(virtualReturn_v) > 0 { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + } else { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_v_alias.len = C.size_t(len(virtualReturn_v)) virtualReturn_Values_CArray[virtualReturn_ctr] = virtualReturn_v_alias virtualReturn_ctr++ diff --git a/qt/gen_qabstractitemview.go b/qt/gen_qabstractitemview.go index 06be24d2..4d5c1e45 100644 --- a/qt/gen_qabstractitemview.go +++ b/qt/gen_qabstractitemview.go @@ -2768,7 +2768,11 @@ func miqt_exec_callback_QAbstractItemView_HideEvent(self *C.QAbstractItemView, c func (this *QAbstractItemView) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QAbstractItemView_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qabstractnativeeventfilter.go b/qt/gen_qabstractnativeeventfilter.go index e749d370..82f90942 100644 --- a/qt/gen_qabstractnativeeventfilter.go +++ b/qt/gen_qabstractnativeeventfilter.go @@ -54,7 +54,11 @@ func NewQAbstractNativeEventFilter() *QAbstractNativeEventFilter { func (this *QAbstractNativeEventFilter) NativeEventFilter(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QAbstractNativeEventFilter_NativeEventFilter(this.h, eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) } diff --git a/qt/gen_qabstractproxymodel.go b/qt/gen_qabstractproxymodel.go index 32edd8ff..fa9717f6 100644 --- a/qt/gen_qabstractproxymodel.go +++ b/qt/gen_qabstractproxymodel.go @@ -1554,7 +1554,11 @@ func miqt_exec_callback_QAbstractProxyModel_RoleNames(self *C.QAbstractProxyMode for virtualReturn_k, virtualReturn_v := range virtualReturn { virtualReturn_Keys_CArray[virtualReturn_ctr] = (C.int)(virtualReturn_k) virtualReturn_v_alias := C.struct_miqt_string{} - virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + if len(virtualReturn_v) > 0 { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + } else { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_v_alias.len = C.size_t(len(virtualReturn_v)) virtualReturn_Values_CArray[virtualReturn_ctr] = virtualReturn_v_alias virtualReturn_ctr++ diff --git a/qt/gen_qabstractscrollarea.go b/qt/gen_qabstractscrollarea.go index b27cf01b..cdbb3652 100644 --- a/qt/gen_qabstractscrollarea.go +++ b/qt/gen_qabstractscrollarea.go @@ -1236,7 +1236,11 @@ func miqt_exec_callback_QAbstractScrollArea_HideEvent(self *C.QAbstractScrollAre func (this *QAbstractScrollArea) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QAbstractScrollArea_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qabstractslider.go b/qt/gen_qabstractslider.go index a6cbbdbf..cda1ef26 100644 --- a/qt/gen_qabstractslider.go +++ b/qt/gen_qabstractslider.go @@ -1283,7 +1283,11 @@ func miqt_exec_callback_QAbstractSlider_HideEvent(self *C.QAbstractSlider, cb C. func (this *QAbstractSlider) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QAbstractSlider_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qabstractspinbox.go b/qt/gen_qabstractspinbox.go index de0e51e9..d5376b66 100644 --- a/qt/gen_qabstractspinbox.go +++ b/qt/gen_qabstractspinbox.go @@ -1403,7 +1403,11 @@ func miqt_exec_callback_QAbstractSpinBox_DropEvent(self *C.QAbstractSpinBox, cb func (this *QAbstractSpinBox) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QAbstractSpinBox_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qbuffer.go b/qt/gen_qbuffer.go index 61fe6135..1e499e80 100644 --- a/qt/gen_qbuffer.go +++ b/qt/gen_qbuffer.go @@ -106,7 +106,11 @@ func (this *QBuffer) Buffer2() []byte { func (this *QBuffer) SetData(data []byte) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) C.QBuffer_SetData(this.h, data_alias) } diff --git a/qt/gen_qbytearraymatcher.go b/qt/gen_qbytearraymatcher.go index 20b4ca80..7b7864a9 100644 --- a/qt/gen_qbytearraymatcher.go +++ b/qt/gen_qbytearraymatcher.go @@ -54,7 +54,11 @@ func NewQByteArrayMatcher() *QByteArrayMatcher { // NewQByteArrayMatcher2 constructs a new QByteArrayMatcher object. func NewQByteArrayMatcher2(pattern []byte) *QByteArrayMatcher { pattern_alias := C.struct_miqt_string{} - pattern_alias.data = (*C.char)(unsafe.Pointer(&pattern[0])) + if len(pattern) > 0 { + pattern_alias.data = (*C.char)(unsafe.Pointer(&pattern[0])) + } else { + pattern_alias.data = (*C.char)(unsafe.Pointer(nil)) + } pattern_alias.len = C.size_t(len(pattern)) return newQByteArrayMatcher(C.QByteArrayMatcher_new2(pattern_alias)) @@ -80,14 +84,22 @@ func (this *QByteArrayMatcher) OperatorAssign(other *QByteArrayMatcher) { func (this *QByteArrayMatcher) SetPattern(pattern []byte) { pattern_alias := C.struct_miqt_string{} - pattern_alias.data = (*C.char)(unsafe.Pointer(&pattern[0])) + if len(pattern) > 0 { + pattern_alias.data = (*C.char)(unsafe.Pointer(&pattern[0])) + } else { + pattern_alias.data = (*C.char)(unsafe.Pointer(nil)) + } pattern_alias.len = C.size_t(len(pattern)) C.QByteArrayMatcher_SetPattern(this.h, pattern_alias) } func (this *QByteArrayMatcher) IndexIn(ba []byte) int { ba_alias := C.struct_miqt_string{} - ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + if len(ba) > 0 { + ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + } else { + ba_alias.data = (*C.char)(unsafe.Pointer(nil)) + } ba_alias.len = C.size_t(len(ba)) return (int)(C.QByteArrayMatcher_IndexIn(this.h, ba_alias)) } @@ -107,7 +119,11 @@ func (this *QByteArrayMatcher) Pattern() []byte { func (this *QByteArrayMatcher) IndexIn22(ba []byte, from int) int { ba_alias := C.struct_miqt_string{} - ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + if len(ba) > 0 { + ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + } else { + ba_alias.data = (*C.char)(unsafe.Pointer(nil)) + } ba_alias.len = C.size_t(len(ba)) return (int)(C.QByteArrayMatcher_IndexIn22(this.h, ba_alias, (C.int)(from))) } diff --git a/qt/gen_qcalendarwidget.go b/qt/gen_qcalendarwidget.go index dc37fe8b..25fd6bd6 100644 --- a/qt/gen_qcalendarwidget.go +++ b/qt/gen_qcalendarwidget.go @@ -1338,7 +1338,11 @@ func miqt_exec_callback_QCalendarWidget_HideEvent(self *C.QCalendarWidget, cb C. func (this *QCalendarWidget) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QCalendarWidget_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qcheckbox.go b/qt/gen_qcheckbox.go index 07ed255e..0a1036f5 100644 --- a/qt/gen_qcheckbox.go +++ b/qt/gen_qcheckbox.go @@ -1169,7 +1169,11 @@ func miqt_exec_callback_QCheckBox_HideEvent(self *C.QCheckBox, cb C.intptr_t, ev func (this *QCheckBox) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QCheckBox_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qcolordialog.go b/qt/gen_qcolordialog.go index 5c64fb91..f9990190 100644 --- a/qt/gen_qcolordialog.go +++ b/qt/gen_qcolordialog.go @@ -1325,7 +1325,11 @@ func miqt_exec_callback_QColorDialog_HideEvent(self *C.QColorDialog, cb C.intptr func (this *QColorDialog) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QColorDialog_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qcolorspace.go b/qt/gen_qcolorspace.go index de7ff916..24328814 100644 --- a/qt/gen_qcolorspace.go +++ b/qt/gen_qcolorspace.go @@ -167,7 +167,11 @@ func (this *QColorSpace) IsValid() bool { func QColorSpace_FromIccProfile(iccProfile []byte) *QColorSpace { iccProfile_alias := C.struct_miqt_string{} - iccProfile_alias.data = (*C.char)(unsafe.Pointer(&iccProfile[0])) + if len(iccProfile) > 0 { + iccProfile_alias.data = (*C.char)(unsafe.Pointer(&iccProfile[0])) + } else { + iccProfile_alias.data = (*C.char)(unsafe.Pointer(nil)) + } iccProfile_alias.len = C.size_t(len(iccProfile)) _goptr := newQColorSpace(C.QColorSpace_FromIccProfile(iccProfile_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer diff --git a/qt/gen_qcolumnview.go b/qt/gen_qcolumnview.go index 0cffdddf..22a4dd1e 100644 --- a/qt/gen_qcolumnview.go +++ b/qt/gen_qcolumnview.go @@ -2425,7 +2425,11 @@ func miqt_exec_callback_QColumnView_HideEvent(self *C.QColumnView, cb C.intptr_t func (this *QColumnView) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QColumnView_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qcombobox.go b/qt/gen_qcombobox.go index d694f09d..4dae776d 100644 --- a/qt/gen_qcombobox.go +++ b/qt/gen_qcombobox.go @@ -1804,7 +1804,11 @@ func miqt_exec_callback_QComboBox_DropEvent(self *C.QComboBox, cb C.intptr_t, ev func (this *QComboBox) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QComboBox_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qcommandlinkbutton.go b/qt/gen_qcommandlinkbutton.go index 21ecc43b..77d42a50 100644 --- a/qt/gen_qcommandlinkbutton.go +++ b/qt/gen_qcommandlinkbutton.go @@ -1160,7 +1160,11 @@ func miqt_exec_callback_QCommandLinkButton_HideEvent(self *C.QCommandLinkButton, func (this *QCommandLinkButton) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QCommandLinkButton_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qconcatenatetablesproxymodel.go b/qt/gen_qconcatenatetablesproxymodel.go index 9dbc41cc..9932b005 100644 --- a/qt/gen_qconcatenatetablesproxymodel.go +++ b/qt/gen_qconcatenatetablesproxymodel.go @@ -1374,7 +1374,11 @@ func miqt_exec_callback_QConcatenateTablesProxyModel_RoleNames(self *C.QConcaten for virtualReturn_k, virtualReturn_v := range virtualReturn { virtualReturn_Keys_CArray[virtualReturn_ctr] = (C.int)(virtualReturn_k) virtualReturn_v_alias := C.struct_miqt_string{} - virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + if len(virtualReturn_v) > 0 { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + } else { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_v_alias.len = C.size_t(len(virtualReturn_v)) virtualReturn_Values_CArray[virtualReturn_ctr] = virtualReturn_v_alias virtualReturn_ctr++ diff --git a/qt/gen_qcoreevent.go b/qt/gen_qcoreevent.go index 4bc8d7b6..0d502f38 100644 --- a/qt/gen_qcoreevent.go +++ b/qt/gen_qcoreevent.go @@ -467,7 +467,11 @@ func UnsafeNewQDynamicPropertyChangeEvent(h unsafe.Pointer) *QDynamicPropertyCha // NewQDynamicPropertyChangeEvent constructs a new QDynamicPropertyChangeEvent object. func NewQDynamicPropertyChangeEvent(name []byte) *QDynamicPropertyChangeEvent { name_alias := C.struct_miqt_string{} - name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + if len(name) > 0 { + name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + } else { + name_alias.data = (*C.char)(unsafe.Pointer(nil)) + } name_alias.len = C.size_t(len(name)) return newQDynamicPropertyChangeEvent(C.QDynamicPropertyChangeEvent_new(name_alias)) diff --git a/qt/gen_qcryptographichash.go b/qt/gen_qcryptographichash.go index 435324b6..6bac5ec6 100644 --- a/qt/gen_qcryptographichash.go +++ b/qt/gen_qcryptographichash.go @@ -87,7 +87,11 @@ func (this *QCryptographicHash) AddData(data string, length int) { func (this *QCryptographicHash) AddDataWithData(data []byte) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) C.QCryptographicHash_AddDataWithData(this.h, data_alias) } @@ -105,7 +109,11 @@ func (this *QCryptographicHash) Result() []byte { func QCryptographicHash_Hash(data []byte, method QCryptographicHash__Algorithm) []byte { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) var _bytearray C.struct_miqt_string = C.QCryptographicHash_Hash(data_alias, (C.int)(method)) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) diff --git a/qt/gen_qdatastream.go b/qt/gen_qdatastream.go index 2713a167..ff5d216a 100644 --- a/qt/gen_qdatastream.go +++ b/qt/gen_qdatastream.go @@ -121,7 +121,11 @@ func NewQDataStream2(param1 *QIODevice) *QDataStream { // NewQDataStream3 constructs a new QDataStream object. func NewQDataStream3(param1 []byte) *QDataStream { param1_alias := C.struct_miqt_string{} - param1_alias.data = (*C.char)(unsafe.Pointer(¶m1[0])) + if len(param1) > 0 { + param1_alias.data = (*C.char)(unsafe.Pointer(¶m1[0])) + } else { + param1_alias.data = (*C.char)(unsafe.Pointer(nil)) + } param1_alias.len = C.size_t(len(param1)) return newQDataStream(C.QDataStream_new3(param1_alias)) diff --git a/qt/gen_qdatawidgetmapper.go b/qt/gen_qdatawidgetmapper.go index 2037ff2a..9bef215e 100644 --- a/qt/gen_qdatawidgetmapper.go +++ b/qt/gen_qdatawidgetmapper.go @@ -145,7 +145,11 @@ func (this *QDataWidgetMapper) AddMapping(widget *QWidget, section int) { func (this *QDataWidgetMapper) AddMapping2(widget *QWidget, section int, propertyName []byte) { propertyName_alias := C.struct_miqt_string{} - propertyName_alias.data = (*C.char)(unsafe.Pointer(&propertyName[0])) + if len(propertyName) > 0 { + propertyName_alias.data = (*C.char)(unsafe.Pointer(&propertyName[0])) + } else { + propertyName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } propertyName_alias.len = C.size_t(len(propertyName)) C.QDataWidgetMapper_AddMapping2(this.h, widget.cPointer(), (C.int)(section), propertyName_alias) } diff --git a/qt/gen_qdatetimeedit.go b/qt/gen_qdatetimeedit.go index 4c30ec7b..0bdd836b 100644 --- a/qt/gen_qdatetimeedit.go +++ b/qt/gen_qdatetimeedit.go @@ -1639,7 +1639,11 @@ func miqt_exec_callback_QDateTimeEdit_DropEvent(self *C.QDateTimeEdit, cb C.intp func (this *QDateTimeEdit) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QDateTimeEdit_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) @@ -3268,7 +3272,11 @@ func miqt_exec_callback_QTimeEdit_DropEvent(self *C.QTimeEdit, cb C.intptr_t, ev func (this *QTimeEdit) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QTimeEdit_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) @@ -4897,7 +4905,11 @@ func miqt_exec_callback_QDateEdit_DropEvent(self *C.QDateEdit, cb C.intptr_t, ev func (this *QDateEdit) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QDateEdit_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qdebug.go b/qt/gen_qdebug.go index ca88d609..698b9479 100644 --- a/qt/gen_qdebug.go +++ b/qt/gen_qdebug.go @@ -189,7 +189,11 @@ func (this *QDebug) OperatorShiftLeftWithQString(t string) *QDebug { func (this *QDebug) OperatorShiftLeftWithQByteArray(t []byte) *QDebug { t_alias := C.struct_miqt_string{} - t_alias.data = (*C.char)(unsafe.Pointer(&t[0])) + if len(t) > 0 { + t_alias.data = (*C.char)(unsafe.Pointer(&t[0])) + } else { + t_alias.data = (*C.char)(unsafe.Pointer(nil)) + } t_alias.len = C.size_t(len(t)) return newQDebug(C.QDebug_OperatorShiftLeftWithQByteArray(this.h, t_alias)) } diff --git a/qt/gen_qdesktopwidget.go b/qt/gen_qdesktopwidget.go index b59c3ba4..8e041d99 100644 --- a/qt/gen_qdesktopwidget.go +++ b/qt/gen_qdesktopwidget.go @@ -1126,7 +1126,11 @@ func miqt_exec_callback_QDesktopWidget_HideEvent(self *C.QDesktopWidget, cb C.in func (this *QDesktopWidget) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QDesktopWidget_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qdial.go b/qt/gen_qdial.go index c6fcc092..86f0d1d3 100644 --- a/qt/gen_qdial.go +++ b/qt/gen_qdial.go @@ -1089,7 +1089,11 @@ func miqt_exec_callback_QDial_HideEvent(self *C.QDial, cb C.intptr_t, event *C.Q func (this *QDial) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QDial_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qdialog.go b/qt/gen_qdialog.go index d1ca4d4a..c0763608 100644 --- a/qt/gen_qdialog.go +++ b/qt/gen_qdialog.go @@ -1264,7 +1264,11 @@ func miqt_exec_callback_QDialog_HideEvent(self *C.QDialog, cb C.intptr_t, event func (this *QDialog) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QDialog_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qdialogbuttonbox.go b/qt/gen_qdialogbuttonbox.go index 736628a6..7ced3e43 100644 --- a/qt/gen_qdialogbuttonbox.go +++ b/qt/gen_qdialogbuttonbox.go @@ -1226,7 +1226,11 @@ func miqt_exec_callback_QDialogButtonBox_HideEvent(self *C.QDialogButtonBox, cb func (this *QDialogButtonBox) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QDialogButtonBox_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qdirmodel.go b/qt/gen_qdirmodel.go index 55a9a539..54d6bb23 100644 --- a/qt/gen_qdirmodel.go +++ b/qt/gen_qdirmodel.go @@ -1501,7 +1501,11 @@ func miqt_exec_callback_QDirModel_RoleNames(self *C.QDirModel, cb C.intptr_t) C. for virtualReturn_k, virtualReturn_v := range virtualReturn { virtualReturn_Keys_CArray[virtualReturn_ctr] = (C.int)(virtualReturn_k) virtualReturn_v_alias := C.struct_miqt_string{} - virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + if len(virtualReturn_v) > 0 { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + } else { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_v_alias.len = C.size_t(len(virtualReturn_v)) virtualReturn_Values_CArray[virtualReturn_ctr] = virtualReturn_v_alias virtualReturn_ctr++ diff --git a/qt/gen_qdockwidget.go b/qt/gen_qdockwidget.go index 4f2bfa14..da7298ea 100644 --- a/qt/gen_qdockwidget.go +++ b/qt/gen_qdockwidget.go @@ -1194,7 +1194,11 @@ func miqt_exec_callback_QDockWidget_HideEvent(self *C.QDockWidget, cb C.intptr_t func (this *QDockWidget) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QDockWidget_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qerrormessage.go b/qt/gen_qerrormessage.go index 576eb43c..6c9ac1ce 100644 --- a/qt/gen_qerrormessage.go +++ b/qt/gen_qerrormessage.go @@ -1171,7 +1171,11 @@ func miqt_exec_callback_QErrorMessage_HideEvent(self *C.QErrorMessage, cb C.intp func (this *QErrorMessage) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QErrorMessage_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qfile.go b/qt/gen_qfile.go index f311fc90..bfff3731 100644 --- a/qt/gen_qfile.go +++ b/qt/gen_qfile.go @@ -138,7 +138,11 @@ func QFile_EncodeName(fileName string) []byte { func QFile_DecodeName(localFileName []byte) string { localFileName_alias := C.struct_miqt_string{} - localFileName_alias.data = (*C.char)(unsafe.Pointer(&localFileName[0])) + if len(localFileName) > 0 { + localFileName_alias.data = (*C.char)(unsafe.Pointer(&localFileName[0])) + } else { + localFileName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } localFileName_alias.len = C.size_t(len(localFileName)) var _ms C.struct_miqt_string = C.QFile_DecodeName(localFileName_alias) _ret := C.GoStringN(_ms.data, C.int(int64(_ms.len))) diff --git a/qt/gen_qfiledialog.go b/qt/gen_qfiledialog.go index ae3e9f95..df182085 100644 --- a/qt/gen_qfiledialog.go +++ b/qt/gen_qfiledialog.go @@ -429,7 +429,11 @@ func (this *QFileDialog) SaveState() []byte { func (this *QFileDialog) RestoreState(state []byte) bool { state_alias := C.struct_miqt_string{} - state_alias.data = (*C.char)(unsafe.Pointer(&state[0])) + if len(state) > 0 { + state_alias.data = (*C.char)(unsafe.Pointer(&state[0])) + } else { + state_alias.data = (*C.char)(unsafe.Pointer(nil)) + } state_alias.len = C.size_t(len(state)) return (bool)(C.QFileDialog_RestoreState(this.h, state_alias)) } @@ -877,7 +881,11 @@ func QFileDialog_GetOpenFileUrls() []QUrl { func QFileDialog_SaveFileContent(fileContent []byte, fileNameHint string) { fileContent_alias := C.struct_miqt_string{} - fileContent_alias.data = (*C.char)(unsafe.Pointer(&fileContent[0])) + if len(fileContent) > 0 { + fileContent_alias.data = (*C.char)(unsafe.Pointer(&fileContent[0])) + } else { + fileContent_alias.data = (*C.char)(unsafe.Pointer(nil)) + } fileContent_alias.len = C.size_t(len(fileContent)) fileNameHint_ms := C.struct_miqt_string{} fileNameHint_ms.data = C.CString(fileNameHint) @@ -2375,7 +2383,11 @@ func miqt_exec_callback_QFileDialog_HideEvent(self *C.QFileDialog, cb C.intptr_t func (this *QFileDialog) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QFileDialog_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qfilesystemmodel.go b/qt/gen_qfilesystemmodel.go index d08667d5..c8245883 100644 --- a/qt/gen_qfilesystemmodel.go +++ b/qt/gen_qfilesystemmodel.go @@ -1703,7 +1703,11 @@ func miqt_exec_callback_QFileSystemModel_RoleNames(self *C.QFileSystemModel, cb for virtualReturn_k, virtualReturn_v := range virtualReturn { virtualReturn_Keys_CArray[virtualReturn_ctr] = (C.int)(virtualReturn_k) virtualReturn_v_alias := C.struct_miqt_string{} - virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + if len(virtualReturn_v) > 0 { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + } else { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_v_alias.len = C.size_t(len(virtualReturn_v)) virtualReturn_Values_CArray[virtualReturn_ctr] = virtualReturn_v_alias virtualReturn_ctr++ diff --git a/qt/gen_qfocusframe.go b/qt/gen_qfocusframe.go index d209ffde..42671ca3 100644 --- a/qt/gen_qfocusframe.go +++ b/qt/gen_qfocusframe.go @@ -1009,7 +1009,11 @@ func miqt_exec_callback_QFocusFrame_HideEvent(self *C.QFocusFrame, cb C.intptr_t func (this *QFocusFrame) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QFocusFrame_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qfontcombobox.go b/qt/gen_qfontcombobox.go index 5821ca5d..25b73201 100644 --- a/qt/gen_qfontcombobox.go +++ b/qt/gen_qfontcombobox.go @@ -1161,7 +1161,11 @@ func miqt_exec_callback_QFontComboBox_DropEvent(self *C.QFontComboBox, cb C.intp func (this *QFontComboBox) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QFontComboBox_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qfontdatabase.go b/qt/gen_qfontdatabase.go index 9fb8d17d..4131a1f8 100644 --- a/qt/gen_qfontdatabase.go +++ b/qt/gen_qfontdatabase.go @@ -333,7 +333,11 @@ func QFontDatabase_AddApplicationFont(fileName string) int { func QFontDatabase_AddApplicationFontFromData(fontData []byte) int { fontData_alias := C.struct_miqt_string{} - fontData_alias.data = (*C.char)(unsafe.Pointer(&fontData[0])) + if len(fontData) > 0 { + fontData_alias.data = (*C.char)(unsafe.Pointer(&fontData[0])) + } else { + fontData_alias.data = (*C.char)(unsafe.Pointer(nil)) + } fontData_alias.len = C.size_t(len(fontData)) return (int)(C.QFontDatabase_AddApplicationFontFromData(fontData_alias)) } diff --git a/qt/gen_qfontdialog.go b/qt/gen_qfontdialog.go index 40768385..5b4221ae 100644 --- a/qt/gen_qfontdialog.go +++ b/qt/gen_qfontdialog.go @@ -1294,7 +1294,11 @@ func miqt_exec_callback_QFontDialog_HideEvent(self *C.QFontDialog, cb C.intptr_t func (this *QFontDialog) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QFontDialog_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qframe.go b/qt/gen_qframe.go index 5fb7a097..0047b65e 100644 --- a/qt/gen_qframe.go +++ b/qt/gen_qframe.go @@ -1090,7 +1090,11 @@ func miqt_exec_callback_QFrame_HideEvent(self *C.QFrame, cb C.intptr_t, event *C func (this *QFrame) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QFrame_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qgraphicsview.go b/qt/gen_qgraphicsview.go index 97938185..dff34ce1 100644 --- a/qt/gen_qgraphicsview.go +++ b/qt/gen_qgraphicsview.go @@ -1830,7 +1830,11 @@ func miqt_exec_callback_QGraphicsView_HideEvent(self *C.QGraphicsView, cb C.intp func (this *QGraphicsView) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QGraphicsView_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qgroupbox.go b/qt/gen_qgroupbox.go index 1dc441f9..0339a2ea 100644 --- a/qt/gen_qgroupbox.go +++ b/qt/gen_qgroupbox.go @@ -1153,7 +1153,11 @@ func miqt_exec_callback_QGroupBox_HideEvent(self *C.QGroupBox, cb C.intptr_t, ev func (this *QGroupBox) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QGroupBox_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qheaderview.go b/qt/gen_qheaderview.go index 07da316f..008e1eda 100644 --- a/qt/gen_qheaderview.go +++ b/qt/gen_qheaderview.go @@ -355,7 +355,11 @@ func (this *QHeaderView) SaveState() []byte { func (this *QHeaderView) RestoreState(state []byte) bool { state_alias := C.struct_miqt_string{} - state_alias.data = (*C.char)(unsafe.Pointer(&state[0])) + if len(state) > 0 { + state_alias.data = (*C.char)(unsafe.Pointer(&state[0])) + } else { + state_alias.data = (*C.char)(unsafe.Pointer(nil)) + } state_alias.len = C.size_t(len(state)) return (bool)(C.QHeaderView_RestoreState(this.h, state_alias)) } @@ -2862,7 +2866,11 @@ func miqt_exec_callback_QHeaderView_HideEvent(self *C.QHeaderView, cb C.intptr_t func (this *QHeaderView) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QHeaderView_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qidentityproxymodel.go b/qt/gen_qidentityproxymodel.go index 8ba6100f..4ee9c4e0 100644 --- a/qt/gen_qidentityproxymodel.go +++ b/qt/gen_qidentityproxymodel.go @@ -1525,7 +1525,11 @@ func miqt_exec_callback_QIdentityProxyModel_RoleNames(self *C.QIdentityProxyMode for virtualReturn_k, virtualReturn_v := range virtualReturn { virtualReturn_Keys_CArray[virtualReturn_ctr] = (C.int)(virtualReturn_k) virtualReturn_v_alias := C.struct_miqt_string{} - virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + if len(virtualReturn_v) > 0 { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + } else { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_v_alias.len = C.size_t(len(virtualReturn_v)) virtualReturn_Values_CArray[virtualReturn_ctr] = virtualReturn_v_alias virtualReturn_ctr++ diff --git a/qt/gen_qimage.go b/qt/gen_qimage.go index 6abfc6eb..ae3455c4 100644 --- a/qt/gen_qimage.go +++ b/qt/gen_qimage.go @@ -563,7 +563,11 @@ func (this *QImage) LoadFromData(buf *byte, lenVal int) bool { func (this *QImage) LoadFromDataWithData(data []byte) bool { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return (bool)(C.QImage_LoadFromDataWithData(this.h, data_alias)) } @@ -588,7 +592,11 @@ func QImage_FromData(data *byte, size int) *QImage { func QImage_FromDataWithData(data []byte) *QImage { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) _goptr := newQImage(C.QImage_FromDataWithData(data_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer @@ -805,7 +813,11 @@ func (this *QImage) LoadFromData3(buf *byte, lenVal int, format string) bool { func (this *QImage) LoadFromData2(data []byte, aformat string) bool { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) aformat_Cstring := C.CString(aformat) defer C.free(unsafe.Pointer(aformat_Cstring)) @@ -854,7 +866,11 @@ func QImage_FromData3(data *byte, size int, format string) *QImage { func QImage_FromData2(data []byte, format string) *QImage { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) format_Cstring := C.CString(format) defer C.free(unsafe.Pointer(format_Cstring)) diff --git a/qt/gen_qimageiohandler.go b/qt/gen_qimageiohandler.go index 54d76b3c..4393bfa8 100644 --- a/qt/gen_qimageiohandler.go +++ b/qt/gen_qimageiohandler.go @@ -108,14 +108,22 @@ func (this *QImageIOHandler) Device() *QIODevice { func (this *QImageIOHandler) SetFormat(format []byte) { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) C.QImageIOHandler_SetFormat(this.h, format_alias) } func (this *QImageIOHandler) SetFormatWithFormat(format []byte) { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) C.QImageIOHandler_SetFormatWithFormat(this.h, format_alias) } @@ -213,7 +221,11 @@ func miqt_exec_callback_QImageIOHandler_Name(self *C.QImageIOHandler, cb C.intpt virtualReturn := gofunc((&QImageIOHandler{h: self}).callVirtualBase_Name) virtualReturn_alias := C.struct_miqt_string{} - virtualReturn_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn[0])) + if len(virtualReturn) > 0 { + virtualReturn_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn[0])) + } else { + virtualReturn_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_alias.len = C.size_t(len(virtualReturn)) return virtualReturn_alias @@ -647,14 +659,22 @@ func QImageIOPlugin_TrUtf8(s string) string { func (this *QImageIOPlugin) Capabilities(device *QIODevice, format []byte) QImageIOPlugin__Capability { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) return (QImageIOPlugin__Capability)(C.QImageIOPlugin_Capabilities(this.h, device.cPointer(), format_alias)) } func (this *QImageIOPlugin) Create(device *QIODevice, format []byte) *QImageIOHandler { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) return newQImageIOHandler(C.QImageIOPlugin_Create(this.h, device.cPointer(), format_alias)) } diff --git a/qt/gen_qimagereader.go b/qt/gen_qimagereader.go index 1a4e88de..c07e5ee1 100644 --- a/qt/gen_qimagereader.go +++ b/qt/gen_qimagereader.go @@ -80,7 +80,11 @@ func NewQImageReader3(fileName string) *QImageReader { // NewQImageReader4 constructs a new QImageReader object. func NewQImageReader4(device *QIODevice, format []byte) *QImageReader { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) return newQImageReader(C.QImageReader_new4(device.cPointer(), format_alias)) @@ -93,7 +97,11 @@ func NewQImageReader5(fileName string, format []byte) *QImageReader { fileName_ms.len = C.size_t(len(fileName)) defer C.free(unsafe.Pointer(fileName_ms.data)) format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) return newQImageReader(C.QImageReader_new5(fileName_ms, format_alias)) @@ -119,7 +127,11 @@ func QImageReader_TrUtf8(sourceText string) string { func (this *QImageReader) SetFormat(format []byte) { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) C.QImageReader_SetFormat(this.h, format_alias) } @@ -401,7 +413,11 @@ func QImageReader_SupportedMimeTypes() [][]byte { func QImageReader_ImageFormatsForMimeType(mimeType []byte) [][]byte { mimeType_alias := C.struct_miqt_string{} - mimeType_alias.data = (*C.char)(unsafe.Pointer(&mimeType[0])) + if len(mimeType) > 0 { + mimeType_alias.data = (*C.char)(unsafe.Pointer(&mimeType[0])) + } else { + mimeType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } mimeType_alias.len = C.size_t(len(mimeType)) var _ma C.struct_miqt_array = C.QImageReader_ImageFormatsForMimeType(mimeType_alias) _ret := make([][]byte, int(_ma.len)) diff --git a/qt/gen_qimagewriter.go b/qt/gen_qimagewriter.go index 61c16b4e..c701dd66 100644 --- a/qt/gen_qimagewriter.go +++ b/qt/gen_qimagewriter.go @@ -63,7 +63,11 @@ func NewQImageWriter() *QImageWriter { // NewQImageWriter2 constructs a new QImageWriter object. func NewQImageWriter2(device *QIODevice, format []byte) *QImageWriter { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) return newQImageWriter(C.QImageWriter_new2(device.cPointer(), format_alias)) @@ -86,7 +90,11 @@ func NewQImageWriter4(fileName string, format []byte) *QImageWriter { fileName_ms.len = C.size_t(len(fileName)) defer C.free(unsafe.Pointer(fileName_ms.data)) format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) return newQImageWriter(C.QImageWriter_new4(fileName_ms, format_alias)) @@ -112,7 +120,11 @@ func QImageWriter_TrUtf8(sourceText string) string { func (this *QImageWriter) SetFormat(format []byte) { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) C.QImageWriter_SetFormat(this.h, format_alias) } @@ -173,7 +185,11 @@ func (this *QImageWriter) Gamma() float32 { func (this *QImageWriter) SetSubType(typeVal []byte) { typeVal_alias := C.struct_miqt_string{} - typeVal_alias.data = (*C.char)(unsafe.Pointer(&typeVal[0])) + if len(typeVal) > 0 { + typeVal_alias.data = (*C.char)(unsafe.Pointer(&typeVal[0])) + } else { + typeVal_alias.data = (*C.char)(unsafe.Pointer(nil)) + } typeVal_alias.len = C.size_t(len(typeVal)) C.QImageWriter_SetSubType(this.h, typeVal_alias) } @@ -300,7 +316,11 @@ func QImageWriter_SupportedMimeTypes() [][]byte { func QImageWriter_ImageFormatsForMimeType(mimeType []byte) [][]byte { mimeType_alias := C.struct_miqt_string{} - mimeType_alias.data = (*C.char)(unsafe.Pointer(&mimeType[0])) + if len(mimeType) > 0 { + mimeType_alias.data = (*C.char)(unsafe.Pointer(&mimeType[0])) + } else { + mimeType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } mimeType_alias.len = C.size_t(len(mimeType)) var _ma C.struct_miqt_array = C.QImageWriter_ImageFormatsForMimeType(mimeType_alias) _ret := make([][]byte, int(_ma.len)) diff --git a/qt/gen_qinputdialog.go b/qt/gen_qinputdialog.go index 07dc83c8..93ba75cd 100644 --- a/qt/gen_qinputdialog.go +++ b/qt/gen_qinputdialog.go @@ -2035,7 +2035,11 @@ func miqt_exec_callback_QInputDialog_HideEvent(self *C.QInputDialog, cb C.intptr func (this *QInputDialog) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QInputDialog_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qiodevice.go b/qt/gen_qiodevice.go index a184eeba..e5093285 100644 --- a/qt/gen_qiodevice.go +++ b/qt/gen_qiodevice.go @@ -260,7 +260,11 @@ func (this *QIODevice) WriteWithData(data string) int64 { func (this *QIODevice) Write2(data []byte) int64 { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return (int64)(C.QIODevice_Write2(this.h, data_alias)) } diff --git a/qt/gen_qitemeditorfactory.go b/qt/gen_qitemeditorfactory.go index dd547d29..70c4360b 100644 --- a/qt/gen_qitemeditorfactory.go +++ b/qt/gen_qitemeditorfactory.go @@ -198,7 +198,11 @@ func miqt_exec_callback_QItemEditorFactory_ValuePropertyName(self *C.QItemEditor virtualReturn := gofunc((&QItemEditorFactory{h: self}).callVirtualBase_ValuePropertyName, slotval1) virtualReturn_alias := C.struct_miqt_string{} - virtualReturn_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn[0])) + if len(virtualReturn) > 0 { + virtualReturn_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn[0])) + } else { + virtualReturn_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_alias.len = C.size_t(len(virtualReturn)) return virtualReturn_alias diff --git a/qt/gen_qjsondocument.go b/qt/gen_qjsondocument.go index aebcfa9e..34dc933f 100644 --- a/qt/gen_qjsondocument.go +++ b/qt/gen_qjsondocument.go @@ -179,7 +179,11 @@ func (this *QJsonDocument) RawData(size *int) string { func QJsonDocument_FromBinaryData(data []byte) *QJsonDocument { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) _goptr := newQJsonDocument(C.QJsonDocument_FromBinaryData(data_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer @@ -207,7 +211,11 @@ func (this *QJsonDocument) ToVariant() *QVariant { func QJsonDocument_FromJson(json []byte) *QJsonDocument { json_alias := C.struct_miqt_string{} - json_alias.data = (*C.char)(unsafe.Pointer(&json[0])) + if len(json) > 0 { + json_alias.data = (*C.char)(unsafe.Pointer(&json[0])) + } else { + json_alias.data = (*C.char)(unsafe.Pointer(nil)) + } json_alias.len = C.size_t(len(json)) _goptr := newQJsonDocument(C.QJsonDocument_FromJson(json_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer @@ -298,7 +306,11 @@ func QJsonDocument_FromRawData3(data string, size int, validation QJsonDocument_ func QJsonDocument_FromBinaryData2(data []byte, validation QJsonDocument__DataValidation) *QJsonDocument { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) _goptr := newQJsonDocument(C.QJsonDocument_FromBinaryData2(data_alias, (C.int)(validation))) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer @@ -307,7 +319,11 @@ func QJsonDocument_FromBinaryData2(data []byte, validation QJsonDocument__DataVa func QJsonDocument_FromJson2(json []byte, error *QJsonParseError) *QJsonDocument { json_alias := C.struct_miqt_string{} - json_alias.data = (*C.char)(unsafe.Pointer(&json[0])) + if len(json) > 0 { + json_alias.data = (*C.char)(unsafe.Pointer(&json[0])) + } else { + json_alias.data = (*C.char)(unsafe.Pointer(nil)) + } json_alias.len = C.size_t(len(json)) _goptr := newQJsonDocument(C.QJsonDocument_FromJson2(json_alias, error.cPointer())) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer diff --git a/qt/gen_qkeysequenceedit.go b/qt/gen_qkeysequenceedit.go index 825a7af2..30bfc7f2 100644 --- a/qt/gen_qkeysequenceedit.go +++ b/qt/gen_qkeysequenceedit.go @@ -1060,7 +1060,11 @@ func miqt_exec_callback_QKeySequenceEdit_HideEvent(self *C.QKeySequenceEdit, cb func (this *QKeySequenceEdit) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QKeySequenceEdit_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qlabel.go b/qt/gen_qlabel.go index 4035876b..39fb1a32 100644 --- a/qt/gen_qlabel.go +++ b/qt/gen_qlabel.go @@ -1285,7 +1285,11 @@ func miqt_exec_callback_QLabel_HideEvent(self *C.QLabel, cb C.intptr_t, event *C func (this *QLabel) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QLabel_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qlcdnumber.go b/qt/gen_qlcdnumber.go index 1e3101aa..7efa4c16 100644 --- a/qt/gen_qlcdnumber.go +++ b/qt/gen_qlcdnumber.go @@ -1129,7 +1129,11 @@ func miqt_exec_callback_QLCDNumber_HideEvent(self *C.QLCDNumber, cb C.intptr_t, func (this *QLCDNumber) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QLCDNumber_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qlineedit.go b/qt/gen_qlineedit.go index 29a125cc..b7d7585b 100644 --- a/qt/gen_qlineedit.go +++ b/qt/gen_qlineedit.go @@ -1562,7 +1562,11 @@ func miqt_exec_callback_QLineEdit_HideEvent(self *C.QLineEdit, cb C.intptr_t, ev func (this *QLineEdit) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QLineEdit_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qlistview.go b/qt/gen_qlistview.go index 44fcecef..e6987e2b 100644 --- a/qt/gen_qlistview.go +++ b/qt/gen_qlistview.go @@ -2527,7 +2527,11 @@ func miqt_exec_callback_QListView_HideEvent(self *C.QListView, cb C.intptr_t, ev func (this *QListView) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QListView_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qlistwidget.go b/qt/gen_qlistwidget.go index e7cb10ff..ba1cb190 100644 --- a/qt/gen_qlistwidget.go +++ b/qt/gen_qlistwidget.go @@ -3368,7 +3368,11 @@ func miqt_exec_callback_QListWidget_HideEvent(self *C.QListWidget, cb C.intptr_t func (this *QListWidget) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QListWidget_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qmainwindow.go b/qt/gen_qmainwindow.go index d0ae3b8a..9dc73172 100644 --- a/qt/gen_qmainwindow.go +++ b/qt/gen_qmainwindow.go @@ -324,7 +324,11 @@ func (this *QMainWindow) SaveState() []byte { func (this *QMainWindow) RestoreState(state []byte) bool { state_alias := C.struct_miqt_string{} - state_alias.data = (*C.char)(unsafe.Pointer(&state[0])) + if len(state) > 0 { + state_alias.data = (*C.char)(unsafe.Pointer(&state[0])) + } else { + state_alias.data = (*C.char)(unsafe.Pointer(nil)) + } state_alias.len = C.size_t(len(state)) return (bool)(C.QMainWindow_RestoreState(this.h, state_alias)) } @@ -462,7 +466,11 @@ func (this *QMainWindow) SaveState1(version int) []byte { func (this *QMainWindow) RestoreState2(state []byte, version int) bool { state_alias := C.struct_miqt_string{} - state_alias.data = (*C.char)(unsafe.Pointer(&state[0])) + if len(state) > 0 { + state_alias.data = (*C.char)(unsafe.Pointer(&state[0])) + } else { + state_alias.data = (*C.char)(unsafe.Pointer(nil)) + } state_alias.len = C.size_t(len(state)) return (bool)(C.QMainWindow_RestoreState2(this.h, state_alias, (C.int)(version))) } @@ -1329,7 +1337,11 @@ func miqt_exec_callback_QMainWindow_HideEvent(self *C.QMainWindow, cb C.intptr_t func (this *QMainWindow) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QMainWindow_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qmdiarea.go b/qt/gen_qmdiarea.go index 9949d809..cbe7fd91 100644 --- a/qt/gen_qmdiarea.go +++ b/qt/gen_qmdiarea.go @@ -1387,7 +1387,11 @@ func miqt_exec_callback_QMdiArea_HideEvent(self *C.QMdiArea, cb C.intptr_t, even func (this *QMdiArea) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QMdiArea_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qmdisubwindow.go b/qt/gen_qmdisubwindow.go index 91e92438..ce9ff55a 100644 --- a/qt/gen_qmdisubwindow.go +++ b/qt/gen_qmdisubwindow.go @@ -1213,7 +1213,11 @@ func miqt_exec_callback_QMdiSubWindow_DropEvent(self *C.QMdiSubWindow, cb C.intp func (this *QMdiSubWindow) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QMdiSubWindow_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qmenu.go b/qt/gen_qmenu.go index c78d77c2..2ca7c5a0 100644 --- a/qt/gen_qmenu.go +++ b/qt/gen_qmenu.go @@ -1388,7 +1388,11 @@ func miqt_exec_callback_QMenu_ShowEvent(self *C.QMenu, cb C.intptr_t, event *C.Q func (this *QMenu) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QMenu_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qmenubar.go b/qt/gen_qmenubar.go index 5ec9acd2..e2d19d08 100644 --- a/qt/gen_qmenubar.go +++ b/qt/gen_qmenubar.go @@ -1207,7 +1207,11 @@ func miqt_exec_callback_QMenuBar_HideEvent(self *C.QMenuBar, cb C.intptr_t, even func (this *QMenuBar) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QMenuBar_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qmessageauthenticationcode.go b/qt/gen_qmessageauthenticationcode.go index 480a8c6f..7926d9d6 100644 --- a/qt/gen_qmessageauthenticationcode.go +++ b/qt/gen_qmessageauthenticationcode.go @@ -54,7 +54,11 @@ func NewQMessageAuthenticationCode(method QCryptographicHash__Algorithm) *QMessa // NewQMessageAuthenticationCode2 constructs a new QMessageAuthenticationCode object. func NewQMessageAuthenticationCode2(method QCryptographicHash__Algorithm, key []byte) *QMessageAuthenticationCode { key_alias := C.struct_miqt_string{} - key_alias.data = (*C.char)(unsafe.Pointer(&key[0])) + if len(key) > 0 { + key_alias.data = (*C.char)(unsafe.Pointer(&key[0])) + } else { + key_alias.data = (*C.char)(unsafe.Pointer(nil)) + } key_alias.len = C.size_t(len(key)) return newQMessageAuthenticationCode(C.QMessageAuthenticationCode_new2((C.int)(method), key_alias)) @@ -66,7 +70,11 @@ func (this *QMessageAuthenticationCode) Reset() { func (this *QMessageAuthenticationCode) SetKey(key []byte) { key_alias := C.struct_miqt_string{} - key_alias.data = (*C.char)(unsafe.Pointer(&key[0])) + if len(key) > 0 { + key_alias.data = (*C.char)(unsafe.Pointer(&key[0])) + } else { + key_alias.data = (*C.char)(unsafe.Pointer(nil)) + } key_alias.len = C.size_t(len(key)) C.QMessageAuthenticationCode_SetKey(this.h, key_alias) } @@ -79,7 +87,11 @@ func (this *QMessageAuthenticationCode) AddData(data string, length int) { func (this *QMessageAuthenticationCode) AddDataWithData(data []byte) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) C.QMessageAuthenticationCode_AddDataWithData(this.h, data_alias) } @@ -97,10 +109,18 @@ func (this *QMessageAuthenticationCode) Result() []byte { func QMessageAuthenticationCode_Hash(message []byte, key []byte, method QCryptographicHash__Algorithm) []byte { message_alias := C.struct_miqt_string{} - message_alias.data = (*C.char)(unsafe.Pointer(&message[0])) + if len(message) > 0 { + message_alias.data = (*C.char)(unsafe.Pointer(&message[0])) + } else { + message_alias.data = (*C.char)(unsafe.Pointer(nil)) + } message_alias.len = C.size_t(len(message)) key_alias := C.struct_miqt_string{} - key_alias.data = (*C.char)(unsafe.Pointer(&key[0])) + if len(key) > 0 { + key_alias.data = (*C.char)(unsafe.Pointer(&key[0])) + } else { + key_alias.data = (*C.char)(unsafe.Pointer(nil)) + } key_alias.len = C.size_t(len(key)) var _bytearray C.struct_miqt_string = C.QMessageAuthenticationCode_Hash(message_alias, key_alias, (C.int)(method)) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) diff --git a/qt/gen_qmessagebox.go b/qt/gen_qmessagebox.go index cc433e8e..9bf5db08 100644 --- a/qt/gen_qmessagebox.go +++ b/qt/gen_qmessagebox.go @@ -2301,7 +2301,11 @@ func miqt_exec_callback_QMessageBox_HideEvent(self *C.QMessageBox, cb C.intptr_t func (this *QMessageBox) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QMessageBox_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qmetatype.go b/qt/gen_qmetatype.go index f7324475..01a7d9f9 100644 --- a/qt/gen_qmetatype.go +++ b/qt/gen_qmetatype.go @@ -203,7 +203,11 @@ func QMetaType_RegisterTypedef(typeName string, aliasId int) int { func QMetaType_RegisterNormalizedTypedef(normalizedTypeName []byte, aliasId int) int { normalizedTypeName_alias := C.struct_miqt_string{} - normalizedTypeName_alias.data = (*C.char)(unsafe.Pointer(&normalizedTypeName[0])) + if len(normalizedTypeName) > 0 { + normalizedTypeName_alias.data = (*C.char)(unsafe.Pointer(&normalizedTypeName[0])) + } else { + normalizedTypeName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } normalizedTypeName_alias.len = C.size_t(len(normalizedTypeName)) return (int)(C.QMetaType_RegisterNormalizedTypedef(normalizedTypeName_alias, (C.int)(aliasId))) } @@ -216,7 +220,11 @@ func QMetaType_Type(typeName string) int { func QMetaType_TypeWithTypeName(typeName []byte) int { typeName_alias := C.struct_miqt_string{} - typeName_alias.data = (*C.char)(unsafe.Pointer(&typeName[0])) + if len(typeName) > 0 { + typeName_alias.data = (*C.char)(unsafe.Pointer(&typeName[0])) + } else { + typeName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } typeName_alias.len = C.size_t(len(typeName)) return (int)(C.QMetaType_TypeWithTypeName(typeName_alias)) } diff --git a/qt/gen_qmimedata.go b/qt/gen_qmimedata.go index c2c0e813..12b878e3 100644 --- a/qt/gen_qmimedata.go +++ b/qt/gen_qmimedata.go @@ -193,7 +193,11 @@ func (this *QMimeData) SetData(mimetype string, data []byte) { mimetype_ms.len = C.size_t(len(mimetype)) defer C.free(unsafe.Pointer(mimetype_ms.data)) data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) C.QMimeData_SetData(this.h, mimetype_ms, data_alias) } diff --git a/qt/gen_qmimedatabase.go b/qt/gen_qmimedatabase.go index 85f770f9..e54239f9 100644 --- a/qt/gen_qmimedatabase.go +++ b/qt/gen_qmimedatabase.go @@ -103,7 +103,11 @@ func (this *QMimeDatabase) MimeTypesForFileName(fileName string) []QMimeType { func (this *QMimeDatabase) MimeTypeForData(data []byte) *QMimeType { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) _goptr := newQMimeType(C.QMimeDatabase_MimeTypeForData(this.h, data_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer @@ -138,7 +142,11 @@ func (this *QMimeDatabase) MimeTypeForFileNameAndData2(fileName string, data []b fileName_ms.len = C.size_t(len(fileName)) defer C.free(unsafe.Pointer(fileName_ms.data)) data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) _goptr := newQMimeType(C.QMimeDatabase_MimeTypeForFileNameAndData2(this.h, fileName_ms, data_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer diff --git a/qt/gen_qmovie.go b/qt/gen_qmovie.go index c48539f1..4a4d76de 100644 --- a/qt/gen_qmovie.go +++ b/qt/gen_qmovie.go @@ -96,7 +96,11 @@ func NewQMovie4(parent *QObject) *QMovie { // NewQMovie5 constructs a new QMovie object. func NewQMovie5(device *QIODevice, format []byte) *QMovie { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) return newQMovie(C.QMovie_new5(device.cPointer(), format_alias)) @@ -105,7 +109,11 @@ func NewQMovie5(device *QIODevice, format []byte) *QMovie { // NewQMovie6 constructs a new QMovie object. func NewQMovie6(device *QIODevice, format []byte, parent *QObject) *QMovie { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) return newQMovie(C.QMovie_new6(device.cPointer(), format_alias, parent.cPointer())) @@ -118,7 +126,11 @@ func NewQMovie7(fileName string, format []byte) *QMovie { fileName_ms.len = C.size_t(len(fileName)) defer C.free(unsafe.Pointer(fileName_ms.data)) format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) return newQMovie(C.QMovie_new7(fileName_ms, format_alias)) @@ -131,7 +143,11 @@ func NewQMovie8(fileName string, format []byte, parent *QObject) *QMovie { fileName_ms.len = C.size_t(len(fileName)) defer C.free(unsafe.Pointer(fileName_ms.data)) format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) return newQMovie(C.QMovie_new8(fileName_ms, format_alias, parent.cPointer())) @@ -203,7 +219,11 @@ func (this *QMovie) FileName() string { func (this *QMovie) SetFormat(format []byte) { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) C.QMovie_SetFormat(this.h, format_alias) } diff --git a/qt/gen_qpdfwriter.go b/qt/gen_qpdfwriter.go index b8a9b65e..d8815aed 100644 --- a/qt/gen_qpdfwriter.go +++ b/qt/gen_qpdfwriter.go @@ -149,7 +149,11 @@ func (this *QPdfWriter) Resolution() int { func (this *QPdfWriter) SetDocumentXmpMetadata(xmpMetadata []byte) { xmpMetadata_alias := C.struct_miqt_string{} - xmpMetadata_alias.data = (*C.char)(unsafe.Pointer(&xmpMetadata[0])) + if len(xmpMetadata) > 0 { + xmpMetadata_alias.data = (*C.char)(unsafe.Pointer(&xmpMetadata[0])) + } else { + xmpMetadata_alias.data = (*C.char)(unsafe.Pointer(nil)) + } xmpMetadata_alias.len = C.size_t(len(xmpMetadata)) C.QPdfWriter_SetDocumentXmpMetadata(this.h, xmpMetadata_alias) } @@ -167,7 +171,11 @@ func (this *QPdfWriter) AddFileAttachment(fileName string, data []byte) { fileName_ms.len = C.size_t(len(fileName)) defer C.free(unsafe.Pointer(fileName_ms.data)) data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) C.QPdfWriter_AddFileAttachment(this.h, fileName_ms, data_alias) } @@ -234,7 +242,11 @@ func (this *QPdfWriter) AddFileAttachment3(fileName string, data []byte, mimeTyp fileName_ms.len = C.size_t(len(fileName)) defer C.free(unsafe.Pointer(fileName_ms.data)) data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) mimeType_ms := C.struct_miqt_string{} mimeType_ms.data = C.CString(mimeType) diff --git a/qt/gen_qpixmap.go b/qt/gen_qpixmap.go index 3b5baf0e..aa998b64 100644 --- a/qt/gen_qpixmap.go +++ b/qt/gen_qpixmap.go @@ -306,7 +306,11 @@ func (this *QPixmap) LoadFromData(buf *byte, lenVal uint) bool { func (this *QPixmap) LoadFromDataWithData(data []byte) bool { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return (bool)(C.QPixmap_LoadFromDataWithData(this.h, data_alias)) } @@ -529,7 +533,11 @@ func (this *QPixmap) LoadFromData4(buf *byte, lenVal uint, format string, flags func (this *QPixmap) LoadFromData2(data []byte, format string) bool { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) format_Cstring := C.CString(format) defer C.free(unsafe.Pointer(format_Cstring)) @@ -538,7 +546,11 @@ func (this *QPixmap) LoadFromData2(data []byte, format string) bool { func (this *QPixmap) LoadFromData32(data []byte, format string, flags ImageConversionFlag) bool { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) format_Cstring := C.CString(format) defer C.free(unsafe.Pointer(format_Cstring)) diff --git a/qt/gen_qplaintextedit.go b/qt/gen_qplaintextedit.go index 1a9c1c32..7b30dc5e 100644 --- a/qt/gen_qplaintextedit.go +++ b/qt/gen_qplaintextedit.go @@ -1965,7 +1965,11 @@ func miqt_exec_callback_QPlainTextEdit_HideEvent(self *C.QPlainTextEdit, cb C.in func (this *QPlainTextEdit) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QPlainTextEdit_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qprogressbar.go b/qt/gen_qprogressbar.go index a49f6a7b..bf4ad950 100644 --- a/qt/gen_qprogressbar.go +++ b/qt/gen_qprogressbar.go @@ -1139,7 +1139,11 @@ func miqt_exec_callback_QProgressBar_HideEvent(self *C.QProgressBar, cb C.intptr func (this *QProgressBar) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QProgressBar_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qprogressdialog.go b/qt/gen_qprogressdialog.go index 9c47cf2f..50a2e2a0 100644 --- a/qt/gen_qprogressdialog.go +++ b/qt/gen_qprogressdialog.go @@ -1317,7 +1317,11 @@ func miqt_exec_callback_QProgressDialog_HideEvent(self *C.QProgressDialog, cb C. func (this *QProgressDialog) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QProgressDialog_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qpropertyanimation.go b/qt/gen_qpropertyanimation.go index 10c394ea..69879486 100644 --- a/qt/gen_qpropertyanimation.go +++ b/qt/gen_qpropertyanimation.go @@ -59,7 +59,11 @@ func NewQPropertyAnimation() *QPropertyAnimation { // NewQPropertyAnimation2 constructs a new QPropertyAnimation object. func NewQPropertyAnimation2(target *QObject, propertyName []byte) *QPropertyAnimation { propertyName_alias := C.struct_miqt_string{} - propertyName_alias.data = (*C.char)(unsafe.Pointer(&propertyName[0])) + if len(propertyName) > 0 { + propertyName_alias.data = (*C.char)(unsafe.Pointer(&propertyName[0])) + } else { + propertyName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } propertyName_alias.len = C.size_t(len(propertyName)) return newQPropertyAnimation(C.QPropertyAnimation_new2(target.cPointer(), propertyName_alias)) @@ -74,7 +78,11 @@ func NewQPropertyAnimation3(parent *QObject) *QPropertyAnimation { // NewQPropertyAnimation4 constructs a new QPropertyAnimation object. func NewQPropertyAnimation4(target *QObject, propertyName []byte, parent *QObject) *QPropertyAnimation { propertyName_alias := C.struct_miqt_string{} - propertyName_alias.data = (*C.char)(unsafe.Pointer(&propertyName[0])) + if len(propertyName) > 0 { + propertyName_alias.data = (*C.char)(unsafe.Pointer(&propertyName[0])) + } else { + propertyName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } propertyName_alias.len = C.size_t(len(propertyName)) return newQPropertyAnimation(C.QPropertyAnimation_new4(target.cPointer(), propertyName_alias, parent.cPointer())) @@ -125,7 +133,11 @@ func (this *QPropertyAnimation) PropertyName() []byte { func (this *QPropertyAnimation) SetPropertyName(propertyName []byte) { propertyName_alias := C.struct_miqt_string{} - propertyName_alias.data = (*C.char)(unsafe.Pointer(&propertyName[0])) + if len(propertyName) > 0 { + propertyName_alias.data = (*C.char)(unsafe.Pointer(&propertyName[0])) + } else { + propertyName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } propertyName_alias.len = C.size_t(len(propertyName)) C.QPropertyAnimation_SetPropertyName(this.h, propertyName_alias) } diff --git a/qt/gen_qpushbutton.go b/qt/gen_qpushbutton.go index c5c07a92..26246da3 100644 --- a/qt/gen_qpushbutton.go +++ b/qt/gen_qpushbutton.go @@ -1185,7 +1185,11 @@ func miqt_exec_callback_QPushButton_HideEvent(self *C.QPushButton, cb C.intptr_t func (this *QPushButton) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QPushButton_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qradiobutton.go b/qt/gen_qradiobutton.go index 824d3a8c..053a833b 100644 --- a/qt/gen_qradiobutton.go +++ b/qt/gen_qradiobutton.go @@ -1129,7 +1129,11 @@ func miqt_exec_callback_QRadioButton_HideEvent(self *C.QRadioButton, cb C.intptr func (this *QRadioButton) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QRadioButton_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qrasterwindow.go b/qt/gen_qrasterwindow.go index 24c6b37b..65436b39 100644 --- a/qt/gen_qrasterwindow.go +++ b/qt/gen_qrasterwindow.go @@ -791,7 +791,11 @@ func miqt_exec_callback_QRasterWindow_TabletEvent(self *C.QRasterWindow, cb C.in func (this *QRasterWindow) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QRasterWindow_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qrawfont.go b/qt/gen_qrawfont.go index cf1385a5..5345c0c1 100644 --- a/qt/gen_qrawfont.go +++ b/qt/gen_qrawfont.go @@ -79,7 +79,11 @@ func NewQRawFont2(fileName string, pixelSize float64) *QRawFont { // NewQRawFont3 constructs a new QRawFont object. func NewQRawFont3(fontData []byte, pixelSize float64) *QRawFont { fontData_alias := C.struct_miqt_string{} - fontData_alias.data = (*C.char)(unsafe.Pointer(&fontData[0])) + if len(fontData) > 0 { + fontData_alias.data = (*C.char)(unsafe.Pointer(&fontData[0])) + } else { + fontData_alias.data = (*C.char)(unsafe.Pointer(nil)) + } fontData_alias.len = C.size_t(len(fontData)) return newQRawFont(C.QRawFont_new3(fontData_alias, (C.double)(pixelSize))) @@ -104,7 +108,11 @@ func NewQRawFont5(fileName string, pixelSize float64, hintingPreference QFont__H // NewQRawFont6 constructs a new QRawFont object. func NewQRawFont6(fontData []byte, pixelSize float64, hintingPreference QFont__HintingPreference) *QRawFont { fontData_alias := C.struct_miqt_string{} - fontData_alias.data = (*C.char)(unsafe.Pointer(&fontData[0])) + if len(fontData) > 0 { + fontData_alias.data = (*C.char)(unsafe.Pointer(&fontData[0])) + } else { + fontData_alias.data = (*C.char)(unsafe.Pointer(nil)) + } fontData_alias.len = C.size_t(len(fontData)) return newQRawFont(C.QRawFont_new6(fontData_alias, (C.double)(pixelSize), (C.int)(hintingPreference))) @@ -294,7 +302,11 @@ func (this *QRawFont) LoadFromFile(fileName string, pixelSize float64, hintingPr func (this *QRawFont) LoadFromData(fontData []byte, pixelSize float64, hintingPreference QFont__HintingPreference) { fontData_alias := C.struct_miqt_string{} - fontData_alias.data = (*C.char)(unsafe.Pointer(&fontData[0])) + if len(fontData) > 0 { + fontData_alias.data = (*C.char)(unsafe.Pointer(&fontData[0])) + } else { + fontData_alias.data = (*C.char)(unsafe.Pointer(nil)) + } fontData_alias.len = C.size_t(len(fontData)) C.QRawFont_LoadFromData(this.h, fontData_alias, (C.double)(pixelSize), (C.int)(hintingPreference)) } diff --git a/qt/gen_qrubberband.go b/qt/gen_qrubberband.go index bd42bd4d..109e7213 100644 --- a/qt/gen_qrubberband.go +++ b/qt/gen_qrubberband.go @@ -1032,7 +1032,11 @@ func miqt_exec_callback_QRubberBand_HideEvent(self *C.QRubberBand, cb C.intptr_t func (this *QRubberBand) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QRubberBand_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qscrollarea.go b/qt/gen_qscrollarea.go index 7659c839..bb3edee1 100644 --- a/qt/gen_qscrollarea.go +++ b/qt/gen_qscrollarea.go @@ -1226,7 +1226,11 @@ func miqt_exec_callback_QScrollArea_HideEvent(self *C.QScrollArea, cb C.intptr_t func (this *QScrollArea) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QScrollArea_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qscrollbar.go b/qt/gen_qscrollbar.go index aafc053d..4527ae71 100644 --- a/qt/gen_qscrollbar.go +++ b/qt/gen_qscrollbar.go @@ -1071,7 +1071,11 @@ func miqt_exec_callback_QScrollBar_ShowEvent(self *C.QScrollBar, cb C.intptr_t, func (this *QScrollBar) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QScrollBar_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qsignaltransition.go b/qt/gen_qsignaltransition.go index a150c9c8..84b4f534 100644 --- a/qt/gen_qsignaltransition.go +++ b/qt/gen_qsignaltransition.go @@ -123,7 +123,11 @@ func (this *QSignalTransition) Signal() []byte { func (this *QSignalTransition) SetSignal(signal []byte) { signal_alias := C.struct_miqt_string{} - signal_alias.data = (*C.char)(unsafe.Pointer(&signal[0])) + if len(signal) > 0 { + signal_alias.data = (*C.char)(unsafe.Pointer(&signal[0])) + } else { + signal_alias.data = (*C.char)(unsafe.Pointer(nil)) + } signal_alias.len = C.size_t(len(signal)) C.QSignalTransition_SetSignal(this.h, signal_alias) } diff --git a/qt/gen_qsizegrip.go b/qt/gen_qsizegrip.go index 38477741..49eeeb00 100644 --- a/qt/gen_qsizegrip.go +++ b/qt/gen_qsizegrip.go @@ -1005,7 +1005,11 @@ func miqt_exec_callback_QSizeGrip_DropEvent(self *C.QSizeGrip, cb C.intptr_t, ev func (this *QSizeGrip) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QSizeGrip_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qslider.go b/qt/gen_qslider.go index 48532371..76cfa7da 100644 --- a/qt/gen_qslider.go +++ b/qt/gen_qslider.go @@ -1104,7 +1104,11 @@ func miqt_exec_callback_QSlider_HideEvent(self *C.QSlider, cb C.intptr_t, event func (this *QSlider) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QSlider_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qsortfilterproxymodel.go b/qt/gen_qsortfilterproxymodel.go index 0b810270..5195ff6b 100644 --- a/qt/gen_qsortfilterproxymodel.go +++ b/qt/gen_qsortfilterproxymodel.go @@ -1952,7 +1952,11 @@ func miqt_exec_callback_QSortFilterProxyModel_RoleNames(self *C.QSortFilterProxy for virtualReturn_k, virtualReturn_v := range virtualReturn { virtualReturn_Keys_CArray[virtualReturn_ctr] = (C.int)(virtualReturn_k) virtualReturn_v_alias := C.struct_miqt_string{} - virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + if len(virtualReturn_v) > 0 { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + } else { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_v_alias.len = C.size_t(len(virtualReturn_v)) virtualReturn_Values_CArray[virtualReturn_ctr] = virtualReturn_v_alias virtualReturn_ctr++ diff --git a/qt/gen_qspinbox.go b/qt/gen_qspinbox.go index 63c21134..c84d8f0a 100644 --- a/qt/gen_qspinbox.go +++ b/qt/gen_qspinbox.go @@ -1428,7 +1428,11 @@ func miqt_exec_callback_QSpinBox_DropEvent(self *C.QSpinBox, cb C.intptr_t, even func (this *QSpinBox) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QSpinBox_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) @@ -3217,7 +3221,11 @@ func miqt_exec_callback_QDoubleSpinBox_DropEvent(self *C.QDoubleSpinBox, cb C.in func (this *QDoubleSpinBox) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QDoubleSpinBox_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qsplashscreen.go b/qt/gen_qsplashscreen.go index 8e059829..5ef16f26 100644 --- a/qt/gen_qsplashscreen.go +++ b/qt/gen_qsplashscreen.go @@ -1119,7 +1119,11 @@ func miqt_exec_callback_QSplashScreen_HideEvent(self *C.QSplashScreen, cb C.intp func (this *QSplashScreen) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QSplashScreen_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qsplitter.go b/qt/gen_qsplitter.go index 86da45ae..a92f9839 100644 --- a/qt/gen_qsplitter.go +++ b/qt/gen_qsplitter.go @@ -191,7 +191,11 @@ func (this *QSplitter) SaveState() []byte { func (this *QSplitter) RestoreState(state []byte) bool { state_alias := C.struct_miqt_string{} - state_alias.data = (*C.char)(unsafe.Pointer(&state[0])) + if len(state) > 0 { + state_alias.data = (*C.char)(unsafe.Pointer(&state[0])) + } else { + state_alias.data = (*C.char)(unsafe.Pointer(nil)) + } state_alias.len = C.size_t(len(state)) return (bool)(C.QSplitter_RestoreState(this.h, state_alias)) } @@ -1212,7 +1216,11 @@ func miqt_exec_callback_QSplitter_HideEvent(self *C.QSplitter, cb C.intptr_t, ev func (this *QSplitter) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QSplitter_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) @@ -2559,7 +2567,11 @@ func miqt_exec_callback_QSplitterHandle_HideEvent(self *C.QSplitterHandle, cb C. func (this *QSplitterHandle) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QSplitterHandle_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qstackedwidget.go b/qt/gen_qstackedwidget.go index e2cbc7fb..4f6635ea 100644 --- a/qt/gen_qstackedwidget.go +++ b/qt/gen_qstackedwidget.go @@ -1077,7 +1077,11 @@ func miqt_exec_callback_QStackedWidget_HideEvent(self *C.QStackedWidget, cb C.in func (this *QStackedWidget) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QStackedWidget_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qstandarditemmodel.go b/qt/gen_qstandarditemmodel.go index 6e80de31..628ef637 100644 --- a/qt/gen_qstandarditemmodel.go +++ b/qt/gen_qstandarditemmodel.go @@ -846,7 +846,11 @@ func (this *QStandardItemModel) SetItemRoleNames(roleNames map[int][]byte) { for roleNames_k, roleNames_v := range roleNames { roleNames_Keys_CArray[roleNames_ctr] = (C.int)(roleNames_k) roleNames_v_alias := C.struct_miqt_string{} - roleNames_v_alias.data = (*C.char)(unsafe.Pointer(&roleNames_v[0])) + if len(roleNames_v) > 0 { + roleNames_v_alias.data = (*C.char)(unsafe.Pointer(&roleNames_v[0])) + } else { + roleNames_v_alias.data = (*C.char)(unsafe.Pointer(nil)) + } roleNames_v_alias.len = C.size_t(len(roleNames_v)) roleNames_Values_CArray[roleNames_ctr] = roleNames_v_alias roleNames_ctr++ @@ -2409,7 +2413,11 @@ func miqt_exec_callback_QStandardItemModel_RoleNames(self *C.QStandardItemModel, for virtualReturn_k, virtualReturn_v := range virtualReturn { virtualReturn_Keys_CArray[virtualReturn_ctr] = (C.int)(virtualReturn_k) virtualReturn_v_alias := C.struct_miqt_string{} - virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + if len(virtualReturn_v) > 0 { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + } else { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_v_alias.len = C.size_t(len(virtualReturn_v)) virtualReturn_Values_CArray[virtualReturn_ctr] = virtualReturn_v_alias virtualReturn_ctr++ diff --git a/qt/gen_qstatusbar.go b/qt/gen_qstatusbar.go index 6fa13dc0..bc6f9a82 100644 --- a/qt/gen_qstatusbar.go +++ b/qt/gen_qstatusbar.go @@ -1069,7 +1069,11 @@ func miqt_exec_callback_QStatusBar_HideEvent(self *C.QStatusBar, cb C.intptr_t, func (this *QStatusBar) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QStatusBar_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qstringlistmodel.go b/qt/gen_qstringlistmodel.go index 6c168466..5eb922f4 100644 --- a/qt/gen_qstringlistmodel.go +++ b/qt/gen_qstringlistmodel.go @@ -1284,7 +1284,11 @@ func miqt_exec_callback_QStringListModel_RoleNames(self *C.QStringListModel, cb for virtualReturn_k, virtualReturn_v := range virtualReturn { virtualReturn_Keys_CArray[virtualReturn_ctr] = (C.int)(virtualReturn_k) virtualReturn_v_alias := C.struct_miqt_string{} - virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + if len(virtualReturn_v) > 0 { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + } else { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_v_alias.len = C.size_t(len(virtualReturn_v)) virtualReturn_Values_CArray[virtualReturn_ctr] = virtualReturn_v_alias virtualReturn_ctr++ diff --git a/qt/gen_qtabbar.go b/qt/gen_qtabbar.go index f9e30c71..2f46a485 100644 --- a/qt/gen_qtabbar.go +++ b/qt/gen_qtabbar.go @@ -1574,7 +1574,11 @@ func miqt_exec_callback_QTabBar_DropEvent(self *C.QTabBar, cb C.intptr_t, event func (this *QTabBar) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QTabBar_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qtableview.go b/qt/gen_qtableview.go index 847e9d45..e47d3b83 100644 --- a/qt/gen_qtableview.go +++ b/qt/gen_qtableview.go @@ -2503,7 +2503,11 @@ func miqt_exec_callback_QTableView_HideEvent(self *C.QTableView, cb C.intptr_t, func (this *QTableView) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QTableView_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qtablewidget.go b/qt/gen_qtablewidget.go index 200f618d..8bfa38ec 100644 --- a/qt/gen_qtablewidget.go +++ b/qt/gen_qtablewidget.go @@ -3593,7 +3593,11 @@ func miqt_exec_callback_QTableWidget_HideEvent(self *C.QTableWidget, cb C.intptr func (this *QTableWidget) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QTableWidget_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qtabwidget.go b/qt/gen_qtabwidget.go index 93f53287..188937dd 100644 --- a/qt/gen_qtabwidget.go +++ b/qt/gen_qtabwidget.go @@ -1398,7 +1398,11 @@ func miqt_exec_callback_QTabWidget_HideEvent(self *C.QTabWidget, cb C.intptr_t, func (this *QTabWidget) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QTabWidget_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qtextbrowser.go b/qt/gen_qtextbrowser.go index 1be91304..3e6cb264 100644 --- a/qt/gen_qtextbrowser.go +++ b/qt/gen_qtextbrowser.go @@ -1761,7 +1761,11 @@ func miqt_exec_callback_QTextBrowser_HideEvent(self *C.QTextBrowser, cb C.intptr func (this *QTextBrowser) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QTextBrowser_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qtextcodec.go b/qt/gen_qtextcodec.go index 1ebb1143..389d0d85 100644 --- a/qt/gen_qtextcodec.go +++ b/qt/gen_qtextcodec.go @@ -55,7 +55,11 @@ func UnsafeNewQTextCodec(h unsafe.Pointer) *QTextCodec { func QTextCodec_CodecForName(name []byte) *QTextCodec { name_alias := C.struct_miqt_string{} - name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + if len(name) > 0 { + name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + } else { + name_alias.data = (*C.char)(unsafe.Pointer(nil)) + } name_alias.len = C.size_t(len(name)) return newQTextCodec(C.QTextCodec_CodecForName(name_alias)) } @@ -103,28 +107,44 @@ func QTextCodec_SetCodecForLocale(c *QTextCodec) { func QTextCodec_CodecForHtml(ba []byte) *QTextCodec { ba_alias := C.struct_miqt_string{} - ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + if len(ba) > 0 { + ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + } else { + ba_alias.data = (*C.char)(unsafe.Pointer(nil)) + } ba_alias.len = C.size_t(len(ba)) return newQTextCodec(C.QTextCodec_CodecForHtml(ba_alias)) } func QTextCodec_CodecForHtml2(ba []byte, defaultCodec *QTextCodec) *QTextCodec { ba_alias := C.struct_miqt_string{} - ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + if len(ba) > 0 { + ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + } else { + ba_alias.data = (*C.char)(unsafe.Pointer(nil)) + } ba_alias.len = C.size_t(len(ba)) return newQTextCodec(C.QTextCodec_CodecForHtml2(ba_alias, defaultCodec.cPointer())) } func QTextCodec_CodecForUtfText(ba []byte) *QTextCodec { ba_alias := C.struct_miqt_string{} - ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + if len(ba) > 0 { + ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + } else { + ba_alias.data = (*C.char)(unsafe.Pointer(nil)) + } ba_alias.len = C.size_t(len(ba)) return newQTextCodec(C.QTextCodec_CodecForUtfText(ba_alias)) } func QTextCodec_CodecForUtfText2(ba []byte, defaultCodec *QTextCodec) *QTextCodec { ba_alias := C.struct_miqt_string{} - ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + if len(ba) > 0 { + ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + } else { + ba_alias.data = (*C.char)(unsafe.Pointer(nil)) + } ba_alias.len = C.size_t(len(ba)) return newQTextCodec(C.QTextCodec_CodecForUtfText2(ba_alias, defaultCodec.cPointer())) } @@ -143,7 +163,11 @@ func (this *QTextCodec) CanEncodeWithQString(param1 string) bool { func (this *QTextCodec) ToUnicode(param1 []byte) string { param1_alias := C.struct_miqt_string{} - param1_alias.data = (*C.char)(unsafe.Pointer(¶m1[0])) + if len(param1) > 0 { + param1_alias.data = (*C.char)(unsafe.Pointer(¶m1[0])) + } else { + param1_alias.data = (*C.char)(unsafe.Pointer(nil)) + } param1_alias.len = C.size_t(len(param1)) var _ms C.struct_miqt_string = C.QTextCodec_ToUnicode(this.h, param1_alias) _ret := C.GoStringN(_ms.data, C.int(int64(_ms.len))) @@ -378,7 +402,11 @@ func (this *QTextDecoder) ToUnicode(chars string, lenVal int) string { func (this *QTextDecoder) ToUnicodeWithBa(ba []byte) string { ba_alias := C.struct_miqt_string{} - ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + if len(ba) > 0 { + ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + } else { + ba_alias.data = (*C.char)(unsafe.Pointer(nil)) + } ba_alias.len = C.size_t(len(ba)) var _ms C.struct_miqt_string = C.QTextDecoder_ToUnicodeWithBa(this.h, ba_alias) _ret := C.GoStringN(_ms.data, C.int(int64(_ms.len))) diff --git a/qt/gen_qtextdocument.go b/qt/gen_qtextdocument.go index 972eff9d..29e26830 100644 --- a/qt/gen_qtextdocument.go +++ b/qt/gen_qtextdocument.go @@ -877,7 +877,11 @@ func (this *QTextDocument) Clone1(parent *QObject) *QTextDocument { func (this *QTextDocument) ToHtml1(encoding []byte) string { encoding_alias := C.struct_miqt_string{} - encoding_alias.data = (*C.char)(unsafe.Pointer(&encoding[0])) + if len(encoding) > 0 { + encoding_alias.data = (*C.char)(unsafe.Pointer(&encoding[0])) + } else { + encoding_alias.data = (*C.char)(unsafe.Pointer(nil)) + } encoding_alias.len = C.size_t(len(encoding)) var _ms C.struct_miqt_string = C.QTextDocument_ToHtml1(this.h, encoding_alias) _ret := C.GoStringN(_ms.data, C.int(int64(_ms.len))) diff --git a/qt/gen_qtextdocumentfragment.go b/qt/gen_qtextdocumentfragment.go index 5ffc4469..09026896 100644 --- a/qt/gen_qtextdocumentfragment.go +++ b/qt/gen_qtextdocumentfragment.go @@ -123,7 +123,11 @@ func QTextDocumentFragment_FromHtml2(html string, resourceProvider *QTextDocumen func (this *QTextDocumentFragment) ToHtml1(encoding []byte) string { encoding_alias := C.struct_miqt_string{} - encoding_alias.data = (*C.char)(unsafe.Pointer(&encoding[0])) + if len(encoding) > 0 { + encoding_alias.data = (*C.char)(unsafe.Pointer(&encoding[0])) + } else { + encoding_alias.data = (*C.char)(unsafe.Pointer(nil)) + } encoding_alias.len = C.size_t(len(encoding)) var _ms C.struct_miqt_string = C.QTextDocumentFragment_ToHtml1(this.h, encoding_alias) _ret := C.GoStringN(_ms.data, C.int(int64(_ms.len))) diff --git a/qt/gen_qtextdocumentwriter.go b/qt/gen_qtextdocumentwriter.go index 4231f47a..1b34b655 100644 --- a/qt/gen_qtextdocumentwriter.go +++ b/qt/gen_qtextdocumentwriter.go @@ -54,7 +54,11 @@ func NewQTextDocumentWriter() *QTextDocumentWriter { // NewQTextDocumentWriter2 constructs a new QTextDocumentWriter object. func NewQTextDocumentWriter2(device *QIODevice, format []byte) *QTextDocumentWriter { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) return newQTextDocumentWriter(C.QTextDocumentWriter_new2(device.cPointer(), format_alias)) @@ -77,7 +81,11 @@ func NewQTextDocumentWriter4(fileName string, format []byte) *QTextDocumentWrite fileName_ms.len = C.size_t(len(fileName)) defer C.free(unsafe.Pointer(fileName_ms.data)) format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) return newQTextDocumentWriter(C.QTextDocumentWriter_new4(fileName_ms, format_alias)) @@ -85,7 +93,11 @@ func NewQTextDocumentWriter4(fileName string, format []byte) *QTextDocumentWrite func (this *QTextDocumentWriter) SetFormat(format []byte) { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) C.QTextDocumentWriter_SetFormat(this.h, format_alias) } diff --git a/qt/gen_qtextedit.go b/qt/gen_qtextedit.go index 9af31104..9219b239 100644 --- a/qt/gen_qtextedit.go +++ b/qt/gen_qtextedit.go @@ -2062,7 +2062,11 @@ func miqt_exec_callback_QTextEdit_HideEvent(self *C.QTextEdit, cb C.intptr_t, ev func (this *QTextEdit) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QTextEdit_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qtextstream.go b/qt/gen_qtextstream.go index 072bf10a..4db3c4a3 100644 --- a/qt/gen_qtextstream.go +++ b/qt/gen_qtextstream.go @@ -96,7 +96,11 @@ func NewQTextStream2(device *QIODevice) *QTextStream { // NewQTextStream3 constructs a new QTextStream object. func NewQTextStream3(array []byte) *QTextStream { array_alias := C.struct_miqt_string{} - array_alias.data = (*C.char)(unsafe.Pointer(&array[0])) + if len(array) > 0 { + array_alias.data = (*C.char)(unsafe.Pointer(&array[0])) + } else { + array_alias.data = (*C.char)(unsafe.Pointer(nil)) + } array_alias.len = C.size_t(len(array)) return newQTextStream(C.QTextStream_new3(array_alias)) @@ -105,7 +109,11 @@ func NewQTextStream3(array []byte) *QTextStream { // NewQTextStream4 constructs a new QTextStream object. func NewQTextStream4(array []byte, openMode QIODevice__OpenModeFlag) *QTextStream { array_alias := C.struct_miqt_string{} - array_alias.data = (*C.char)(unsafe.Pointer(&array[0])) + if len(array) > 0 { + array_alias.data = (*C.char)(unsafe.Pointer(&array[0])) + } else { + array_alias.data = (*C.char)(unsafe.Pointer(nil)) + } array_alias.len = C.size_t(len(array)) return newQTextStream(C.QTextStream_new4(array_alias, (C.int)(openMode))) @@ -339,7 +347,11 @@ func (this *QTextStream) OperatorShiftRightWithQString(s string) *QTextStream { func (this *QTextStream) OperatorShiftRightWithArray(array []byte) *QTextStream { array_alias := C.struct_miqt_string{} - array_alias.data = (*C.char)(unsafe.Pointer(&array[0])) + if len(array) > 0 { + array_alias.data = (*C.char)(unsafe.Pointer(&array[0])) + } else { + array_alias.data = (*C.char)(unsafe.Pointer(nil)) + } array_alias.len = C.size_t(len(array)) return newQTextStream(C.QTextStream_OperatorShiftRightWithArray(this.h, array_alias)) } @@ -408,7 +420,11 @@ func (this *QTextStream) OperatorShiftLeftWithQString(s string) *QTextStream { func (this *QTextStream) OperatorShiftLeftWithArray(array []byte) *QTextStream { array_alias := C.struct_miqt_string{} - array_alias.data = (*C.char)(unsafe.Pointer(&array[0])) + if len(array) > 0 { + array_alias.data = (*C.char)(unsafe.Pointer(&array[0])) + } else { + array_alias.data = (*C.char)(unsafe.Pointer(nil)) + } array_alias.len = C.size_t(len(array)) return newQTextStream(C.QTextStream_OperatorShiftLeftWithArray(this.h, array_alias)) } diff --git a/qt/gen_qtimezone.go b/qt/gen_qtimezone.go index 3b718469..4b87cae4 100644 --- a/qt/gen_qtimezone.go +++ b/qt/gen_qtimezone.go @@ -78,7 +78,11 @@ func NewQTimeZone() *QTimeZone { // NewQTimeZone2 constructs a new QTimeZone object. func NewQTimeZone2(ianaId []byte) *QTimeZone { ianaId_alias := C.struct_miqt_string{} - ianaId_alias.data = (*C.char)(unsafe.Pointer(&ianaId[0])) + if len(ianaId) > 0 { + ianaId_alias.data = (*C.char)(unsafe.Pointer(&ianaId[0])) + } else { + ianaId_alias.data = (*C.char)(unsafe.Pointer(nil)) + } ianaId_alias.len = C.size_t(len(ianaId)) return newQTimeZone(C.QTimeZone_new2(ianaId_alias)) @@ -93,7 +97,11 @@ func NewQTimeZone3(offsetSeconds int) *QTimeZone { // NewQTimeZone4 constructs a new QTimeZone object. func NewQTimeZone4(zoneId []byte, offsetSeconds int, name string, abbreviation string) *QTimeZone { zoneId_alias := C.struct_miqt_string{} - zoneId_alias.data = (*C.char)(unsafe.Pointer(&zoneId[0])) + if len(zoneId) > 0 { + zoneId_alias.data = (*C.char)(unsafe.Pointer(&zoneId[0])) + } else { + zoneId_alias.data = (*C.char)(unsafe.Pointer(nil)) + } zoneId_alias.len = C.size_t(len(zoneId)) name_ms := C.struct_miqt_string{} name_ms.data = C.CString(name) @@ -116,7 +124,11 @@ func NewQTimeZone5(other *QTimeZone) *QTimeZone { // NewQTimeZone6 constructs a new QTimeZone object. func NewQTimeZone6(zoneId []byte, offsetSeconds int, name string, abbreviation string, country QLocale__Country) *QTimeZone { zoneId_alias := C.struct_miqt_string{} - zoneId_alias.data = (*C.char)(unsafe.Pointer(&zoneId[0])) + if len(zoneId) > 0 { + zoneId_alias.data = (*C.char)(unsafe.Pointer(&zoneId[0])) + } else { + zoneId_alias.data = (*C.char)(unsafe.Pointer(nil)) + } zoneId_alias.len = C.size_t(len(zoneId)) name_ms := C.struct_miqt_string{} name_ms.data = C.CString(name) @@ -133,7 +145,11 @@ func NewQTimeZone6(zoneId []byte, offsetSeconds int, name string, abbreviation s // NewQTimeZone7 constructs a new QTimeZone object. func NewQTimeZone7(zoneId []byte, offsetSeconds int, name string, abbreviation string, country QLocale__Country, comment string) *QTimeZone { zoneId_alias := C.struct_miqt_string{} - zoneId_alias.data = (*C.char)(unsafe.Pointer(&zoneId[0])) + if len(zoneId) > 0 { + zoneId_alias.data = (*C.char)(unsafe.Pointer(&zoneId[0])) + } else { + zoneId_alias.data = (*C.char)(unsafe.Pointer(nil)) + } zoneId_alias.len = C.size_t(len(zoneId)) name_ms := C.struct_miqt_string{} name_ms.data = C.CString(name) @@ -277,7 +293,11 @@ func QTimeZone_Utc() *QTimeZone { func QTimeZone_IsTimeZoneIdAvailable(ianaId []byte) bool { ianaId_alias := C.struct_miqt_string{} - ianaId_alias.data = (*C.char)(unsafe.Pointer(&ianaId[0])) + if len(ianaId) > 0 { + ianaId_alias.data = (*C.char)(unsafe.Pointer(&ianaId[0])) + } else { + ianaId_alias.data = (*C.char)(unsafe.Pointer(nil)) + } ianaId_alias.len = C.size_t(len(ianaId)) return (bool)(C.QTimeZone_IsTimeZoneIdAvailable(ianaId_alias)) } @@ -323,7 +343,11 @@ func QTimeZone_AvailableTimeZoneIdsWithOffsetSeconds(offsetSeconds int) [][]byte func QTimeZone_IanaIdToWindowsId(ianaId []byte) []byte { ianaId_alias := C.struct_miqt_string{} - ianaId_alias.data = (*C.char)(unsafe.Pointer(&ianaId[0])) + if len(ianaId) > 0 { + ianaId_alias.data = (*C.char)(unsafe.Pointer(&ianaId[0])) + } else { + ianaId_alias.data = (*C.char)(unsafe.Pointer(nil)) + } ianaId_alias.len = C.size_t(len(ianaId)) var _bytearray C.struct_miqt_string = C.QTimeZone_IanaIdToWindowsId(ianaId_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) @@ -333,7 +357,11 @@ func QTimeZone_IanaIdToWindowsId(ianaId []byte) []byte { func QTimeZone_WindowsIdToDefaultIanaId(windowsId []byte) []byte { windowsId_alias := C.struct_miqt_string{} - windowsId_alias.data = (*C.char)(unsafe.Pointer(&windowsId[0])) + if len(windowsId) > 0 { + windowsId_alias.data = (*C.char)(unsafe.Pointer(&windowsId[0])) + } else { + windowsId_alias.data = (*C.char)(unsafe.Pointer(nil)) + } windowsId_alias.len = C.size_t(len(windowsId)) var _bytearray C.struct_miqt_string = C.QTimeZone_WindowsIdToDefaultIanaId(windowsId_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) @@ -343,7 +371,11 @@ func QTimeZone_WindowsIdToDefaultIanaId(windowsId []byte) []byte { func QTimeZone_WindowsIdToDefaultIanaId2(windowsId []byte, country QLocale__Country) []byte { windowsId_alias := C.struct_miqt_string{} - windowsId_alias.data = (*C.char)(unsafe.Pointer(&windowsId[0])) + if len(windowsId) > 0 { + windowsId_alias.data = (*C.char)(unsafe.Pointer(&windowsId[0])) + } else { + windowsId_alias.data = (*C.char)(unsafe.Pointer(nil)) + } windowsId_alias.len = C.size_t(len(windowsId)) var _bytearray C.struct_miqt_string = C.QTimeZone_WindowsIdToDefaultIanaId2(windowsId_alias, (C.int)(country)) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) @@ -353,7 +385,11 @@ func QTimeZone_WindowsIdToDefaultIanaId2(windowsId []byte, country QLocale__Coun func QTimeZone_WindowsIdToIanaIds(windowsId []byte) [][]byte { windowsId_alias := C.struct_miqt_string{} - windowsId_alias.data = (*C.char)(unsafe.Pointer(&windowsId[0])) + if len(windowsId) > 0 { + windowsId_alias.data = (*C.char)(unsafe.Pointer(&windowsId[0])) + } else { + windowsId_alias.data = (*C.char)(unsafe.Pointer(nil)) + } windowsId_alias.len = C.size_t(len(windowsId)) var _ma C.struct_miqt_array = C.QTimeZone_WindowsIdToIanaIds(windowsId_alias) _ret := make([][]byte, int(_ma.len)) @@ -369,7 +405,11 @@ func QTimeZone_WindowsIdToIanaIds(windowsId []byte) [][]byte { func QTimeZone_WindowsIdToIanaIds2(windowsId []byte, country QLocale__Country) [][]byte { windowsId_alias := C.struct_miqt_string{} - windowsId_alias.data = (*C.char)(unsafe.Pointer(&windowsId[0])) + if len(windowsId) > 0 { + windowsId_alias.data = (*C.char)(unsafe.Pointer(&windowsId[0])) + } else { + windowsId_alias.data = (*C.char)(unsafe.Pointer(nil)) + } windowsId_alias.len = C.size_t(len(windowsId)) var _ma C.struct_miqt_array = C.QTimeZone_WindowsIdToIanaIds2(windowsId_alias, (C.int)(country)) _ret := make([][]byte, int(_ma.len)) diff --git a/qt/gen_qtoolbar.go b/qt/gen_qtoolbar.go index 28298356..4f39abe8 100644 --- a/qt/gen_qtoolbar.go +++ b/qt/gen_qtoolbar.go @@ -1293,7 +1293,11 @@ func miqt_exec_callback_QToolBar_HideEvent(self *C.QToolBar, cb C.intptr_t, even func (this *QToolBar) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QToolBar_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qtoolbox.go b/qt/gen_qtoolbox.go index 443239f3..419d8018 100644 --- a/qt/gen_qtoolbox.go +++ b/qt/gen_qtoolbox.go @@ -1187,7 +1187,11 @@ func miqt_exec_callback_QToolBox_HideEvent(self *C.QToolBox, cb C.intptr_t, even func (this *QToolBox) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QToolBox_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qtoolbutton.go b/qt/gen_qtoolbutton.go index d3b83c16..4a49fcf2 100644 --- a/qt/gen_qtoolbutton.go +++ b/qt/gen_qtoolbutton.go @@ -1189,7 +1189,11 @@ func miqt_exec_callback_QToolButton_HideEvent(self *C.QToolButton, cb C.intptr_t func (this *QToolButton) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QToolButton_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qtransposeproxymodel.go b/qt/gen_qtransposeproxymodel.go index b6267f39..44ca480b 100644 --- a/qt/gen_qtransposeproxymodel.go +++ b/qt/gen_qtransposeproxymodel.go @@ -1541,7 +1541,11 @@ func miqt_exec_callback_QTransposeProxyModel_RoleNames(self *C.QTransposeProxyMo for virtualReturn_k, virtualReturn_v := range virtualReturn { virtualReturn_Keys_CArray[virtualReturn_ctr] = (C.int)(virtualReturn_k) virtualReturn_v_alias := C.struct_miqt_string{} - virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + if len(virtualReturn_v) > 0 { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + } else { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_v_alias.len = C.size_t(len(virtualReturn_v)) virtualReturn_Values_CArray[virtualReturn_ctr] = virtualReturn_v_alias virtualReturn_ctr++ diff --git a/qt/gen_qtreeview.go b/qt/gen_qtreeview.go index 6a7ff424..273ae25a 100644 --- a/qt/gen_qtreeview.go +++ b/qt/gen_qtreeview.go @@ -2677,7 +2677,11 @@ func miqt_exec_callback_QTreeView_HideEvent(self *C.QTreeView, cb C.intptr_t, ev func (this *QTreeView) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QTreeView_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qtreewidget.go b/qt/gen_qtreewidget.go index be6c6190..41b0a25d 100644 --- a/qt/gen_qtreewidget.go +++ b/qt/gen_qtreewidget.go @@ -3665,7 +3665,11 @@ func miqt_exec_callback_QTreeWidget_HideEvent(self *C.QTreeWidget, cb C.intptr_t func (this *QTreeWidget) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QTreeWidget_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qundoview.go b/qt/gen_qundoview.go index 317c02d2..5be82867 100644 --- a/qt/gen_qundoview.go +++ b/qt/gen_qundoview.go @@ -2368,7 +2368,11 @@ func miqt_exec_callback_QUndoView_HideEvent(self *C.QUndoView, cb C.intptr_t, ev func (this *QUndoView) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QUndoView_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qurl.go b/qt/gen_qurl.go index 47728cef..775cebc9 100644 --- a/qt/gen_qurl.go +++ b/qt/gen_qurl.go @@ -177,7 +177,11 @@ func (this *QUrl) ToEncoded() []byte { func QUrl_FromEncoded(url []byte) *QUrl { url_alias := C.struct_miqt_string{} - url_alias.data = (*C.char)(unsafe.Pointer(&url[0])) + if len(url) > 0 { + url_alias.data = (*C.char)(unsafe.Pointer(&url[0])) + } else { + url_alias.data = (*C.char)(unsafe.Pointer(nil)) + } url_alias.len = C.size_t(len(url)) _goptr := newQUrl(C.QUrl_FromEncoded(url_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer @@ -453,7 +457,11 @@ func (this *QUrl) OperatorNotEqual(url *QUrl) bool { func QUrl_FromPercentEncoding(param1 []byte) string { param1_alias := C.struct_miqt_string{} - param1_alias.data = (*C.char)(unsafe.Pointer(¶m1[0])) + if len(param1) > 0 { + param1_alias.data = (*C.char)(unsafe.Pointer(¶m1[0])) + } else { + param1_alias.data = (*C.char)(unsafe.Pointer(nil)) + } param1_alias.len = C.size_t(len(param1)) var _ms C.struct_miqt_string = C.QUrl_FromPercentEncoding(param1_alias) _ret := C.GoStringN(_ms.data, C.int(int64(_ms.len))) @@ -474,7 +482,11 @@ func QUrl_ToPercentEncoding(param1 string) []byte { func QUrl_FromAce(param1 []byte) string { param1_alias := C.struct_miqt_string{} - param1_alias.data = (*C.char)(unsafe.Pointer(¶m1[0])) + if len(param1) > 0 { + param1_alias.data = (*C.char)(unsafe.Pointer(¶m1[0])) + } else { + param1_alias.data = (*C.char)(unsafe.Pointer(nil)) + } param1_alias.len = C.size_t(len(param1)) var _ms C.struct_miqt_string = C.QUrl_FromAce(param1_alias) _ret := C.GoStringN(_ms.data, C.int(int64(_ms.len))) @@ -571,7 +583,11 @@ func (this *QUrl) SetUrl2(url string, mode QUrl__ParsingMode) { func QUrl_FromEncoded2(url []byte, mode QUrl__ParsingMode) *QUrl { url_alias := C.struct_miqt_string{} - url_alias.data = (*C.char)(unsafe.Pointer(&url[0])) + if len(url) > 0 { + url_alias.data = (*C.char)(unsafe.Pointer(&url[0])) + } else { + url_alias.data = (*C.char)(unsafe.Pointer(nil)) + } url_alias.len = C.size_t(len(url)) _goptr := newQUrl(C.QUrl_FromEncoded2(url_alias, (C.int)(mode))) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer @@ -736,7 +752,11 @@ func QUrl_ToPercentEncoding2(param1 string, exclude []byte) []byte { param1_ms.len = C.size_t(len(param1)) defer C.free(unsafe.Pointer(param1_ms.data)) exclude_alias := C.struct_miqt_string{} - exclude_alias.data = (*C.char)(unsafe.Pointer(&exclude[0])) + if len(exclude) > 0 { + exclude_alias.data = (*C.char)(unsafe.Pointer(&exclude[0])) + } else { + exclude_alias.data = (*C.char)(unsafe.Pointer(nil)) + } exclude_alias.len = C.size_t(len(exclude)) var _bytearray C.struct_miqt_string = C.QUrl_ToPercentEncoding2(param1_ms, exclude_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) @@ -750,10 +770,18 @@ func QUrl_ToPercentEncoding3(param1 string, exclude []byte, include []byte) []by param1_ms.len = C.size_t(len(param1)) defer C.free(unsafe.Pointer(param1_ms.data)) exclude_alias := C.struct_miqt_string{} - exclude_alias.data = (*C.char)(unsafe.Pointer(&exclude[0])) + if len(exclude) > 0 { + exclude_alias.data = (*C.char)(unsafe.Pointer(&exclude[0])) + } else { + exclude_alias.data = (*C.char)(unsafe.Pointer(nil)) + } exclude_alias.len = C.size_t(len(exclude)) include_alias := C.struct_miqt_string{} - include_alias.data = (*C.char)(unsafe.Pointer(&include[0])) + if len(include) > 0 { + include_alias.data = (*C.char)(unsafe.Pointer(&include[0])) + } else { + include_alias.data = (*C.char)(unsafe.Pointer(nil)) + } include_alias.len = C.size_t(len(include)) var _bytearray C.struct_miqt_string = C.QUrl_ToPercentEncoding3(param1_ms, exclude_alias, include_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) diff --git a/qt/gen_quuid.go b/qt/gen_quuid.go index 9665a80d..e646bbf9 100644 --- a/qt/gen_quuid.go +++ b/qt/gen_quuid.go @@ -108,7 +108,11 @@ func NewQUuid4(param1 string) *QUuid { // NewQUuid5 constructs a new QUuid object. func NewQUuid5(param1 []byte) *QUuid { param1_alias := C.struct_miqt_string{} - param1_alias.data = (*C.char)(unsafe.Pointer(¶m1[0])) + if len(param1) > 0 { + param1_alias.data = (*C.char)(unsafe.Pointer(¶m1[0])) + } else { + param1_alias.data = (*C.char)(unsafe.Pointer(nil)) + } param1_alias.len = C.size_t(len(param1)) return newQUuid(C.QUuid_new5(param1_alias)) @@ -157,7 +161,11 @@ func (this *QUuid) ToRfc4122() []byte { func QUuid_FromRfc4122(param1 []byte) *QUuid { param1_alias := C.struct_miqt_string{} - param1_alias.data = (*C.char)(unsafe.Pointer(¶m1[0])) + if len(param1) > 0 { + param1_alias.data = (*C.char)(unsafe.Pointer(¶m1[0])) + } else { + param1_alias.data = (*C.char)(unsafe.Pointer(nil)) + } param1_alias.len = C.size_t(len(param1)) _goptr := newQUuid(C.QUuid_FromRfc4122(param1_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer @@ -192,7 +200,11 @@ func QUuid_CreateUuid() *QUuid { func QUuid_CreateUuidV3(ns *QUuid, baseData []byte) *QUuid { baseData_alias := C.struct_miqt_string{} - baseData_alias.data = (*C.char)(unsafe.Pointer(&baseData[0])) + if len(baseData) > 0 { + baseData_alias.data = (*C.char)(unsafe.Pointer(&baseData[0])) + } else { + baseData_alias.data = (*C.char)(unsafe.Pointer(nil)) + } baseData_alias.len = C.size_t(len(baseData)) _goptr := newQUuid(C.QUuid_CreateUuidV3(ns.cPointer(), baseData_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer @@ -201,7 +213,11 @@ func QUuid_CreateUuidV3(ns *QUuid, baseData []byte) *QUuid { func QUuid_CreateUuidV5(ns *QUuid, baseData []byte) *QUuid { baseData_alias := C.struct_miqt_string{} - baseData_alias.data = (*C.char)(unsafe.Pointer(&baseData[0])) + if len(baseData) > 0 { + baseData_alias.data = (*C.char)(unsafe.Pointer(&baseData[0])) + } else { + baseData_alias.data = (*C.char)(unsafe.Pointer(nil)) + } baseData_alias.len = C.size_t(len(baseData)) _goptr := newQUuid(C.QUuid_CreateUuidV5(ns.cPointer(), baseData_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer diff --git a/qt/gen_qvariant.go b/qt/gen_qvariant.go index 84c72354..2e9a42ef 100644 --- a/qt/gen_qvariant.go +++ b/qt/gen_qvariant.go @@ -200,7 +200,11 @@ func NewQVariant14(str string) *QVariant { // NewQVariant15 constructs a new QVariant object. func NewQVariant15(bytearray []byte) *QVariant { bytearray_alias := C.struct_miqt_string{} - bytearray_alias.data = (*C.char)(unsafe.Pointer(&bytearray[0])) + if len(bytearray) > 0 { + bytearray_alias.data = (*C.char)(unsafe.Pointer(&bytearray[0])) + } else { + bytearray_alias.data = (*C.char)(unsafe.Pointer(nil)) + } bytearray_alias.len = C.size_t(len(bytearray)) return newQVariant(C.QVariant_new15(bytearray_alias)) diff --git a/qt/gen_qwidget.go b/qt/gen_qwidget.go index b80d8153..2a2bf415 100644 --- a/qt/gen_qwidget.go +++ b/qt/gen_qwidget.go @@ -1016,7 +1016,11 @@ func (this *QWidget) SaveGeometry() []byte { func (this *QWidget) RestoreGeometry(geometry []byte) bool { geometry_alias := C.struct_miqt_string{} - geometry_alias.data = (*C.char)(unsafe.Pointer(&geometry[0])) + if len(geometry) > 0 { + geometry_alias.data = (*C.char)(unsafe.Pointer(&geometry[0])) + } else { + geometry_alias.data = (*C.char)(unsafe.Pointer(nil)) + } geometry_alias.len = C.size_t(len(geometry)) return (bool)(C.QWidget_RestoreGeometry(this.h, geometry_alias)) } @@ -2346,7 +2350,11 @@ func miqt_exec_callback_QWidget_HideEvent(self *C.QWidget, cb C.intptr_t, event func (this *QWidget) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QWidget_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qwindow.go b/qt/gen_qwindow.go index 01da49b1..7c496833 100644 --- a/qt/gen_qwindow.go +++ b/qt/gen_qwindow.go @@ -1608,7 +1608,11 @@ func miqt_exec_callback_QWindow_TabletEvent(self *C.QWindow, cb C.intptr_t, para func (this *QWindow) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QWindow_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qwizard.go b/qt/gen_qwizard.go index e8e3c7f3..3263631d 100644 --- a/qt/gen_qwizard.go +++ b/qt/gen_qwizard.go @@ -1605,7 +1605,11 @@ func miqt_exec_callback_QWizard_HideEvent(self *C.QWizard, cb C.intptr_t, event func (this *QWizard) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QWizard_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) @@ -3187,7 +3191,11 @@ func miqt_exec_callback_QWizardPage_HideEvent(self *C.QWizardPage, cb C.intptr_t func (this *QWizardPage) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QWizardPage_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/gen_qxmlstream.go b/qt/gen_qxmlstream.go index 78bc5c10..a4743c50 100644 --- a/qt/gen_qxmlstream.go +++ b/qt/gen_qxmlstream.go @@ -591,7 +591,11 @@ func NewQXmlStreamReader2(device *QIODevice) *QXmlStreamReader { // NewQXmlStreamReader3 constructs a new QXmlStreamReader object. func NewQXmlStreamReader3(data []byte) *QXmlStreamReader { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return newQXmlStreamReader(C.QXmlStreamReader_new3(data_alias)) @@ -625,7 +629,11 @@ func (this *QXmlStreamReader) Device() *QIODevice { func (this *QXmlStreamReader) AddData(data []byte) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) C.QXmlStreamReader_AddData(this.h, data_alias) } diff --git a/qt/multimedia/gen_qaudiobuffer.go b/qt/multimedia/gen_qaudiobuffer.go index cd57aaa6..aa208bf2 100644 --- a/qt/multimedia/gen_qaudiobuffer.go +++ b/qt/multimedia/gen_qaudiobuffer.go @@ -60,7 +60,11 @@ func NewQAudioBuffer2(other *QAudioBuffer) *QAudioBuffer { // NewQAudioBuffer3 constructs a new QAudioBuffer object. func NewQAudioBuffer3(data []byte, format *QAudioFormat) *QAudioBuffer { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return newQAudioBuffer(C.QAudioBuffer_new3(data_alias, format.cPointer())) @@ -75,7 +79,11 @@ func NewQAudioBuffer4(numFrames int, format *QAudioFormat) *QAudioBuffer { // NewQAudioBuffer5 constructs a new QAudioBuffer object. func NewQAudioBuffer5(data []byte, format *QAudioFormat, startTime int64) *QAudioBuffer { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return newQAudioBuffer(C.QAudioBuffer_new5(data_alias, format.cPointer(), (C.longlong)(startTime))) diff --git a/qt/multimedia/gen_qaudiosystemplugin.go b/qt/multimedia/gen_qaudiosystemplugin.go index 62a388d2..2d3d27e8 100644 --- a/qt/multimedia/gen_qaudiosystemplugin.go +++ b/qt/multimedia/gen_qaudiosystemplugin.go @@ -62,21 +62,33 @@ func (this *QAudioSystemFactoryInterface) AvailableDevices(param1 QAudio__Mode) func (this *QAudioSystemFactoryInterface) CreateInput(device []byte) *QAbstractAudioInput { device_alias := C.struct_miqt_string{} - device_alias.data = (*C.char)(unsafe.Pointer(&device[0])) + if len(device) > 0 { + device_alias.data = (*C.char)(unsafe.Pointer(&device[0])) + } else { + device_alias.data = (*C.char)(unsafe.Pointer(nil)) + } device_alias.len = C.size_t(len(device)) return newQAbstractAudioInput(C.QAudioSystemFactoryInterface_CreateInput(this.h, device_alias)) } func (this *QAudioSystemFactoryInterface) CreateOutput(device []byte) *QAbstractAudioOutput { device_alias := C.struct_miqt_string{} - device_alias.data = (*C.char)(unsafe.Pointer(&device[0])) + if len(device) > 0 { + device_alias.data = (*C.char)(unsafe.Pointer(&device[0])) + } else { + device_alias.data = (*C.char)(unsafe.Pointer(nil)) + } device_alias.len = C.size_t(len(device)) return newQAbstractAudioOutput(C.QAudioSystemFactoryInterface_CreateOutput(this.h, device_alias)) } func (this *QAudioSystemFactoryInterface) CreateDeviceInfo(device []byte, mode QAudio__Mode) *QAbstractAudioDeviceInfo { device_alias := C.struct_miqt_string{} - device_alias.data = (*C.char)(unsafe.Pointer(&device[0])) + if len(device) > 0 { + device_alias.data = (*C.char)(unsafe.Pointer(&device[0])) + } else { + device_alias.data = (*C.char)(unsafe.Pointer(nil)) + } device_alias.len = C.size_t(len(device)) return newQAbstractAudioDeviceInfo(C.QAudioSystemFactoryInterface_CreateDeviceInfo(this.h, device_alias, (C.int)(mode))) } @@ -193,21 +205,33 @@ func (this *QAudioSystemPlugin) AvailableDevices(param1 QAudio__Mode) [][]byte { func (this *QAudioSystemPlugin) CreateInput(device []byte) *QAbstractAudioInput { device_alias := C.struct_miqt_string{} - device_alias.data = (*C.char)(unsafe.Pointer(&device[0])) + if len(device) > 0 { + device_alias.data = (*C.char)(unsafe.Pointer(&device[0])) + } else { + device_alias.data = (*C.char)(unsafe.Pointer(nil)) + } device_alias.len = C.size_t(len(device)) return newQAbstractAudioInput(C.QAudioSystemPlugin_CreateInput(this.h, device_alias)) } func (this *QAudioSystemPlugin) CreateOutput(device []byte) *QAbstractAudioOutput { device_alias := C.struct_miqt_string{} - device_alias.data = (*C.char)(unsafe.Pointer(&device[0])) + if len(device) > 0 { + device_alias.data = (*C.char)(unsafe.Pointer(&device[0])) + } else { + device_alias.data = (*C.char)(unsafe.Pointer(nil)) + } device_alias.len = C.size_t(len(device)) return newQAbstractAudioOutput(C.QAudioSystemPlugin_CreateOutput(this.h, device_alias)) } func (this *QAudioSystemPlugin) CreateDeviceInfo(device []byte, mode QAudio__Mode) *QAbstractAudioDeviceInfo { device_alias := C.struct_miqt_string{} - device_alias.data = (*C.char)(unsafe.Pointer(&device[0])) + if len(device) > 0 { + device_alias.data = (*C.char)(unsafe.Pointer(&device[0])) + } else { + device_alias.data = (*C.char)(unsafe.Pointer(nil)) + } device_alias.len = C.size_t(len(device)) return newQAbstractAudioDeviceInfo(C.QAudioSystemPlugin_CreateDeviceInfo(this.h, device_alias, (C.int)(mode))) } @@ -277,7 +301,11 @@ func miqt_exec_callback_QAudioSystemPlugin_AvailableDevices(self *C.QAudioSystem defer C.free(unsafe.Pointer(virtualReturn_CArray)) for i := range virtualReturn { virtualReturn_i_alias := C.struct_miqt_string{} - virtualReturn_i_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn[i][0])) + if len(virtualReturn[i]) > 0 { + virtualReturn_i_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn[i][0])) + } else { + virtualReturn_i_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_i_alias.len = C.size_t(len(virtualReturn[i])) virtualReturn_CArray[i] = virtualReturn_i_alias } diff --git a/qt/multimedia/gen_qcamera.go b/qt/multimedia/gen_qcamera.go index 09993c58..788271a3 100644 --- a/qt/multimedia/gen_qcamera.go +++ b/qt/multimedia/gen_qcamera.go @@ -135,7 +135,11 @@ func NewQCamera() *QCamera { // NewQCamera2 constructs a new QCamera object. func NewQCamera2(deviceName []byte) *QCamera { deviceName_alias := C.struct_miqt_string{} - deviceName_alias.data = (*C.char)(unsafe.Pointer(&deviceName[0])) + if len(deviceName) > 0 { + deviceName_alias.data = (*C.char)(unsafe.Pointer(&deviceName[0])) + } else { + deviceName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } deviceName_alias.len = C.size_t(len(deviceName)) return newQCamera(C.QCamera_new2(deviceName_alias)) @@ -162,7 +166,11 @@ func NewQCamera5(parent *qt.QObject) *QCamera { // NewQCamera6 constructs a new QCamera object. func NewQCamera6(deviceName []byte, parent *qt.QObject) *QCamera { deviceName_alias := C.struct_miqt_string{} - deviceName_alias.data = (*C.char)(unsafe.Pointer(&deviceName[0])) + if len(deviceName) > 0 { + deviceName_alias.data = (*C.char)(unsafe.Pointer(&deviceName[0])) + } else { + deviceName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } deviceName_alias.len = C.size_t(len(deviceName)) return newQCamera(C.QCamera_new6(deviceName_alias, (*C.QObject)(parent.UnsafePointer()))) @@ -223,7 +231,11 @@ func QCamera_AvailableDevices() [][]byte { func QCamera_DeviceDescription(device []byte) string { device_alias := C.struct_miqt_string{} - device_alias.data = (*C.char)(unsafe.Pointer(&device[0])) + if len(device) > 0 { + device_alias.data = (*C.char)(unsafe.Pointer(&device[0])) + } else { + device_alias.data = (*C.char)(unsafe.Pointer(nil)) + } device_alias.len = C.size_t(len(device)) var _ms C.struct_miqt_string = C.QCamera_DeviceDescription(device_alias) _ret := C.GoStringN(_ms.data, C.int(int64(_ms.len))) diff --git a/qt/multimedia/gen_qcamerainfo.go b/qt/multimedia/gen_qcamerainfo.go index e333cbfb..abd7a56e 100644 --- a/qt/multimedia/gen_qcamerainfo.go +++ b/qt/multimedia/gen_qcamerainfo.go @@ -66,7 +66,11 @@ func NewQCameraInfo3(other *QCameraInfo) *QCameraInfo { // NewQCameraInfo4 constructs a new QCameraInfo object. func NewQCameraInfo4(name []byte) *QCameraInfo { name_alias := C.struct_miqt_string{} - name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + if len(name) > 0 { + name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + } else { + name_alias.data = (*C.char)(unsafe.Pointer(nil)) + } name_alias.len = C.size_t(len(name)) return newQCameraInfo(C.QCameraInfo_new4(name_alias)) diff --git a/qt/multimedia/gen_qcameraviewfinder.go b/qt/multimedia/gen_qcameraviewfinder.go index 1d481899..e0efd1c0 100644 --- a/qt/multimedia/gen_qcameraviewfinder.go +++ b/qt/multimedia/gen_qcameraviewfinder.go @@ -1029,7 +1029,11 @@ func miqt_exec_callback_QCameraViewfinder_DropEvent(self *C.QCameraViewfinder, c func (this *QCameraViewfinder) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QCameraViewfinder_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/multimedia/gen_qmediaserviceproviderplugin.go b/qt/multimedia/gen_qmediaserviceproviderplugin.go index 4291ac04..de5dcfcf 100644 --- a/qt/multimedia/gen_qmediaserviceproviderplugin.go +++ b/qt/multimedia/gen_qmediaserviceproviderplugin.go @@ -94,7 +94,11 @@ func NewQMediaServiceProviderHint2(mimeType string, codecs []string) *QMediaServ // NewQMediaServiceProviderHint3 constructs a new QMediaServiceProviderHint object. func NewQMediaServiceProviderHint3(device []byte) *QMediaServiceProviderHint { device_alias := C.struct_miqt_string{} - device_alias.data = (*C.char)(unsafe.Pointer(&device[0])) + if len(device) > 0 { + device_alias.data = (*C.char)(unsafe.Pointer(&device[0])) + } else { + device_alias.data = (*C.char)(unsafe.Pointer(nil)) + } device_alias.len = C.size_t(len(device)) return newQMediaServiceProviderHint(C.QMediaServiceProviderHint_new3(device_alias)) @@ -364,7 +368,11 @@ func UnsafeNewQMediaServiceSupportedDevicesInterface(h unsafe.Pointer) *QMediaSe func (this *QMediaServiceSupportedDevicesInterface) Devices(service []byte) [][]byte { service_alias := C.struct_miqt_string{} - service_alias.data = (*C.char)(unsafe.Pointer(&service[0])) + if len(service) > 0 { + service_alias.data = (*C.char)(unsafe.Pointer(&service[0])) + } else { + service_alias.data = (*C.char)(unsafe.Pointer(nil)) + } service_alias.len = C.size_t(len(service)) var _ma C.struct_miqt_array = C.QMediaServiceSupportedDevicesInterface_Devices(this.h, service_alias) _ret := make([][]byte, int(_ma.len)) @@ -380,10 +388,18 @@ func (this *QMediaServiceSupportedDevicesInterface) Devices(service []byte) [][] func (this *QMediaServiceSupportedDevicesInterface) DeviceDescription(service []byte, device []byte) string { service_alias := C.struct_miqt_string{} - service_alias.data = (*C.char)(unsafe.Pointer(&service[0])) + if len(service) > 0 { + service_alias.data = (*C.char)(unsafe.Pointer(&service[0])) + } else { + service_alias.data = (*C.char)(unsafe.Pointer(nil)) + } service_alias.len = C.size_t(len(service)) device_alias := C.struct_miqt_string{} - device_alias.data = (*C.char)(unsafe.Pointer(&device[0])) + if len(device) > 0 { + device_alias.data = (*C.char)(unsafe.Pointer(&device[0])) + } else { + device_alias.data = (*C.char)(unsafe.Pointer(nil)) + } device_alias.len = C.size_t(len(device)) var _ms C.struct_miqt_string = C.QMediaServiceSupportedDevicesInterface_DeviceDescription(this.h, service_alias, device_alias) _ret := C.GoStringN(_ms.data, C.int(int64(_ms.len))) @@ -443,7 +459,11 @@ func UnsafeNewQMediaServiceDefaultDeviceInterface(h unsafe.Pointer) *QMediaServi func (this *QMediaServiceDefaultDeviceInterface) DefaultDevice(service []byte) []byte { service_alias := C.struct_miqt_string{} - service_alias.data = (*C.char)(unsafe.Pointer(&service[0])) + if len(service) > 0 { + service_alias.data = (*C.char)(unsafe.Pointer(&service[0])) + } else { + service_alias.data = (*C.char)(unsafe.Pointer(nil)) + } service_alias.len = C.size_t(len(service)) var _bytearray C.struct_miqt_string = C.QMediaServiceDefaultDeviceInterface_DefaultDevice(this.h, service_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) @@ -503,14 +523,22 @@ func UnsafeNewQMediaServiceCameraInfoInterface(h unsafe.Pointer) *QMediaServiceC func (this *QMediaServiceCameraInfoInterface) CameraPosition(device []byte) QCamera__Position { device_alias := C.struct_miqt_string{} - device_alias.data = (*C.char)(unsafe.Pointer(&device[0])) + if len(device) > 0 { + device_alias.data = (*C.char)(unsafe.Pointer(&device[0])) + } else { + device_alias.data = (*C.char)(unsafe.Pointer(nil)) + } device_alias.len = C.size_t(len(device)) return (QCamera__Position)(C.QMediaServiceCameraInfoInterface_CameraPosition(this.h, device_alias)) } func (this *QMediaServiceCameraInfoInterface) CameraOrientation(device []byte) int { device_alias := C.struct_miqt_string{} - device_alias.data = (*C.char)(unsafe.Pointer(&device[0])) + if len(device) > 0 { + device_alias.data = (*C.char)(unsafe.Pointer(&device[0])) + } else { + device_alias.data = (*C.char)(unsafe.Pointer(nil)) + } device_alias.len = C.size_t(len(device)) return (int)(C.QMediaServiceCameraInfoInterface_CameraOrientation(this.h, device_alias)) } @@ -567,7 +595,11 @@ func UnsafeNewQMediaServiceFeaturesInterface(h unsafe.Pointer) *QMediaServiceFea func (this *QMediaServiceFeaturesInterface) SupportedFeatures(service []byte) QMediaServiceProviderHint__Feature { service_alias := C.struct_miqt_string{} - service_alias.data = (*C.char)(unsafe.Pointer(&service[0])) + if len(service) > 0 { + service_alias.data = (*C.char)(unsafe.Pointer(&service[0])) + } else { + service_alias.data = (*C.char)(unsafe.Pointer(nil)) + } service_alias.len = C.size_t(len(service)) return (QMediaServiceProviderHint__Feature)(C.QMediaServiceFeaturesInterface_SupportedFeatures(this.h, service_alias)) } diff --git a/qt/multimedia/gen_qvideowidget.go b/qt/multimedia/gen_qvideowidget.go index 0a54c93b..72fcc960 100644 --- a/qt/multimedia/gen_qvideowidget.go +++ b/qt/multimedia/gen_qvideowidget.go @@ -1186,7 +1186,11 @@ func miqt_exec_callback_QVideoWidget_DropEvent(self *C.QVideoWidget, cb C.intptr func (this *QVideoWidget) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QVideoWidget_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/network/gen_qabstractnetworkcache.go b/qt/network/gen_qabstractnetworkcache.go index 9cd81a3b..3f38b4a7 100644 --- a/qt/network/gen_qabstractnetworkcache.go +++ b/qt/network/gen_qabstractnetworkcache.go @@ -130,11 +130,19 @@ func (this *QNetworkCacheMetaData) SetRawHeaders(headers []struct { headers_i_Second_CArray := (*[0xffff]C.struct_miqt_string)(C.malloc(C.size_t(int(unsafe.Sizeof(C.struct_miqt_string{}))))) defer C.free(unsafe.Pointer(headers_i_Second_CArray)) headers_i_First_alias := C.struct_miqt_string{} - headers_i_First_alias.data = (*C.char)(unsafe.Pointer(&headers[i].First[0])) + if len(headers[i].First) > 0 { + headers_i_First_alias.data = (*C.char)(unsafe.Pointer(&headers[i].First[0])) + } else { + headers_i_First_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headers_i_First_alias.len = C.size_t(len(headers[i].First)) headers_i_First_CArray[0] = headers_i_First_alias headers_i_Second_alias := C.struct_miqt_string{} - headers_i_Second_alias.data = (*C.char)(unsafe.Pointer(&headers[i].Second[0])) + if len(headers[i].Second) > 0 { + headers_i_Second_alias.data = (*C.char)(unsafe.Pointer(&headers[i].Second[0])) + } else { + headers_i_Second_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headers_i_Second_alias.len = C.size_t(len(headers[i].Second)) headers_i_Second_CArray[0] = headers_i_Second_alias headers_i_pair := C.struct_miqt_map{ diff --git a/qt/network/gen_qdtls.go b/qt/network/gen_qdtls.go index 51bff6d0..43e335f9 100644 --- a/qt/network/gen_qdtls.go +++ b/qt/network/gen_qdtls.go @@ -126,7 +126,11 @@ func (this *QDtlsClientVerifier) CookieGeneratorParameters() *QDtlsClientVerifie func (this *QDtlsClientVerifier) VerifyClient(socket *QUdpSocket, dgram []byte, address *QHostAddress, port uint16) bool { dgram_alias := C.struct_miqt_string{} - dgram_alias.data = (*C.char)(unsafe.Pointer(&dgram[0])) + if len(dgram) > 0 { + dgram_alias.data = (*C.char)(unsafe.Pointer(&dgram[0])) + } else { + dgram_alias.data = (*C.char)(unsafe.Pointer(nil)) + } dgram_alias.len = C.size_t(len(dgram)) return (bool)(C.QDtlsClientVerifier_VerifyClient(this.h, socket.cPointer(), dgram_alias, address.cPointer(), (C.uint16_t)(port))) } @@ -572,14 +576,22 @@ func (this *QDtls) SessionProtocol() QSsl__SslProtocol { func (this *QDtls) WriteDatagramEncrypted(socket *QUdpSocket, dgram []byte) int64 { dgram_alias := C.struct_miqt_string{} - dgram_alias.data = (*C.char)(unsafe.Pointer(&dgram[0])) + if len(dgram) > 0 { + dgram_alias.data = (*C.char)(unsafe.Pointer(&dgram[0])) + } else { + dgram_alias.data = (*C.char)(unsafe.Pointer(nil)) + } dgram_alias.len = C.size_t(len(dgram)) return (int64)(C.QDtls_WriteDatagramEncrypted(this.h, socket.cPointer(), dgram_alias)) } func (this *QDtls) DecryptDatagram(socket *QUdpSocket, dgram []byte) []byte { dgram_alias := C.struct_miqt_string{} - dgram_alias.data = (*C.char)(unsafe.Pointer(&dgram[0])) + if len(dgram) > 0 { + dgram_alias.data = (*C.char)(unsafe.Pointer(&dgram[0])) + } else { + dgram_alias.data = (*C.char)(unsafe.Pointer(nil)) + } dgram_alias.len = C.size_t(len(dgram)) var _bytearray C.struct_miqt_string = C.QDtls_DecryptDatagram(this.h, socket.cPointer(), dgram_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) @@ -711,7 +723,11 @@ func (this *QDtls) SetPeer3(address *QHostAddress, port uint16, verificationName func (this *QDtls) DoHandshake2(socket *QUdpSocket, dgram []byte) bool { dgram_alias := C.struct_miqt_string{} - dgram_alias.data = (*C.char)(unsafe.Pointer(&dgram[0])) + if len(dgram) > 0 { + dgram_alias.data = (*C.char)(unsafe.Pointer(&dgram[0])) + } else { + dgram_alias.data = (*C.char)(unsafe.Pointer(nil)) + } dgram_alias.len = C.size_t(len(dgram)) return (bool)(C.QDtls_DoHandshake2(this.h, socket.cPointer(), dgram_alias)) } @@ -959,7 +975,11 @@ func NewQDtlsClientVerifier__GeneratorParameters() *QDtlsClientVerifier__Generat // NewQDtlsClientVerifier__GeneratorParameters2 constructs a new QDtlsClientVerifier::GeneratorParameters object. func NewQDtlsClientVerifier__GeneratorParameters2(a qt.QCryptographicHash__Algorithm, s []byte) *QDtlsClientVerifier__GeneratorParameters { s_alias := C.struct_miqt_string{} - s_alias.data = (*C.char)(unsafe.Pointer(&s[0])) + if len(s) > 0 { + s_alias.data = (*C.char)(unsafe.Pointer(&s[0])) + } else { + s_alias.data = (*C.char)(unsafe.Pointer(nil)) + } s_alias.len = C.size_t(len(s)) return newQDtlsClientVerifier__GeneratorParameters(C.QDtlsClientVerifier__GeneratorParameters_new2((C.int)(a), s_alias)) diff --git a/qt/network/gen_qhttpmultipart.go b/qt/network/gen_qhttpmultipart.go index 6fa06770..5657ec52 100644 --- a/qt/network/gen_qhttpmultipart.go +++ b/qt/network/gen_qhttpmultipart.go @@ -90,17 +90,29 @@ func (this *QHttpPart) SetHeader(header QNetworkRequest__KnownHeaders, value *qt func (this *QHttpPart) SetRawHeader(headerName []byte, headerValue []byte) { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) headerValue_alias := C.struct_miqt_string{} - headerValue_alias.data = (*C.char)(unsafe.Pointer(&headerValue[0])) + if len(headerValue) > 0 { + headerValue_alias.data = (*C.char)(unsafe.Pointer(&headerValue[0])) + } else { + headerValue_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerValue_alias.len = C.size_t(len(headerValue)) C.QHttpPart_SetRawHeader(this.h, headerName_alias, headerValue_alias) } func (this *QHttpPart) SetBody(body []byte) { body_alias := C.struct_miqt_string{} - body_alias.data = (*C.char)(unsafe.Pointer(&body[0])) + if len(body) > 0 { + body_alias.data = (*C.char)(unsafe.Pointer(&body[0])) + } else { + body_alias.data = (*C.char)(unsafe.Pointer(nil)) + } body_alias.len = C.size_t(len(body)) C.QHttpPart_SetBody(this.h, body_alias) } @@ -228,7 +240,11 @@ func (this *QHttpMultiPart) Boundary() []byte { func (this *QHttpMultiPart) SetBoundary(boundary []byte) { boundary_alias := C.struct_miqt_string{} - boundary_alias.data = (*C.char)(unsafe.Pointer(&boundary[0])) + if len(boundary) > 0 { + boundary_alias.data = (*C.char)(unsafe.Pointer(&boundary[0])) + } else { + boundary_alias.data = (*C.char)(unsafe.Pointer(nil)) + } boundary_alias.len = C.size_t(len(boundary)) C.QHttpMultiPart_SetBoundary(this.h, boundary_alias) } diff --git a/qt/network/gen_qnetworkaccessmanager.go b/qt/network/gen_qnetworkaccessmanager.go index e5854117..9b82eb34 100644 --- a/qt/network/gen_qnetworkaccessmanager.go +++ b/qt/network/gen_qnetworkaccessmanager.go @@ -218,7 +218,11 @@ func (this *QNetworkAccessManager) Post(request *QNetworkRequest, data *qt.QIODe func (this *QNetworkAccessManager) Post2(request *QNetworkRequest, data []byte) *QNetworkReply { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return newQNetworkReply(C.QNetworkAccessManager_Post2(this.h, request.cPointer(), data_alias)) } @@ -229,7 +233,11 @@ func (this *QNetworkAccessManager) Put(request *QNetworkRequest, data *qt.QIODev func (this *QNetworkAccessManager) Put2(request *QNetworkRequest, data []byte) *QNetworkReply { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return newQNetworkReply(C.QNetworkAccessManager_Put2(this.h, request.cPointer(), data_alias)) } @@ -240,17 +248,29 @@ func (this *QNetworkAccessManager) DeleteResource(request *QNetworkRequest) *QNe func (this *QNetworkAccessManager) SendCustomRequest(request *QNetworkRequest, verb []byte) *QNetworkReply { verb_alias := C.struct_miqt_string{} - verb_alias.data = (*C.char)(unsafe.Pointer(&verb[0])) + if len(verb) > 0 { + verb_alias.data = (*C.char)(unsafe.Pointer(&verb[0])) + } else { + verb_alias.data = (*C.char)(unsafe.Pointer(nil)) + } verb_alias.len = C.size_t(len(verb)) return newQNetworkReply(C.QNetworkAccessManager_SendCustomRequest(this.h, request.cPointer(), verb_alias)) } func (this *QNetworkAccessManager) SendCustomRequest2(request *QNetworkRequest, verb []byte, data []byte) *QNetworkReply { verb_alias := C.struct_miqt_string{} - verb_alias.data = (*C.char)(unsafe.Pointer(&verb[0])) + if len(verb) > 0 { + verb_alias.data = (*C.char)(unsafe.Pointer(&verb[0])) + } else { + verb_alias.data = (*C.char)(unsafe.Pointer(nil)) + } verb_alias.len = C.size_t(len(verb)) data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return newQNetworkReply(C.QNetworkAccessManager_SendCustomRequest2(this.h, request.cPointer(), verb_alias, data_alias)) } @@ -265,7 +285,11 @@ func (this *QNetworkAccessManager) Put3(request *QNetworkRequest, multiPart *QHt func (this *QNetworkAccessManager) SendCustomRequest3(request *QNetworkRequest, verb []byte, multiPart *QHttpMultiPart) *QNetworkReply { verb_alias := C.struct_miqt_string{} - verb_alias.data = (*C.char)(unsafe.Pointer(&verb[0])) + if len(verb) > 0 { + verb_alias.data = (*C.char)(unsafe.Pointer(&verb[0])) + } else { + verb_alias.data = (*C.char)(unsafe.Pointer(nil)) + } verb_alias.len = C.size_t(len(verb)) return newQNetworkReply(C.QNetworkAccessManager_SendCustomRequest3(this.h, request.cPointer(), verb_alias, multiPart.cPointer())) } @@ -579,7 +603,11 @@ func (this *QNetworkAccessManager) EnableStrictTransportSecurityStore2(enabled b func (this *QNetworkAccessManager) SendCustomRequest32(request *QNetworkRequest, verb []byte, data *qt.QIODevice) *QNetworkReply { verb_alias := C.struct_miqt_string{} - verb_alias.data = (*C.char)(unsafe.Pointer(&verb[0])) + if len(verb) > 0 { + verb_alias.data = (*C.char)(unsafe.Pointer(&verb[0])) + } else { + verb_alias.data = (*C.char)(unsafe.Pointer(nil)) + } verb_alias.len = C.size_t(len(verb)) return newQNetworkReply(C.QNetworkAccessManager_SendCustomRequest32(this.h, request.cPointer(), verb_alias, (*C.QIODevice)(data.UnsafePointer()))) } diff --git a/qt/network/gen_qnetworkcookie.go b/qt/network/gen_qnetworkcookie.go index 2acfe153..e55a55a4 100644 --- a/qt/network/gen_qnetworkcookie.go +++ b/qt/network/gen_qnetworkcookie.go @@ -68,7 +68,11 @@ func NewQNetworkCookie2(other *QNetworkCookie) *QNetworkCookie { // NewQNetworkCookie3 constructs a new QNetworkCookie object. func NewQNetworkCookie3(name []byte) *QNetworkCookie { name_alias := C.struct_miqt_string{} - name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + if len(name) > 0 { + name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + } else { + name_alias.data = (*C.char)(unsafe.Pointer(nil)) + } name_alias.len = C.size_t(len(name)) return newQNetworkCookie(C.QNetworkCookie_new3(name_alias)) @@ -77,10 +81,18 @@ func NewQNetworkCookie3(name []byte) *QNetworkCookie { // NewQNetworkCookie4 constructs a new QNetworkCookie object. func NewQNetworkCookie4(name []byte, value []byte) *QNetworkCookie { name_alias := C.struct_miqt_string{} - name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + if len(name) > 0 { + name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + } else { + name_alias.data = (*C.char)(unsafe.Pointer(nil)) + } name_alias.len = C.size_t(len(name)) value_alias := C.struct_miqt_string{} - value_alias.data = (*C.char)(unsafe.Pointer(&value[0])) + if len(value) > 0 { + value_alias.data = (*C.char)(unsafe.Pointer(&value[0])) + } else { + value_alias.data = (*C.char)(unsafe.Pointer(nil)) + } value_alias.len = C.size_t(len(value)) return newQNetworkCookie(C.QNetworkCookie_new4(name_alias, value_alias)) @@ -171,7 +183,11 @@ func (this *QNetworkCookie) Name() []byte { func (this *QNetworkCookie) SetName(cookieName []byte) { cookieName_alias := C.struct_miqt_string{} - cookieName_alias.data = (*C.char)(unsafe.Pointer(&cookieName[0])) + if len(cookieName) > 0 { + cookieName_alias.data = (*C.char)(unsafe.Pointer(&cookieName[0])) + } else { + cookieName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } cookieName_alias.len = C.size_t(len(cookieName)) C.QNetworkCookie_SetName(this.h, cookieName_alias) } @@ -185,7 +201,11 @@ func (this *QNetworkCookie) Value() []byte { func (this *QNetworkCookie) SetValue(value []byte) { value_alias := C.struct_miqt_string{} - value_alias.data = (*C.char)(unsafe.Pointer(&value[0])) + if len(value) > 0 { + value_alias.data = (*C.char)(unsafe.Pointer(&value[0])) + } else { + value_alias.data = (*C.char)(unsafe.Pointer(nil)) + } value_alias.len = C.size_t(len(value)) C.QNetworkCookie_SetValue(this.h, value_alias) } @@ -207,7 +227,11 @@ func (this *QNetworkCookie) Normalize(url *qt.QUrl) { func QNetworkCookie_ParseCookies(cookieString []byte) []QNetworkCookie { cookieString_alias := C.struct_miqt_string{} - cookieString_alias.data = (*C.char)(unsafe.Pointer(&cookieString[0])) + if len(cookieString) > 0 { + cookieString_alias.data = (*C.char)(unsafe.Pointer(&cookieString[0])) + } else { + cookieString_alias.data = (*C.char)(unsafe.Pointer(nil)) + } cookieString_alias.len = C.size_t(len(cookieString)) var _ma C.struct_miqt_array = C.QNetworkCookie_ParseCookies(cookieString_alias) _ret := make([]QNetworkCookie, int(_ma.len)) diff --git a/qt/network/gen_qnetworkdatagram.go b/qt/network/gen_qnetworkdatagram.go index 17b7ac60..dc9afe1e 100644 --- a/qt/network/gen_qnetworkdatagram.go +++ b/qt/network/gen_qnetworkdatagram.go @@ -54,7 +54,11 @@ func NewQNetworkDatagram() *QNetworkDatagram { // NewQNetworkDatagram2 constructs a new QNetworkDatagram object. func NewQNetworkDatagram2(data []byte) *QNetworkDatagram { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return newQNetworkDatagram(C.QNetworkDatagram_new2(data_alias)) @@ -69,7 +73,11 @@ func NewQNetworkDatagram3(other *QNetworkDatagram) *QNetworkDatagram { // NewQNetworkDatagram4 constructs a new QNetworkDatagram object. func NewQNetworkDatagram4(data []byte, destinationAddress *QHostAddress) *QNetworkDatagram { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return newQNetworkDatagram(C.QNetworkDatagram_new4(data_alias, destinationAddress.cPointer())) @@ -78,7 +86,11 @@ func NewQNetworkDatagram4(data []byte, destinationAddress *QHostAddress) *QNetwo // NewQNetworkDatagram5 constructs a new QNetworkDatagram object. func NewQNetworkDatagram5(data []byte, destinationAddress *QHostAddress, port uint16) *QNetworkDatagram { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return newQNetworkDatagram(C.QNetworkDatagram_new5(data_alias, destinationAddress.cPointer(), (C.uint16_t)(port))) @@ -157,14 +169,22 @@ func (this *QNetworkDatagram) Data() []byte { func (this *QNetworkDatagram) SetData(data []byte) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) C.QNetworkDatagram_SetData(this.h, data_alias) } func (this *QNetworkDatagram) MakeReply(payload []byte) *QNetworkDatagram { payload_alias := C.struct_miqt_string{} - payload_alias.data = (*C.char)(unsafe.Pointer(&payload[0])) + if len(payload) > 0 { + payload_alias.data = (*C.char)(unsafe.Pointer(&payload[0])) + } else { + payload_alias.data = (*C.char)(unsafe.Pointer(nil)) + } payload_alias.len = C.size_t(len(payload)) _goptr := newQNetworkDatagram(C.QNetworkDatagram_MakeReply(this.h, payload_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer diff --git a/qt/network/gen_qnetworkproxy.go b/qt/network/gen_qnetworkproxy.go index 50375138..26438089 100644 --- a/qt/network/gen_qnetworkproxy.go +++ b/qt/network/gen_qnetworkproxy.go @@ -566,7 +566,11 @@ func (this *QNetworkProxy) SetHeader(header QNetworkRequest__KnownHeaders, value func (this *QNetworkProxy) HasRawHeader(headerName []byte) bool { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) return (bool)(C.QNetworkProxy_HasRawHeader(this.h, headerName_alias)) } @@ -586,7 +590,11 @@ func (this *QNetworkProxy) RawHeaderList() [][]byte { func (this *QNetworkProxy) RawHeader(headerName []byte) []byte { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) var _bytearray C.struct_miqt_string = C.QNetworkProxy_RawHeader(this.h, headerName_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) @@ -596,10 +604,18 @@ func (this *QNetworkProxy) RawHeader(headerName []byte) []byte { func (this *QNetworkProxy) SetRawHeader(headerName []byte, value []byte) { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) value_alias := C.struct_miqt_string{} - value_alias.data = (*C.char)(unsafe.Pointer(&value[0])) + if len(value) > 0 { + value_alias.data = (*C.char)(unsafe.Pointer(&value[0])) + } else { + value_alias.data = (*C.char)(unsafe.Pointer(nil)) + } value_alias.len = C.size_t(len(value)) C.QNetworkProxy_SetRawHeader(this.h, headerName_alias, value_alias) } diff --git a/qt/network/gen_qnetworkreply.go b/qt/network/gen_qnetworkreply.go index 0fc5388a..fde39ed8 100644 --- a/qt/network/gen_qnetworkreply.go +++ b/qt/network/gen_qnetworkreply.go @@ -174,7 +174,11 @@ func (this *QNetworkReply) Header(header QNetworkRequest__KnownHeaders) *qt.QVar func (this *QNetworkReply) HasRawHeader(headerName []byte) bool { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) return (bool)(C.QNetworkReply_HasRawHeader(this.h, headerName_alias)) } @@ -194,7 +198,11 @@ func (this *QNetworkReply) RawHeaderList() [][]byte { func (this *QNetworkReply) RawHeader(headerName []byte) []byte { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) var _bytearray C.struct_miqt_string = C.QNetworkReply_RawHeader(this.h, headerName_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) diff --git a/qt/network/gen_qnetworkrequest.go b/qt/network/gen_qnetworkrequest.go index cff4203f..3bbc5c90 100644 --- a/qt/network/gen_qnetworkrequest.go +++ b/qt/network/gen_qnetworkrequest.go @@ -197,7 +197,11 @@ func (this *QNetworkRequest) SetHeader(header QNetworkRequest__KnownHeaders, val func (this *QNetworkRequest) HasRawHeader(headerName []byte) bool { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) return (bool)(C.QNetworkRequest_HasRawHeader(this.h, headerName_alias)) } @@ -217,7 +221,11 @@ func (this *QNetworkRequest) RawHeaderList() [][]byte { func (this *QNetworkRequest) RawHeader(headerName []byte) []byte { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) var _bytearray C.struct_miqt_string = C.QNetworkRequest_RawHeader(this.h, headerName_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) @@ -227,10 +235,18 @@ func (this *QNetworkRequest) RawHeader(headerName []byte) []byte { func (this *QNetworkRequest) SetRawHeader(headerName []byte, value []byte) { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) value_alias := C.struct_miqt_string{} - value_alias.data = (*C.char)(unsafe.Pointer(&value[0])) + if len(value) > 0 { + value_alias.data = (*C.char)(unsafe.Pointer(&value[0])) + } else { + value_alias.data = (*C.char)(unsafe.Pointer(nil)) + } value_alias.len = C.size_t(len(value)) C.QNetworkRequest_SetRawHeader(this.h, headerName_alias, value_alias) } diff --git a/qt/network/gen_qsslcertificate.go b/qt/network/gen_qsslcertificate.go index ac943aaa..851ec8b8 100644 --- a/qt/network/gen_qsslcertificate.go +++ b/qt/network/gen_qsslcertificate.go @@ -95,7 +95,11 @@ func NewQSslCertificate4(device *qt.QIODevice, format QSsl__EncodingFormat) *QSs // NewQSslCertificate5 constructs a new QSslCertificate object. func NewQSslCertificate5(data []byte) *QSslCertificate { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return newQSslCertificate(C.QSslCertificate_new5(data_alias)) @@ -104,7 +108,11 @@ func NewQSslCertificate5(data []byte) *QSslCertificate { // NewQSslCertificate6 constructs a new QSslCertificate object. func NewQSslCertificate6(data []byte, format QSsl__EncodingFormat) *QSslCertificate { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return newQSslCertificate(C.QSslCertificate_new6(data_alias, (C.int)(format))) @@ -178,7 +186,11 @@ func (this *QSslCertificate) IssuerInfo(info QSslCertificate__SubjectInfo) []str func (this *QSslCertificate) IssuerInfoWithAttribute(attribute []byte) []string { attribute_alias := C.struct_miqt_string{} - attribute_alias.data = (*C.char)(unsafe.Pointer(&attribute[0])) + if len(attribute) > 0 { + attribute_alias.data = (*C.char)(unsafe.Pointer(&attribute[0])) + } else { + attribute_alias.data = (*C.char)(unsafe.Pointer(nil)) + } attribute_alias.len = C.size_t(len(attribute)) var _ma C.struct_miqt_array = C.QSslCertificate_IssuerInfoWithAttribute(this.h, attribute_alias) _ret := make([]string, int(_ma.len)) @@ -207,7 +219,11 @@ func (this *QSslCertificate) SubjectInfo(info QSslCertificate__SubjectInfo) []st func (this *QSslCertificate) SubjectInfoWithAttribute(attribute []byte) []string { attribute_alias := C.struct_miqt_string{} - attribute_alias.data = (*C.char)(unsafe.Pointer(&attribute[0])) + if len(attribute) > 0 { + attribute_alias.data = (*C.char)(unsafe.Pointer(&attribute[0])) + } else { + attribute_alias.data = (*C.char)(unsafe.Pointer(nil)) + } attribute_alias.len = C.size_t(len(attribute)) var _ma C.struct_miqt_array = C.QSslCertificate_SubjectInfoWithAttribute(this.h, attribute_alias) _ret := make([]string, int(_ma.len)) @@ -358,7 +374,11 @@ func QSslCertificate_FromDevice(device *qt.QIODevice) []QSslCertificate { func QSslCertificate_FromData(data []byte) []QSslCertificate { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) var _ma C.struct_miqt_array = C.QSslCertificate_FromData(data_alias) _ret := make([]QSslCertificate, int(_ma.len)) @@ -450,7 +470,11 @@ func QSslCertificate_FromDevice2(device *qt.QIODevice, format QSsl__EncodingForm func QSslCertificate_FromData2(data []byte, format QSsl__EncodingFormat) []QSslCertificate { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) var _ma C.struct_miqt_array = C.QSslCertificate_FromData2(data_alias, (C.int)(format)) _ret := make([]QSslCertificate, int(_ma.len)) @@ -503,7 +527,11 @@ func QSslCertificate_ImportPkcs125(device *qt.QIODevice, key *QSslKey, cert *QSs } caCertificates_ma := C.struct_miqt_array{len: C.size_t(len(caCertificates)), data: unsafe.Pointer(caCertificates_CArray)} passPhrase_alias := C.struct_miqt_string{} - passPhrase_alias.data = (*C.char)(unsafe.Pointer(&passPhrase[0])) + if len(passPhrase) > 0 { + passPhrase_alias.data = (*C.char)(unsafe.Pointer(&passPhrase[0])) + } else { + passPhrase_alias.data = (*C.char)(unsafe.Pointer(nil)) + } passPhrase_alias.len = C.size_t(len(passPhrase)) return (bool)(C.QSslCertificate_ImportPkcs125((*C.QIODevice)(device.UnsafePointer()), key.cPointer(), cert.cPointer(), caCertificates_ma, passPhrase_alias)) } diff --git a/qt/network/gen_qsslconfiguration.go b/qt/network/gen_qsslconfiguration.go index e91ae6e5..951555de 100644 --- a/qt/network/gen_qsslconfiguration.go +++ b/qt/network/gen_qsslconfiguration.go @@ -287,7 +287,11 @@ func (this *QSslConfiguration) SessionTicket() []byte { func (this *QSslConfiguration) SetSessionTicket(sessionTicket []byte) { sessionTicket_alias := C.struct_miqt_string{} - sessionTicket_alias.data = (*C.char)(unsafe.Pointer(&sessionTicket[0])) + if len(sessionTicket) > 0 { + sessionTicket_alias.data = (*C.char)(unsafe.Pointer(&sessionTicket[0])) + } else { + sessionTicket_alias.data = (*C.char)(unsafe.Pointer(nil)) + } sessionTicket_alias.len = C.size_t(len(sessionTicket)) C.QSslConfiguration_SetSessionTicket(this.h, sessionTicket_alias) } @@ -345,7 +349,11 @@ func (this *QSslConfiguration) PreSharedKeyIdentityHint() []byte { func (this *QSslConfiguration) SetPreSharedKeyIdentityHint(hint []byte) { hint_alias := C.struct_miqt_string{} - hint_alias.data = (*C.char)(unsafe.Pointer(&hint[0])) + if len(hint) > 0 { + hint_alias.data = (*C.char)(unsafe.Pointer(&hint[0])) + } else { + hint_alias.data = (*C.char)(unsafe.Pointer(nil)) + } hint_alias.len = C.size_t(len(hint)) C.QSslConfiguration_SetPreSharedKeyIdentityHint(this.h, hint_alias) } @@ -362,7 +370,11 @@ func (this *QSslConfiguration) SetDiffieHellmanParameters(dhparams *QSslDiffieHe func (this *QSslConfiguration) SetBackendConfigurationOption(name []byte, value *qt.QVariant) { name_alias := C.struct_miqt_string{} - name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + if len(name) > 0 { + name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + } else { + name_alias.data = (*C.char)(unsafe.Pointer(nil)) + } name_alias.len = C.size_t(len(name)) C.QSslConfiguration_SetBackendConfigurationOption(this.h, name_alias, (*C.QVariant)(value.UnsafePointer())) } @@ -412,7 +424,11 @@ func (this *QSslConfiguration) SetAllowedNextProtocols(protocols [][]byte) { defer C.free(unsafe.Pointer(protocols_CArray)) for i := range protocols { protocols_i_alias := C.struct_miqt_string{} - protocols_i_alias.data = (*C.char)(unsafe.Pointer(&protocols[i][0])) + if len(protocols[i]) > 0 { + protocols_i_alias.data = (*C.char)(unsafe.Pointer(&protocols[i][0])) + } else { + protocols_i_alias.data = (*C.char)(unsafe.Pointer(nil)) + } protocols_i_alias.len = C.size_t(len(protocols[i])) protocols_CArray[i] = protocols_i_alias } diff --git a/qt/network/gen_qssldiffiehellmanparameters.go b/qt/network/gen_qssldiffiehellmanparameters.go index 5af3e90d..c07d6e5d 100644 --- a/qt/network/gen_qssldiffiehellmanparameters.go +++ b/qt/network/gen_qssldiffiehellmanparameters.go @@ -82,7 +82,11 @@ func (this *QSslDiffieHellmanParameters) Swap(other *QSslDiffieHellmanParameters func QSslDiffieHellmanParameters_FromEncoded(encoded []byte) *QSslDiffieHellmanParameters { encoded_alias := C.struct_miqt_string{} - encoded_alias.data = (*C.char)(unsafe.Pointer(&encoded[0])) + if len(encoded) > 0 { + encoded_alias.data = (*C.char)(unsafe.Pointer(&encoded[0])) + } else { + encoded_alias.data = (*C.char)(unsafe.Pointer(nil)) + } encoded_alias.len = C.size_t(len(encoded)) _goptr := newQSslDiffieHellmanParameters(C.QSslDiffieHellmanParameters_FromEncoded(encoded_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer @@ -116,7 +120,11 @@ func (this *QSslDiffieHellmanParameters) ErrorString() string { func QSslDiffieHellmanParameters_FromEncoded2(encoded []byte, format QSsl__EncodingFormat) *QSslDiffieHellmanParameters { encoded_alias := C.struct_miqt_string{} - encoded_alias.data = (*C.char)(unsafe.Pointer(&encoded[0])) + if len(encoded) > 0 { + encoded_alias.data = (*C.char)(unsafe.Pointer(&encoded[0])) + } else { + encoded_alias.data = (*C.char)(unsafe.Pointer(nil)) + } encoded_alias.len = C.size_t(len(encoded)) _goptr := newQSslDiffieHellmanParameters(C.QSslDiffieHellmanParameters_FromEncoded2(encoded_alias, (C.int)(format))) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer diff --git a/qt/network/gen_qsslkey.go b/qt/network/gen_qsslkey.go index a0d7802d..dfb8bd63 100644 --- a/qt/network/gen_qsslkey.go +++ b/qt/network/gen_qsslkey.go @@ -55,7 +55,11 @@ func NewQSslKey() *QSslKey { // NewQSslKey2 constructs a new QSslKey object. func NewQSslKey2(encoded []byte, algorithm QSsl__KeyAlgorithm) *QSslKey { encoded_alias := C.struct_miqt_string{} - encoded_alias.data = (*C.char)(unsafe.Pointer(&encoded[0])) + if len(encoded) > 0 { + encoded_alias.data = (*C.char)(unsafe.Pointer(&encoded[0])) + } else { + encoded_alias.data = (*C.char)(unsafe.Pointer(nil)) + } encoded_alias.len = C.size_t(len(encoded)) return newQSslKey(C.QSslKey_new2(encoded_alias, (C.int)(algorithm))) @@ -82,7 +86,11 @@ func NewQSslKey5(other *QSslKey) *QSslKey { // NewQSslKey6 constructs a new QSslKey object. func NewQSslKey6(encoded []byte, algorithm QSsl__KeyAlgorithm, format QSsl__EncodingFormat) *QSslKey { encoded_alias := C.struct_miqt_string{} - encoded_alias.data = (*C.char)(unsafe.Pointer(&encoded[0])) + if len(encoded) > 0 { + encoded_alias.data = (*C.char)(unsafe.Pointer(&encoded[0])) + } else { + encoded_alias.data = (*C.char)(unsafe.Pointer(nil)) + } encoded_alias.len = C.size_t(len(encoded)) return newQSslKey(C.QSslKey_new6(encoded_alias, (C.int)(algorithm), (C.int)(format))) @@ -91,7 +99,11 @@ func NewQSslKey6(encoded []byte, algorithm QSsl__KeyAlgorithm, format QSsl__Enco // NewQSslKey7 constructs a new QSslKey object. func NewQSslKey7(encoded []byte, algorithm QSsl__KeyAlgorithm, format QSsl__EncodingFormat, typeVal QSsl__KeyType) *QSslKey { encoded_alias := C.struct_miqt_string{} - encoded_alias.data = (*C.char)(unsafe.Pointer(&encoded[0])) + if len(encoded) > 0 { + encoded_alias.data = (*C.char)(unsafe.Pointer(&encoded[0])) + } else { + encoded_alias.data = (*C.char)(unsafe.Pointer(nil)) + } encoded_alias.len = C.size_t(len(encoded)) return newQSslKey(C.QSslKey_new7(encoded_alias, (C.int)(algorithm), (C.int)(format), (C.int)(typeVal))) @@ -100,10 +112,18 @@ func NewQSslKey7(encoded []byte, algorithm QSsl__KeyAlgorithm, format QSsl__Enco // NewQSslKey8 constructs a new QSslKey object. func NewQSslKey8(encoded []byte, algorithm QSsl__KeyAlgorithm, format QSsl__EncodingFormat, typeVal QSsl__KeyType, passPhrase []byte) *QSslKey { encoded_alias := C.struct_miqt_string{} - encoded_alias.data = (*C.char)(unsafe.Pointer(&encoded[0])) + if len(encoded) > 0 { + encoded_alias.data = (*C.char)(unsafe.Pointer(&encoded[0])) + } else { + encoded_alias.data = (*C.char)(unsafe.Pointer(nil)) + } encoded_alias.len = C.size_t(len(encoded)) passPhrase_alias := C.struct_miqt_string{} - passPhrase_alias.data = (*C.char)(unsafe.Pointer(&passPhrase[0])) + if len(passPhrase) > 0 { + passPhrase_alias.data = (*C.char)(unsafe.Pointer(&passPhrase[0])) + } else { + passPhrase_alias.data = (*C.char)(unsafe.Pointer(nil)) + } passPhrase_alias.len = C.size_t(len(passPhrase)) return newQSslKey(C.QSslKey_new8(encoded_alias, (C.int)(algorithm), (C.int)(format), (C.int)(typeVal), passPhrase_alias)) @@ -124,7 +144,11 @@ func NewQSslKey10(device *qt.QIODevice, algorithm QSsl__KeyAlgorithm, format QSs // NewQSslKey11 constructs a new QSslKey object. func NewQSslKey11(device *qt.QIODevice, algorithm QSsl__KeyAlgorithm, format QSsl__EncodingFormat, typeVal QSsl__KeyType, passPhrase []byte) *QSslKey { passPhrase_alias := C.struct_miqt_string{} - passPhrase_alias.data = (*C.char)(unsafe.Pointer(&passPhrase[0])) + if len(passPhrase) > 0 { + passPhrase_alias.data = (*C.char)(unsafe.Pointer(&passPhrase[0])) + } else { + passPhrase_alias.data = (*C.char)(unsafe.Pointer(nil)) + } passPhrase_alias.len = C.size_t(len(passPhrase)) return newQSslKey(C.QSslKey_new11((*C.QIODevice)(device.UnsafePointer()), (C.int)(algorithm), (C.int)(format), (C.int)(typeVal), passPhrase_alias)) @@ -192,7 +216,11 @@ func (this *QSslKey) OperatorNotEqual(key *QSslKey) bool { func (this *QSslKey) ToPem1(passPhrase []byte) []byte { passPhrase_alias := C.struct_miqt_string{} - passPhrase_alias.data = (*C.char)(unsafe.Pointer(&passPhrase[0])) + if len(passPhrase) > 0 { + passPhrase_alias.data = (*C.char)(unsafe.Pointer(&passPhrase[0])) + } else { + passPhrase_alias.data = (*C.char)(unsafe.Pointer(nil)) + } passPhrase_alias.len = C.size_t(len(passPhrase)) var _bytearray C.struct_miqt_string = C.QSslKey_ToPem1(this.h, passPhrase_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) @@ -202,7 +230,11 @@ func (this *QSslKey) ToPem1(passPhrase []byte) []byte { func (this *QSslKey) ToDer1(passPhrase []byte) []byte { passPhrase_alias := C.struct_miqt_string{} - passPhrase_alias.data = (*C.char)(unsafe.Pointer(&passPhrase[0])) + if len(passPhrase) > 0 { + passPhrase_alias.data = (*C.char)(unsafe.Pointer(&passPhrase[0])) + } else { + passPhrase_alias.data = (*C.char)(unsafe.Pointer(nil)) + } passPhrase_alias.len = C.size_t(len(passPhrase)) var _bytearray C.struct_miqt_string = C.QSslKey_ToDer1(this.h, passPhrase_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) diff --git a/qt/network/gen_qsslpresharedkeyauthenticator.go b/qt/network/gen_qsslpresharedkeyauthenticator.go index a42c90fd..dc39aa94 100644 --- a/qt/network/gen_qsslpresharedkeyauthenticator.go +++ b/qt/network/gen_qsslpresharedkeyauthenticator.go @@ -74,7 +74,11 @@ func (this *QSslPreSharedKeyAuthenticator) IdentityHint() []byte { func (this *QSslPreSharedKeyAuthenticator) SetIdentity(identity []byte) { identity_alias := C.struct_miqt_string{} - identity_alias.data = (*C.char)(unsafe.Pointer(&identity[0])) + if len(identity) > 0 { + identity_alias.data = (*C.char)(unsafe.Pointer(&identity[0])) + } else { + identity_alias.data = (*C.char)(unsafe.Pointer(nil)) + } identity_alias.len = C.size_t(len(identity)) C.QSslPreSharedKeyAuthenticator_SetIdentity(this.h, identity_alias) } @@ -92,7 +96,11 @@ func (this *QSslPreSharedKeyAuthenticator) MaximumIdentityLength() int { func (this *QSslPreSharedKeyAuthenticator) SetPreSharedKey(preSharedKey []byte) { preSharedKey_alias := C.struct_miqt_string{} - preSharedKey_alias.data = (*C.char)(unsafe.Pointer(&preSharedKey[0])) + if len(preSharedKey) > 0 { + preSharedKey_alias.data = (*C.char)(unsafe.Pointer(&preSharedKey[0])) + } else { + preSharedKey_alias.data = (*C.char)(unsafe.Pointer(nil)) + } preSharedKey_alias.len = C.size_t(len(preSharedKey)) C.QSslPreSharedKeyAuthenticator_SetPreSharedKey(this.h, preSharedKey_alias) } diff --git a/qt/network/gen_qsslsocket.go b/qt/network/gen_qsslsocket.go index 1f0a0a3f..90803931 100644 --- a/qt/network/gen_qsslsocket.go +++ b/qt/network/gen_qsslsocket.go @@ -871,7 +871,11 @@ func (this *QSslSocket) SetPrivateKey4(fileName string, algorithm QSsl__KeyAlgor fileName_ms.len = C.size_t(len(fileName)) defer C.free(unsafe.Pointer(fileName_ms.data)) passPhrase_alias := C.struct_miqt_string{} - passPhrase_alias.data = (*C.char)(unsafe.Pointer(&passPhrase[0])) + if len(passPhrase) > 0 { + passPhrase_alias.data = (*C.char)(unsafe.Pointer(&passPhrase[0])) + } else { + passPhrase_alias.data = (*C.char)(unsafe.Pointer(nil)) + } passPhrase_alias.len = C.size_t(len(passPhrase)) C.QSslSocket_SetPrivateKey4(this.h, fileName_ms, (C.int)(algorithm), (C.int)(format), passPhrase_alias) } diff --git a/qt/network/gen_qudpsocket.go b/qt/network/gen_qudpsocket.go index 865bae42..44cd3cda 100644 --- a/qt/network/gen_qudpsocket.go +++ b/qt/network/gen_qudpsocket.go @@ -149,7 +149,11 @@ func (this *QUdpSocket) WriteDatagram2(data string, lenVal int64, host *QHostAdd func (this *QUdpSocket) WriteDatagram3(datagram []byte, host *QHostAddress, port uint16) int64 { datagram_alias := C.struct_miqt_string{} - datagram_alias.data = (*C.char)(unsafe.Pointer(&datagram[0])) + if len(datagram) > 0 { + datagram_alias.data = (*C.char)(unsafe.Pointer(&datagram[0])) + } else { + datagram_alias.data = (*C.char)(unsafe.Pointer(nil)) + } datagram_alias.len = C.size_t(len(datagram)) return (int64)(C.QUdpSocket_WriteDatagram3(this.h, datagram_alias, host.cPointer(), (C.uint16_t)(port))) } diff --git a/qt/printsupport/gen_qabstractprintdialog.go b/qt/printsupport/gen_qabstractprintdialog.go index 00fc3c74..3c1bdecb 100644 --- a/qt/printsupport/gen_qabstractprintdialog.go +++ b/qt/printsupport/gen_qabstractprintdialog.go @@ -1206,7 +1206,11 @@ func miqt_exec_callback_QAbstractPrintDialog_HideEvent(self *C.QAbstractPrintDia func (this *QAbstractPrintDialog) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QAbstractPrintDialog_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/printsupport/gen_qpagesetupdialog.go b/qt/printsupport/gen_qpagesetupdialog.go index e66ab11e..fe261e0d 100644 --- a/qt/printsupport/gen_qpagesetupdialog.go +++ b/qt/printsupport/gen_qpagesetupdialog.go @@ -1146,7 +1146,11 @@ func miqt_exec_callback_QPageSetupDialog_HideEvent(self *C.QPageSetupDialog, cb func (this *QPageSetupDialog) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QPageSetupDialog_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/printsupport/gen_qprintdialog.go b/qt/printsupport/gen_qprintdialog.go index 785c2e9d..4bad5390 100644 --- a/qt/printsupport/gen_qprintdialog.go +++ b/qt/printsupport/gen_qprintdialog.go @@ -1190,7 +1190,11 @@ func miqt_exec_callback_QPrintDialog_HideEvent(self *C.QPrintDialog, cb C.intptr func (this *QPrintDialog) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QPrintDialog_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/printsupport/gen_qprintpreviewdialog.go b/qt/printsupport/gen_qprintpreviewdialog.go index 7a07944d..cca51ab8 100644 --- a/qt/printsupport/gen_qprintpreviewdialog.go +++ b/qt/printsupport/gen_qprintpreviewdialog.go @@ -1178,7 +1178,11 @@ func miqt_exec_callback_QPrintPreviewDialog_HideEvent(self *C.QPrintPreviewDialo func (this *QPrintPreviewDialog) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QPrintPreviewDialog_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/printsupport/gen_qprintpreviewwidget.go b/qt/printsupport/gen_qprintpreviewwidget.go index 5d2f7a61..39b884c0 100644 --- a/qt/printsupport/gen_qprintpreviewwidget.go +++ b/qt/printsupport/gen_qprintpreviewwidget.go @@ -1149,7 +1149,11 @@ func miqt_exec_callback_QPrintPreviewWidget_HideEvent(self *C.QPrintPreviewWidge func (this *QPrintPreviewWidget) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QPrintPreviewWidget_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/svg/gen_qsvgrenderer.go b/qt/svg/gen_qsvgrenderer.go index 14a28f5e..8c981c13 100644 --- a/qt/svg/gen_qsvgrenderer.go +++ b/qt/svg/gen_qsvgrenderer.go @@ -70,7 +70,11 @@ func NewQSvgRenderer2(filename string) *QSvgRenderer { // NewQSvgRenderer3 constructs a new QSvgRenderer object. func NewQSvgRenderer3(contents []byte) *QSvgRenderer { contents_alias := C.struct_miqt_string{} - contents_alias.data = (*C.char)(unsafe.Pointer(&contents[0])) + if len(contents) > 0 { + contents_alias.data = (*C.char)(unsafe.Pointer(&contents[0])) + } else { + contents_alias.data = (*C.char)(unsafe.Pointer(nil)) + } contents_alias.len = C.size_t(len(contents)) return newQSvgRenderer(C.QSvgRenderer_new3(contents_alias)) @@ -101,7 +105,11 @@ func NewQSvgRenderer6(filename string, parent *qt.QObject) *QSvgRenderer { // NewQSvgRenderer7 constructs a new QSvgRenderer object. func NewQSvgRenderer7(contents []byte, parent *qt.QObject) *QSvgRenderer { contents_alias := C.struct_miqt_string{} - contents_alias.data = (*C.char)(unsafe.Pointer(&contents[0])) + if len(contents) > 0 { + contents_alias.data = (*C.char)(unsafe.Pointer(&contents[0])) + } else { + contents_alias.data = (*C.char)(unsafe.Pointer(nil)) + } contents_alias.len = C.size_t(len(contents)) return newQSvgRenderer(C.QSvgRenderer_new7(contents_alias, (*C.QObject)(parent.UnsafePointer()))) @@ -251,7 +259,11 @@ func (this *QSvgRenderer) Load(filename string) bool { func (this *QSvgRenderer) LoadWithContents(contents []byte) bool { contents_alias := C.struct_miqt_string{} - contents_alias.data = (*C.char)(unsafe.Pointer(&contents[0])) + if len(contents) > 0 { + contents_alias.data = (*C.char)(unsafe.Pointer(&contents[0])) + } else { + contents_alias.data = (*C.char)(unsafe.Pointer(nil)) + } contents_alias.len = C.size_t(len(contents)) return (bool)(C.QSvgRenderer_LoadWithContents(this.h, contents_alias)) } diff --git a/qt/svg/gen_qsvgwidget.go b/qt/svg/gen_qsvgwidget.go index c2ab22d2..9af115f7 100644 --- a/qt/svg/gen_qsvgwidget.go +++ b/qt/svg/gen_qsvgwidget.go @@ -131,7 +131,11 @@ func (this *QSvgWidget) Load(file string) { func (this *QSvgWidget) LoadWithContents(contents []byte) { contents_alias := C.struct_miqt_string{} - contents_alias.data = (*C.char)(unsafe.Pointer(&contents[0])) + if len(contents) > 0 { + contents_alias.data = (*C.char)(unsafe.Pointer(&contents[0])) + } else { + contents_alias.data = (*C.char)(unsafe.Pointer(nil)) + } contents_alias.len = C.size_t(len(contents)) C.QSvgWidget_LoadWithContents(this.h, contents_alias) } @@ -1017,7 +1021,11 @@ func miqt_exec_callback_QSvgWidget_HideEvent(self *C.QSvgWidget, cb C.intptr_t, func (this *QSvgWidget) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QSvgWidget_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/webengine/gen_qwebenginehttprequest.go b/qt/webengine/gen_qwebenginehttprequest.go index b4eafb7e..000342d1 100644 --- a/qt/webengine/gen_qwebenginehttprequest.go +++ b/qt/webengine/gen_qwebenginehttprequest.go @@ -149,14 +149,22 @@ func (this *QWebEngineHttpRequest) PostData() []byte { func (this *QWebEngineHttpRequest) SetPostData(postData []byte) { postData_alias := C.struct_miqt_string{} - postData_alias.data = (*C.char)(unsafe.Pointer(&postData[0])) + if len(postData) > 0 { + postData_alias.data = (*C.char)(unsafe.Pointer(&postData[0])) + } else { + postData_alias.data = (*C.char)(unsafe.Pointer(nil)) + } postData_alias.len = C.size_t(len(postData)) C.QWebEngineHttpRequest_SetPostData(this.h, postData_alias) } func (this *QWebEngineHttpRequest) HasHeader(headerName []byte) bool { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) return (bool)(C.QWebEngineHttpRequest_HasHeader(this.h, headerName_alias)) } @@ -176,7 +184,11 @@ func (this *QWebEngineHttpRequest) Headers() [][]byte { func (this *QWebEngineHttpRequest) Header(headerName []byte) []byte { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) var _bytearray C.struct_miqt_string = C.QWebEngineHttpRequest_Header(this.h, headerName_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) @@ -186,17 +198,29 @@ func (this *QWebEngineHttpRequest) Header(headerName []byte) []byte { func (this *QWebEngineHttpRequest) SetHeader(headerName []byte, value []byte) { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) value_alias := C.struct_miqt_string{} - value_alias.data = (*C.char)(unsafe.Pointer(&value[0])) + if len(value) > 0 { + value_alias.data = (*C.char)(unsafe.Pointer(&value[0])) + } else { + value_alias.data = (*C.char)(unsafe.Pointer(nil)) + } value_alias.len = C.size_t(len(value)) C.QWebEngineHttpRequest_SetHeader(this.h, headerName_alias, value_alias) } func (this *QWebEngineHttpRequest) UnsetHeader(headerName []byte) { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) C.QWebEngineHttpRequest_UnsetHeader(this.h, headerName_alias) } diff --git a/qt/webengine/gen_qwebenginepage.go b/qt/webengine/gen_qwebenginepage.go index 1ded5ab8..2d192e2a 100644 --- a/qt/webengine/gen_qwebenginepage.go +++ b/qt/webengine/gen_qwebenginepage.go @@ -323,7 +323,11 @@ func (this *QWebEnginePage) SetHtml(html string) { func (this *QWebEnginePage) SetContent(data []byte) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) C.QWebEnginePage_SetContent(this.h, data_alias) } @@ -1232,7 +1236,11 @@ func (this *QWebEnginePage) SetHtml2(html string, baseUrl *qt.QUrl) { func (this *QWebEnginePage) SetContent2(data []byte, mimeType string) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) mimeType_ms := C.struct_miqt_string{} mimeType_ms.data = C.CString(mimeType) @@ -1243,7 +1251,11 @@ func (this *QWebEnginePage) SetContent2(data []byte, mimeType string) { func (this *QWebEnginePage) SetContent3(data []byte, mimeType string, baseUrl *qt.QUrl) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) mimeType_ms := C.struct_miqt_string{} mimeType_ms.data = C.CString(mimeType) diff --git a/qt/webengine/gen_qwebengineprofile.go b/qt/webengine/gen_qwebengineprofile.go index dc7a75c5..c69f3eaf 100644 --- a/qt/webengine/gen_qwebengineprofile.go +++ b/qt/webengine/gen_qwebengineprofile.go @@ -262,21 +262,33 @@ func (this *QWebEngineProfile) Scripts() *QWebEngineScriptCollection { func (this *QWebEngineProfile) UrlSchemeHandler(param1 []byte) *QWebEngineUrlSchemeHandler { param1_alias := C.struct_miqt_string{} - param1_alias.data = (*C.char)(unsafe.Pointer(¶m1[0])) + if len(param1) > 0 { + param1_alias.data = (*C.char)(unsafe.Pointer(¶m1[0])) + } else { + param1_alias.data = (*C.char)(unsafe.Pointer(nil)) + } param1_alias.len = C.size_t(len(param1)) return newQWebEngineUrlSchemeHandler(C.QWebEngineProfile_UrlSchemeHandler(this.h, param1_alias)) } func (this *QWebEngineProfile) InstallUrlSchemeHandler(scheme []byte, param2 *QWebEngineUrlSchemeHandler) { scheme_alias := C.struct_miqt_string{} - scheme_alias.data = (*C.char)(unsafe.Pointer(&scheme[0])) + if len(scheme) > 0 { + scheme_alias.data = (*C.char)(unsafe.Pointer(&scheme[0])) + } else { + scheme_alias.data = (*C.char)(unsafe.Pointer(nil)) + } scheme_alias.len = C.size_t(len(scheme)) C.QWebEngineProfile_InstallUrlSchemeHandler(this.h, scheme_alias, param2.cPointer()) } func (this *QWebEngineProfile) RemoveUrlScheme(scheme []byte) { scheme_alias := C.struct_miqt_string{} - scheme_alias.data = (*C.char)(unsafe.Pointer(&scheme[0])) + if len(scheme) > 0 { + scheme_alias.data = (*C.char)(unsafe.Pointer(&scheme[0])) + } else { + scheme_alias.data = (*C.char)(unsafe.Pointer(nil)) + } scheme_alias.len = C.size_t(len(scheme)) C.QWebEngineProfile_RemoveUrlScheme(this.h, scheme_alias) } diff --git a/qt/webengine/gen_qwebengineurlrequestinfo.go b/qt/webengine/gen_qwebengineurlrequestinfo.go index f21ec5ce..da8e14c4 100644 --- a/qt/webengine/gen_qwebengineurlrequestinfo.go +++ b/qt/webengine/gen_qwebengineurlrequestinfo.go @@ -131,10 +131,18 @@ func (this *QWebEngineUrlRequestInfo) Redirect(url *qt.QUrl) { func (this *QWebEngineUrlRequestInfo) SetHttpHeader(name []byte, value []byte) { name_alias := C.struct_miqt_string{} - name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + if len(name) > 0 { + name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + } else { + name_alias.data = (*C.char)(unsafe.Pointer(nil)) + } name_alias.len = C.size_t(len(name)) value_alias := C.struct_miqt_string{} - value_alias.data = (*C.char)(unsafe.Pointer(&value[0])) + if len(value) > 0 { + value_alias.data = (*C.char)(unsafe.Pointer(&value[0])) + } else { + value_alias.data = (*C.char)(unsafe.Pointer(nil)) + } value_alias.len = C.size_t(len(value)) C.QWebEngineUrlRequestInfo_SetHttpHeader(this.h, name_alias, value_alias) } diff --git a/qt/webengine/gen_qwebengineurlrequestjob.go b/qt/webengine/gen_qwebengineurlrequestjob.go index a95b1951..6041f0c0 100644 --- a/qt/webengine/gen_qwebengineurlrequestjob.go +++ b/qt/webengine/gen_qwebengineurlrequestjob.go @@ -110,7 +110,11 @@ func (this *QWebEngineUrlRequestJob) Initiator() *qt.QUrl { func (this *QWebEngineUrlRequestJob) Reply(contentType []byte, device *qt.QIODevice) { contentType_alias := C.struct_miqt_string{} - contentType_alias.data = (*C.char)(unsafe.Pointer(&contentType[0])) + if len(contentType) > 0 { + contentType_alias.data = (*C.char)(unsafe.Pointer(&contentType[0])) + } else { + contentType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } contentType_alias.len = C.size_t(len(contentType)) C.QWebEngineUrlRequestJob_Reply(this.h, contentType_alias, (*C.QIODevice)(device.UnsafePointer())) } diff --git a/qt/webengine/gen_qwebengineurlscheme.go b/qt/webengine/gen_qwebengineurlscheme.go index 89d5bb1f..b8a84f00 100644 --- a/qt/webengine/gen_qwebengineurlscheme.go +++ b/qt/webengine/gen_qwebengineurlscheme.go @@ -82,7 +82,11 @@ func NewQWebEngineUrlScheme() *QWebEngineUrlScheme { // NewQWebEngineUrlScheme2 constructs a new QWebEngineUrlScheme object. func NewQWebEngineUrlScheme2(name []byte) *QWebEngineUrlScheme { name_alias := C.struct_miqt_string{} - name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + if len(name) > 0 { + name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + } else { + name_alias.data = (*C.char)(unsafe.Pointer(nil)) + } name_alias.len = C.size_t(len(name)) return newQWebEngineUrlScheme(C.QWebEngineUrlScheme_new2(name_alias)) @@ -115,7 +119,11 @@ func (this *QWebEngineUrlScheme) Name() []byte { func (this *QWebEngineUrlScheme) SetName(newValue []byte) { newValue_alias := C.struct_miqt_string{} - newValue_alias.data = (*C.char)(unsafe.Pointer(&newValue[0])) + if len(newValue) > 0 { + newValue_alias.data = (*C.char)(unsafe.Pointer(&newValue[0])) + } else { + newValue_alias.data = (*C.char)(unsafe.Pointer(nil)) + } newValue_alias.len = C.size_t(len(newValue)) C.QWebEngineUrlScheme_SetName(this.h, newValue_alias) } @@ -150,7 +158,11 @@ func QWebEngineUrlScheme_RegisterScheme(scheme *QWebEngineUrlScheme) { func QWebEngineUrlScheme_SchemeByName(name []byte) *QWebEngineUrlScheme { name_alias := C.struct_miqt_string{} - name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + if len(name) > 0 { + name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + } else { + name_alias.data = (*C.char)(unsafe.Pointer(nil)) + } name_alias.len = C.size_t(len(name)) _goptr := newQWebEngineUrlScheme(C.QWebEngineUrlScheme_SchemeByName(name_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer diff --git a/qt/webengine/gen_qwebengineview.go b/qt/webengine/gen_qwebengineview.go index 35158003..cec034b6 100644 --- a/qt/webengine/gen_qwebengineview.go +++ b/qt/webengine/gen_qwebengineview.go @@ -117,7 +117,11 @@ func (this *QWebEngineView) SetHtml(html string) { func (this *QWebEngineView) SetContent(data []byte) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) C.QWebEngineView_SetContent(this.h, data_alias) } @@ -453,7 +457,11 @@ func (this *QWebEngineView) SetHtml2(html string, baseUrl *qt.QUrl) { func (this *QWebEngineView) SetContent2(data []byte, mimeType string) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) mimeType_ms := C.struct_miqt_string{} mimeType_ms.data = C.CString(mimeType) @@ -464,7 +472,11 @@ func (this *QWebEngineView) SetContent2(data []byte, mimeType string) { func (this *QWebEngineView) SetContent3(data []byte, mimeType string, baseUrl *qt.QUrl) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) mimeType_ms := C.struct_miqt_string{} mimeType_ms.data = C.CString(mimeType) @@ -1350,7 +1362,11 @@ func miqt_exec_callback_QWebEngineView_ActionEvent(self *C.QWebEngineView, cb C. func (this *QWebEngineView) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QWebEngineView_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/webkit/gen_qgraphicswebview.go b/qt/webkit/gen_qgraphicswebview.go index 827766ec..b3d9ef80 100644 --- a/qt/webkit/gen_qgraphicswebview.go +++ b/qt/webkit/gen_qgraphicswebview.go @@ -153,7 +153,11 @@ func (this *QGraphicsWebView) SetHtml(html string) { func (this *QGraphicsWebView) SetContent(data []byte) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) C.QGraphicsWebView_SetContent(this.h, data_alias) } @@ -478,7 +482,11 @@ func (this *QGraphicsWebView) Load2(request *network.QNetworkRequest, operation func (this *QGraphicsWebView) Load3(request *network.QNetworkRequest, operation network.QNetworkAccessManager__Operation, body []byte) { body_alias := C.struct_miqt_string{} - body_alias.data = (*C.char)(unsafe.Pointer(&body[0])) + if len(body) > 0 { + body_alias.data = (*C.char)(unsafe.Pointer(&body[0])) + } else { + body_alias.data = (*C.char)(unsafe.Pointer(nil)) + } body_alias.len = C.size_t(len(body)) C.QGraphicsWebView_Load3(this.h, (*C.QNetworkRequest)(request.UnsafePointer()), (C.int)(operation), body_alias) } @@ -493,7 +501,11 @@ func (this *QGraphicsWebView) SetHtml2(html string, baseUrl *qt.QUrl) { func (this *QGraphicsWebView) SetContent2(data []byte, mimeType string) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) mimeType_ms := C.struct_miqt_string{} mimeType_ms.data = C.CString(mimeType) @@ -504,7 +516,11 @@ func (this *QGraphicsWebView) SetContent2(data []byte, mimeType string) { func (this *QGraphicsWebView) SetContent3(data []byte, mimeType string, baseUrl *qt.QUrl) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) mimeType_ms := C.struct_miqt_string{} mimeType_ms.data = C.CString(mimeType) diff --git a/qt/webkit/gen_qwebframe.go b/qt/webkit/gen_qwebframe.go index 6f0b1c1e..58fc73eb 100644 --- a/qt/webkit/gen_qwebframe.go +++ b/qt/webkit/gen_qwebframe.go @@ -290,7 +290,11 @@ func (this *QWebFrame) SetHtml(html string) { func (this *QWebFrame) SetContent(data []byte) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) C.QWebFrame_SetContent(this.h, data_alias) } @@ -776,7 +780,11 @@ func (this *QWebFrame) Load2(request *network.QNetworkRequest, operation network func (this *QWebFrame) Load3(request *network.QNetworkRequest, operation network.QNetworkAccessManager__Operation, body []byte) { body_alias := C.struct_miqt_string{} - body_alias.data = (*C.char)(unsafe.Pointer(&body[0])) + if len(body) > 0 { + body_alias.data = (*C.char)(unsafe.Pointer(&body[0])) + } else { + body_alias.data = (*C.char)(unsafe.Pointer(nil)) + } body_alias.len = C.size_t(len(body)) C.QWebFrame_Load3(this.h, (*C.QNetworkRequest)(request.UnsafePointer()), (C.int)(operation), body_alias) } @@ -791,7 +799,11 @@ func (this *QWebFrame) SetHtml2(html string, baseUrl *qt.QUrl) { func (this *QWebFrame) SetContent2(data []byte, mimeType string) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) mimeType_ms := C.struct_miqt_string{} mimeType_ms.data = C.CString(mimeType) @@ -802,7 +814,11 @@ func (this *QWebFrame) SetContent2(data []byte, mimeType string) { func (this *QWebFrame) SetContent3(data []byte, mimeType string, baseUrl *qt.QUrl) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) mimeType_ms := C.struct_miqt_string{} mimeType_ms.data = C.CString(mimeType) diff --git a/qt/webkit/gen_qwebinspector.go b/qt/webkit/gen_qwebinspector.go index 66d08913..5b2eb980 100644 --- a/qt/webkit/gen_qwebinspector.go +++ b/qt/webkit/gen_qwebinspector.go @@ -990,7 +990,11 @@ func miqt_exec_callback_QWebInspector_DropEvent(self *C.QWebInspector, cb C.intp func (this *QWebInspector) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QWebInspector_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt/webkit/gen_qwebview.go b/qt/webkit/gen_qwebview.go index ec26c815..8822b232 100644 --- a/qt/webkit/gen_qwebview.go +++ b/qt/webkit/gen_qwebview.go @@ -119,7 +119,11 @@ func (this *QWebView) SetHtml(html string) { func (this *QWebView) SetContent(data []byte) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) C.QWebView_SetContent(this.h, data_alias) } @@ -492,7 +496,11 @@ func (this *QWebView) Load2(request *network.QNetworkRequest, operation network. func (this *QWebView) Load3(request *network.QNetworkRequest, operation network.QNetworkAccessManager__Operation, body []byte) { body_alias := C.struct_miqt_string{} - body_alias.data = (*C.char)(unsafe.Pointer(&body[0])) + if len(body) > 0 { + body_alias.data = (*C.char)(unsafe.Pointer(&body[0])) + } else { + body_alias.data = (*C.char)(unsafe.Pointer(nil)) + } body_alias.len = C.size_t(len(body)) C.QWebView_Load3(this.h, (*C.QNetworkRequest)(request.UnsafePointer()), (C.int)(operation), body_alias) } @@ -507,7 +515,11 @@ func (this *QWebView) SetHtml2(html string, baseUrl *qt.QUrl) { func (this *QWebView) SetContent2(data []byte, mimeType string) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) mimeType_ms := C.struct_miqt_string{} mimeType_ms.data = C.CString(mimeType) @@ -518,7 +530,11 @@ func (this *QWebView) SetContent2(data []byte, mimeType string) { func (this *QWebView) SetContent3(data []byte, mimeType string, baseUrl *qt.QUrl) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) mimeType_ms := C.struct_miqt_string{} mimeType_ms.data = C.CString(mimeType) @@ -1518,7 +1534,11 @@ func miqt_exec_callback_QWebView_HideEvent(self *C.QWebView, cb C.intptr_t, even func (this *QWebView) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *int64) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QWebView_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.long)(unsafe.Pointer(result)))) diff --git a/qt6/cbor/gen_qcborstreamreader.go b/qt6/cbor/gen_qcborstreamreader.go index 24e526d3..0632d175 100644 --- a/qt6/cbor/gen_qcborstreamreader.go +++ b/qt6/cbor/gen_qcborstreamreader.go @@ -97,7 +97,11 @@ func NewQCborStreamReader3(data *byte, lenVal int64) *QCborStreamReader { // NewQCborStreamReader4 constructs a new QCborStreamReader object. func NewQCborStreamReader4(data []byte) *QCborStreamReader { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return newQCborStreamReader(C.QCborStreamReader_new4(data_alias)) @@ -119,7 +123,11 @@ func (this *QCborStreamReader) Device() *qt6.QIODevice { func (this *QCborStreamReader) AddData(data []byte) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) C.QCborStreamReader_AddData(this.h, data_alias) } diff --git a/qt6/cbor/gen_qcborstreamwriter.go b/qt6/cbor/gen_qcborstreamwriter.go index 2fb66b34..3af6aa64 100644 --- a/qt6/cbor/gen_qcborstreamwriter.go +++ b/qt6/cbor/gen_qcborstreamwriter.go @@ -74,7 +74,11 @@ func (this *QCborStreamWriter) AppendWithQCborNegativeInteger(n QCborNegativeInt func (this *QCborStreamWriter) AppendWithBa(ba []byte) { ba_alias := C.struct_miqt_string{} - ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + if len(ba) > 0 { + ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + } else { + ba_alias.data = (*C.char)(unsafe.Pointer(nil)) + } ba_alias.len = C.size_t(len(ba)) C.QCborStreamWriter_AppendWithBa(this.h, ba_alias) } diff --git a/qt6/cbor/gen_qcborvalue.go b/qt6/cbor/gen_qcborvalue.go index 37d83e89..d6a11a2a 100644 --- a/qt6/cbor/gen_qcborvalue.go +++ b/qt6/cbor/gen_qcborvalue.go @@ -190,7 +190,11 @@ func NewQCborValue8(st QCborSimpleType) *QCborValue { // NewQCborValue9 constructs a new QCborValue object. func NewQCborValue9(ba []byte) *QCborValue { ba_alias := C.struct_miqt_string{} - ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + if len(ba) > 0 { + ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + } else { + ba_alias.data = (*C.char)(unsafe.Pointer(nil)) + } ba_alias.len = C.size_t(len(ba)) return newQCborValue(C.QCborValue_new9(ba_alias)) @@ -540,7 +544,11 @@ func QCborValue_FromCbor(reader *QCborStreamReader) *QCborValue { func QCborValue_FromCborWithBa(ba []byte) *QCborValue { ba_alias := C.struct_miqt_string{} - ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + if len(ba) > 0 { + ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + } else { + ba_alias.data = (*C.char)(unsafe.Pointer(nil)) + } ba_alias.len = C.size_t(len(ba)) _goptr := newQCborValue(C.QCborValue_FromCborWithBa(ba_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer @@ -607,7 +615,11 @@ func (this *QCborValue) TaggedValue1(defaultValue *QCborValue) *QCborValue { func (this *QCborValue) ToByteArray1(defaultValue []byte) []byte { defaultValue_alias := C.struct_miqt_string{} - defaultValue_alias.data = (*C.char)(unsafe.Pointer(&defaultValue[0])) + if len(defaultValue) > 0 { + defaultValue_alias.data = (*C.char)(unsafe.Pointer(&defaultValue[0])) + } else { + defaultValue_alias.data = (*C.char)(unsafe.Pointer(nil)) + } defaultValue_alias.len = C.size_t(len(defaultValue)) var _bytearray C.struct_miqt_string = C.QCborValue_ToByteArray1(this.h, defaultValue_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) @@ -652,7 +664,11 @@ func (this *QCborValue) ToUuid1(defaultValue *qt6.QUuid) *qt6.QUuid { func QCborValue_FromCbor22(ba []byte, error *QCborParserError) *QCborValue { ba_alias := C.struct_miqt_string{} - ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + if len(ba) > 0 { + ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0])) + } else { + ba_alias.data = (*C.char)(unsafe.Pointer(nil)) + } ba_alias.len = C.size_t(len(ba)) _goptr := newQCborValue(C.QCborValue_FromCbor22(ba_alias, error.cPointer())) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer @@ -1011,7 +1027,11 @@ func (this *QCborValueConstRef) ToDouble1(defaultValue float64) float64 { func (this *QCborValueConstRef) ToByteArray1(defaultValue []byte) []byte { defaultValue_alias := C.struct_miqt_string{} - defaultValue_alias.data = (*C.char)(unsafe.Pointer(&defaultValue[0])) + if len(defaultValue) > 0 { + defaultValue_alias.data = (*C.char)(unsafe.Pointer(&defaultValue[0])) + } else { + defaultValue_alias.data = (*C.char)(unsafe.Pointer(nil)) + } defaultValue_alias.len = C.size_t(len(defaultValue)) var _bytearray C.struct_miqt_string = C.QCborValueConstRef_ToByteArray1(this.h, defaultValue_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) @@ -1420,7 +1440,11 @@ func (this *QCborValueRef) ToDouble1(defaultValue float64) float64 { func (this *QCborValueRef) ToByteArray1(defaultValue []byte) []byte { defaultValue_alias := C.struct_miqt_string{} - defaultValue_alias.data = (*C.char)(unsafe.Pointer(&defaultValue[0])) + if len(defaultValue) > 0 { + defaultValue_alias.data = (*C.char)(unsafe.Pointer(&defaultValue[0])) + } else { + defaultValue_alias.data = (*C.char)(unsafe.Pointer(nil)) + } defaultValue_alias.len = C.size_t(len(defaultValue)) var _bytearray C.struct_miqt_string = C.QCborValueRef_ToByteArray1(this.h, defaultValue_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) diff --git a/qt6/gen_qabstractbutton.go b/qt6/gen_qabstractbutton.go index f8942ae6..ed969223 100644 --- a/qt6/gen_qabstractbutton.go +++ b/qt6/gen_qabstractbutton.go @@ -1269,7 +1269,11 @@ func miqt_exec_callback_QAbstractButton_HideEvent(self *C.QAbstractButton, cb C. func (this *QAbstractButton) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QAbstractButton_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qabstracteventdispatcher.go b/qt6/gen_qabstracteventdispatcher.go index af5fe871..8ba32ae4 100644 --- a/qt6/gen_qabstracteventdispatcher.go +++ b/qt6/gen_qabstracteventdispatcher.go @@ -143,7 +143,11 @@ func (this *QAbstractEventDispatcher) RemoveNativeEventFilter(filterObj *QAbstra func (this *QAbstractEventDispatcher) FilterNativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QAbstractEventDispatcher_FilterNativeEvent(this.h, eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) } diff --git a/qt6/gen_qabstractitemmodel.go b/qt6/gen_qabstractitemmodel.go index 7006ba7c..3e4ffd74 100644 --- a/qt6/gen_qabstractitemmodel.go +++ b/qt6/gen_qabstractitemmodel.go @@ -2224,7 +2224,11 @@ func miqt_exec_callback_QAbstractItemModel_RoleNames(self *C.QAbstractItemModel, for virtualReturn_k, virtualReturn_v := range virtualReturn { virtualReturn_Keys_CArray[virtualReturn_ctr] = (C.int)(virtualReturn_k) virtualReturn_v_alias := C.struct_miqt_string{} - virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + if len(virtualReturn_v) > 0 { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + } else { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_v_alias.len = C.size_t(len(virtualReturn_v)) virtualReturn_Values_CArray[virtualReturn_ctr] = virtualReturn_v_alias virtualReturn_ctr++ @@ -3698,7 +3702,11 @@ func miqt_exec_callback_QAbstractTableModel_RoleNames(self *C.QAbstractTableMode for virtualReturn_k, virtualReturn_v := range virtualReturn { virtualReturn_Keys_CArray[virtualReturn_ctr] = (C.int)(virtualReturn_k) virtualReturn_v_alias := C.struct_miqt_string{} - virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + if len(virtualReturn_v) > 0 { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + } else { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_v_alias.len = C.size_t(len(virtualReturn_v)) virtualReturn_Values_CArray[virtualReturn_ctr] = virtualReturn_v_alias virtualReturn_ctr++ @@ -5150,7 +5158,11 @@ func miqt_exec_callback_QAbstractListModel_RoleNames(self *C.QAbstractListModel, for virtualReturn_k, virtualReturn_v := range virtualReturn { virtualReturn_Keys_CArray[virtualReturn_ctr] = (C.int)(virtualReturn_k) virtualReturn_v_alias := C.struct_miqt_string{} - virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + if len(virtualReturn_v) > 0 { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + } else { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_v_alias.len = C.size_t(len(virtualReturn_v)) virtualReturn_Values_CArray[virtualReturn_ctr] = virtualReturn_v_alias virtualReturn_ctr++ diff --git a/qt6/gen_qabstractitemview.go b/qt6/gen_qabstractitemview.go index 2f9e1ea7..40474aad 100644 --- a/qt6/gen_qabstractitemview.go +++ b/qt6/gen_qabstractitemview.go @@ -2794,7 +2794,11 @@ func miqt_exec_callback_QAbstractItemView_HideEvent(self *C.QAbstractItemView, c func (this *QAbstractItemView) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QAbstractItemView_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qabstractnativeeventfilter.go b/qt6/gen_qabstractnativeeventfilter.go index 9778c7d8..641e0ae3 100644 --- a/qt6/gen_qabstractnativeeventfilter.go +++ b/qt6/gen_qabstractnativeeventfilter.go @@ -54,7 +54,11 @@ func NewQAbstractNativeEventFilter() *QAbstractNativeEventFilter { func (this *QAbstractNativeEventFilter) NativeEventFilter(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QAbstractNativeEventFilter_NativeEventFilter(this.h, eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) } diff --git a/qt6/gen_qabstractproxymodel.go b/qt6/gen_qabstractproxymodel.go index c34168fe..8e49448a 100644 --- a/qt6/gen_qabstractproxymodel.go +++ b/qt6/gen_qabstractproxymodel.go @@ -1230,7 +1230,11 @@ func miqt_exec_callback_QAbstractProxyModel_RoleNames(self *C.QAbstractProxyMode for virtualReturn_k, virtualReturn_v := range virtualReturn { virtualReturn_Keys_CArray[virtualReturn_ctr] = (C.int)(virtualReturn_k) virtualReturn_v_alias := C.struct_miqt_string{} - virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + if len(virtualReturn_v) > 0 { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + } else { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_v_alias.len = C.size_t(len(virtualReturn_v)) virtualReturn_Values_CArray[virtualReturn_ctr] = virtualReturn_v_alias virtualReturn_ctr++ diff --git a/qt6/gen_qabstractscrollarea.go b/qt6/gen_qabstractscrollarea.go index 10a9a463..60e89f64 100644 --- a/qt6/gen_qabstractscrollarea.go +++ b/qt6/gen_qabstractscrollarea.go @@ -1231,7 +1231,11 @@ func miqt_exec_callback_QAbstractScrollArea_HideEvent(self *C.QAbstractScrollAre func (this *QAbstractScrollArea) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QAbstractScrollArea_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qabstractslider.go b/qt6/gen_qabstractslider.go index b90cc2db..e78f1190 100644 --- a/qt6/gen_qabstractslider.go +++ b/qt6/gen_qabstractslider.go @@ -1252,7 +1252,11 @@ func miqt_exec_callback_QAbstractSlider_HideEvent(self *C.QAbstractSlider, cb C. func (this *QAbstractSlider) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QAbstractSlider_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qabstractspinbox.go b/qt6/gen_qabstractspinbox.go index 1a0909d0..f590a9c0 100644 --- a/qt6/gen_qabstractspinbox.go +++ b/qt6/gen_qabstractspinbox.go @@ -1398,7 +1398,11 @@ func miqt_exec_callback_QAbstractSpinBox_DropEvent(self *C.QAbstractSpinBox, cb func (this *QAbstractSpinBox) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QAbstractSpinBox_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qanystringview.go b/qt6/gen_qanystringview.go index ee359418..bf33a1de 100644 --- a/qt6/gen_qanystringview.go +++ b/qt6/gen_qanystringview.go @@ -54,7 +54,11 @@ func NewQAnyStringView() *QAnyStringView { // NewQAnyStringView2 constructs a new QAnyStringView object. func NewQAnyStringView2(str []byte) *QAnyStringView { str_alias := C.struct_miqt_string{} - str_alias.data = (*C.char)(unsafe.Pointer(&str[0])) + if len(str) > 0 { + str_alias.data = (*C.char)(unsafe.Pointer(&str[0])) + } else { + str_alias.data = (*C.char)(unsafe.Pointer(nil)) + } str_alias.len = C.size_t(len(str)) return newQAnyStringView(C.QAnyStringView_new2(str_alias)) diff --git a/qt6/gen_qbuffer.go b/qt6/gen_qbuffer.go index a47be49f..b53791b9 100644 --- a/qt6/gen_qbuffer.go +++ b/qt6/gen_qbuffer.go @@ -97,7 +97,11 @@ func (this *QBuffer) Buffer2() []byte { func (this *QBuffer) SetData(data []byte) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) C.QBuffer_SetData(this.h, data_alias) } diff --git a/qt6/gen_qbytearraymatcher.go b/qt6/gen_qbytearraymatcher.go index be3953df..da3ed19f 100644 --- a/qt6/gen_qbytearraymatcher.go +++ b/qt6/gen_qbytearraymatcher.go @@ -54,7 +54,11 @@ func NewQByteArrayMatcher() *QByteArrayMatcher { // NewQByteArrayMatcher2 constructs a new QByteArrayMatcher object. func NewQByteArrayMatcher2(pattern []byte) *QByteArrayMatcher { pattern_alias := C.struct_miqt_string{} - pattern_alias.data = (*C.char)(unsafe.Pointer(&pattern[0])) + if len(pattern) > 0 { + pattern_alias.data = (*C.char)(unsafe.Pointer(&pattern[0])) + } else { + pattern_alias.data = (*C.char)(unsafe.Pointer(nil)) + } pattern_alias.len = C.size_t(len(pattern)) return newQByteArrayMatcher(C.QByteArrayMatcher_new2(pattern_alias)) @@ -94,7 +98,11 @@ func (this *QByteArrayMatcher) OperatorAssign(other *QByteArrayMatcher) { func (this *QByteArrayMatcher) SetPattern(pattern []byte) { pattern_alias := C.struct_miqt_string{} - pattern_alias.data = (*C.char)(unsafe.Pointer(&pattern[0])) + if len(pattern) > 0 { + pattern_alias.data = (*C.char)(unsafe.Pointer(&pattern[0])) + } else { + pattern_alias.data = (*C.char)(unsafe.Pointer(nil)) + } pattern_alias.len = C.size_t(len(pattern)) C.QByteArrayMatcher_SetPattern(this.h, pattern_alias) } diff --git a/qt6/gen_qcalendarwidget.go b/qt6/gen_qcalendarwidget.go index f1da3b8a..60f121b4 100644 --- a/qt6/gen_qcalendarwidget.go +++ b/qt6/gen_qcalendarwidget.go @@ -1313,7 +1313,11 @@ func miqt_exec_callback_QCalendarWidget_HideEvent(self *C.QCalendarWidget, cb C. func (this *QCalendarWidget) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QCalendarWidget_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qcheckbox.go b/qt6/gen_qcheckbox.go index 53a1b9ae..031be4b2 100644 --- a/qt6/gen_qcheckbox.go +++ b/qt6/gen_qcheckbox.go @@ -1164,7 +1164,11 @@ func miqt_exec_callback_QCheckBox_HideEvent(self *C.QCheckBox, cb C.intptr_t, ev func (this *QCheckBox) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QCheckBox_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qcolordialog.go b/qt6/gen_qcolordialog.go index 966588aa..39da5cb0 100644 --- a/qt6/gen_qcolordialog.go +++ b/qt6/gen_qcolordialog.go @@ -1278,7 +1278,11 @@ func miqt_exec_callback_QColorDialog_HideEvent(self *C.QColorDialog, cb C.intptr func (this *QColorDialog) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QColorDialog_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qcolorspace.go b/qt6/gen_qcolorspace.go index 4c8b58ea..64a994f0 100644 --- a/qt6/gen_qcolorspace.go +++ b/qt6/gen_qcolorspace.go @@ -302,7 +302,11 @@ func (this *QColorSpace) IsValid() bool { func QColorSpace_FromIccProfile(iccProfile []byte) *QColorSpace { iccProfile_alias := C.struct_miqt_string{} - iccProfile_alias.data = (*C.char)(unsafe.Pointer(&iccProfile[0])) + if len(iccProfile) > 0 { + iccProfile_alias.data = (*C.char)(unsafe.Pointer(&iccProfile[0])) + } else { + iccProfile_alias.data = (*C.char)(unsafe.Pointer(nil)) + } iccProfile_alias.len = C.size_t(len(iccProfile)) _goptr := newQColorSpace(C.QColorSpace_FromIccProfile(iccProfile_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer diff --git a/qt6/gen_qcolumnview.go b/qt6/gen_qcolumnview.go index fe45b671..367e75ee 100644 --- a/qt6/gen_qcolumnview.go +++ b/qt6/gen_qcolumnview.go @@ -2447,7 +2447,11 @@ func miqt_exec_callback_QColumnView_HideEvent(self *C.QColumnView, cb C.intptr_t func (this *QColumnView) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QColumnView_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qcombobox.go b/qt6/gen_qcombobox.go index 7b437a5a..f69971ab 100644 --- a/qt6/gen_qcombobox.go +++ b/qt6/gen_qcombobox.go @@ -1727,7 +1727,11 @@ func miqt_exec_callback_QComboBox_DropEvent(self *C.QComboBox, cb C.intptr_t, ev func (this *QComboBox) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QComboBox_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qcommandlinkbutton.go b/qt6/gen_qcommandlinkbutton.go index 5024e35d..3f1c46a3 100644 --- a/qt6/gen_qcommandlinkbutton.go +++ b/qt6/gen_qcommandlinkbutton.go @@ -1175,7 +1175,11 @@ func miqt_exec_callback_QCommandLinkButton_HideEvent(self *C.QCommandLinkButton, func (this *QCommandLinkButton) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QCommandLinkButton_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qconcatenatetablesproxymodel.go b/qt6/gen_qconcatenatetablesproxymodel.go index 3baa0055..d5863712 100644 --- a/qt6/gen_qconcatenatetablesproxymodel.go +++ b/qt6/gen_qconcatenatetablesproxymodel.go @@ -1371,7 +1371,11 @@ func miqt_exec_callback_QConcatenateTablesProxyModel_RoleNames(self *C.QConcaten for virtualReturn_k, virtualReturn_v := range virtualReturn { virtualReturn_Keys_CArray[virtualReturn_ctr] = (C.int)(virtualReturn_k) virtualReturn_v_alias := C.struct_miqt_string{} - virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + if len(virtualReturn_v) > 0 { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + } else { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_v_alias.len = C.size_t(len(virtualReturn_v)) virtualReturn_Values_CArray[virtualReturn_ctr] = virtualReturn_v_alias virtualReturn_ctr++ diff --git a/qt6/gen_qcoreevent.go b/qt6/gen_qcoreevent.go index db473286..89ebe544 100644 --- a/qt6/gen_qcoreevent.go +++ b/qt6/gen_qcoreevent.go @@ -624,7 +624,11 @@ func UnsafeNewQDynamicPropertyChangeEvent(h unsafe.Pointer) *QDynamicPropertyCha // NewQDynamicPropertyChangeEvent constructs a new QDynamicPropertyChangeEvent object. func NewQDynamicPropertyChangeEvent(name []byte) *QDynamicPropertyChangeEvent { name_alias := C.struct_miqt_string{} - name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + if len(name) > 0 { + name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + } else { + name_alias.data = (*C.char)(unsafe.Pointer(nil)) + } name_alias.len = C.size_t(len(name)) return newQDynamicPropertyChangeEvent(C.QDynamicPropertyChangeEvent_new(name_alias)) diff --git a/qt6/gen_qdatastream.go b/qt6/gen_qdatastream.go index a7c30cc4..46bbec10 100644 --- a/qt6/gen_qdatastream.go +++ b/qt6/gen_qdatastream.go @@ -130,7 +130,11 @@ func NewQDataStream2(param1 *QIODevice) *QDataStream { // NewQDataStream3 constructs a new QDataStream object. func NewQDataStream3(param1 []byte) *QDataStream { param1_alias := C.struct_miqt_string{} - param1_alias.data = (*C.char)(unsafe.Pointer(¶m1[0])) + if len(param1) > 0 { + param1_alias.data = (*C.char)(unsafe.Pointer(¶m1[0])) + } else { + param1_alias.data = (*C.char)(unsafe.Pointer(nil)) + } param1_alias.len = C.size_t(len(param1)) return newQDataStream(C.QDataStream_new3(param1_alias)) diff --git a/qt6/gen_qdatawidgetmapper.go b/qt6/gen_qdatawidgetmapper.go index 0ce1ca41..af330a82 100644 --- a/qt6/gen_qdatawidgetmapper.go +++ b/qt6/gen_qdatawidgetmapper.go @@ -136,7 +136,11 @@ func (this *QDataWidgetMapper) AddMapping(widget *QWidget, section int) { func (this *QDataWidgetMapper) AddMapping2(widget *QWidget, section int, propertyName []byte) { propertyName_alias := C.struct_miqt_string{} - propertyName_alias.data = (*C.char)(unsafe.Pointer(&propertyName[0])) + if len(propertyName) > 0 { + propertyName_alias.data = (*C.char)(unsafe.Pointer(&propertyName[0])) + } else { + propertyName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } propertyName_alias.len = C.size_t(len(propertyName)) C.QDataWidgetMapper_AddMapping2(this.h, widget.cPointer(), (C.int)(section), propertyName_alias) } diff --git a/qt6/gen_qdatetimeedit.go b/qt6/gen_qdatetimeedit.go index 9030526e..b0dac86e 100644 --- a/qt6/gen_qdatetimeedit.go +++ b/qt6/gen_qdatetimeedit.go @@ -1638,7 +1638,11 @@ func miqt_exec_callback_QDateTimeEdit_DropEvent(self *C.QDateTimeEdit, cb C.intp func (this *QDateTimeEdit) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QDateTimeEdit_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) @@ -3264,7 +3268,11 @@ func miqt_exec_callback_QTimeEdit_DropEvent(self *C.QTimeEdit, cb C.intptr_t, ev func (this *QTimeEdit) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QTimeEdit_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) @@ -4890,7 +4898,11 @@ func miqt_exec_callback_QDateEdit_DropEvent(self *C.QDateEdit, cb C.intptr_t, ev func (this *QDateEdit) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QDateEdit_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qdebug.go b/qt6/gen_qdebug.go index aefe63dd..b722f4b6 100644 --- a/qt6/gen_qdebug.go +++ b/qt6/gen_qdebug.go @@ -193,7 +193,11 @@ func (this *QDebug) OperatorShiftLeftWithQString(t string) *QDebug { func (this *QDebug) OperatorShiftLeftWithQByteArray(t []byte) *QDebug { t_alias := C.struct_miqt_string{} - t_alias.data = (*C.char)(unsafe.Pointer(&t[0])) + if len(t) > 0 { + t_alias.data = (*C.char)(unsafe.Pointer(&t[0])) + } else { + t_alias.data = (*C.char)(unsafe.Pointer(nil)) + } t_alias.len = C.size_t(len(t)) return newQDebug(C.QDebug_OperatorShiftLeftWithQByteArray(this.h, t_alias)) } diff --git a/qt6/gen_qdial.go b/qt6/gen_qdial.go index f22f87ce..0ec1d7bf 100644 --- a/qt6/gen_qdial.go +++ b/qt6/gen_qdial.go @@ -1084,7 +1084,11 @@ func miqt_exec_callback_QDial_HideEvent(self *C.QDial, cb C.intptr_t, event *C.Q func (this *QDial) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QDial_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qdialog.go b/qt6/gen_qdialog.go index 462c9c5c..f63bb0a1 100644 --- a/qt6/gen_qdialog.go +++ b/qt6/gen_qdialog.go @@ -1213,7 +1213,11 @@ func miqt_exec_callback_QDialog_HideEvent(self *C.QDialog, cb C.intptr_t, event func (this *QDialog) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QDialog_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qdialogbuttonbox.go b/qt6/gen_qdialogbuttonbox.go index 2dac3120..86254513 100644 --- a/qt6/gen_qdialogbuttonbox.go +++ b/qt6/gen_qdialogbuttonbox.go @@ -1195,7 +1195,11 @@ func miqt_exec_callback_QDialogButtonBox_HideEvent(self *C.QDialogButtonBox, cb func (this *QDialogButtonBox) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QDialogButtonBox_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qdockwidget.go b/qt6/gen_qdockwidget.go index 1215b6d5..b1ad0395 100644 --- a/qt6/gen_qdockwidget.go +++ b/qt6/gen_qdockwidget.go @@ -1188,7 +1188,11 @@ func miqt_exec_callback_QDockWidget_HideEvent(self *C.QDockWidget, cb C.intptr_t func (this *QDockWidget) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QDockWidget_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qerrormessage.go b/qt6/gen_qerrormessage.go index dfdbd3c0..19caed8f 100644 --- a/qt6/gen_qerrormessage.go +++ b/qt6/gen_qerrormessage.go @@ -1140,7 +1140,11 @@ func miqt_exec_callback_QErrorMessage_HideEvent(self *C.QErrorMessage, cb C.intp func (this *QErrorMessage) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QErrorMessage_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qfile.go b/qt6/gen_qfile.go index ab0db396..e22fa01c 100644 --- a/qt6/gen_qfile.go +++ b/qt6/gen_qfile.go @@ -129,7 +129,11 @@ func QFile_EncodeName(fileName string) []byte { func QFile_DecodeName(localFileName []byte) string { localFileName_alias := C.struct_miqt_string{} - localFileName_alias.data = (*C.char)(unsafe.Pointer(&localFileName[0])) + if len(localFileName) > 0 { + localFileName_alias.data = (*C.char)(unsafe.Pointer(&localFileName[0])) + } else { + localFileName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } localFileName_alias.len = C.size_t(len(localFileName)) var _ms C.struct_miqt_string = C.QFile_DecodeName(localFileName_alias) _ret := C.GoStringN(_ms.data, C.int(int64(_ms.len))) diff --git a/qt6/gen_qfiledialog.go b/qt6/gen_qfiledialog.go index c5791837..aa45e5a0 100644 --- a/qt6/gen_qfiledialog.go +++ b/qt6/gen_qfiledialog.go @@ -394,7 +394,11 @@ func (this *QFileDialog) SaveState() []byte { func (this *QFileDialog) RestoreState(state []byte) bool { state_alias := C.struct_miqt_string{} - state_alias.data = (*C.char)(unsafe.Pointer(&state[0])) + if len(state) > 0 { + state_alias.data = (*C.char)(unsafe.Pointer(&state[0])) + } else { + state_alias.data = (*C.char)(unsafe.Pointer(nil)) + } state_alias.len = C.size_t(len(state)) return (bool)(C.QFileDialog_RestoreState(this.h, state_alias)) } @@ -834,7 +838,11 @@ func QFileDialog_GetOpenFileUrls() []QUrl { func QFileDialog_SaveFileContent(fileContent []byte, fileNameHint string) { fileContent_alias := C.struct_miqt_string{} - fileContent_alias.data = (*C.char)(unsafe.Pointer(&fileContent[0])) + if len(fileContent) > 0 { + fileContent_alias.data = (*C.char)(unsafe.Pointer(&fileContent[0])) + } else { + fileContent_alias.data = (*C.char)(unsafe.Pointer(nil)) + } fileContent_alias.len = C.size_t(len(fileContent)) fileNameHint_ms := C.struct_miqt_string{} fileNameHint_ms.data = C.CString(fileNameHint) @@ -2310,7 +2318,11 @@ func miqt_exec_callback_QFileDialog_HideEvent(self *C.QFileDialog, cb C.intptr_t func (this *QFileDialog) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QFileDialog_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qfilesystemmodel.go b/qt6/gen_qfilesystemmodel.go index 828bb76b..a4bafca9 100644 --- a/qt6/gen_qfilesystemmodel.go +++ b/qt6/gen_qfilesystemmodel.go @@ -1116,7 +1116,11 @@ func miqt_exec_callback_QFileSystemModel_RoleNames(self *C.QFileSystemModel, cb for virtualReturn_k, virtualReturn_v := range virtualReturn { virtualReturn_Keys_CArray[virtualReturn_ctr] = (C.int)(virtualReturn_k) virtualReturn_v_alias := C.struct_miqt_string{} - virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + if len(virtualReturn_v) > 0 { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + } else { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_v_alias.len = C.size_t(len(virtualReturn_v)) virtualReturn_Values_CArray[virtualReturn_ctr] = virtualReturn_v_alias virtualReturn_ctr++ diff --git a/qt6/gen_qfocusframe.go b/qt6/gen_qfocusframe.go index ed9260a4..b38becdf 100644 --- a/qt6/gen_qfocusframe.go +++ b/qt6/gen_qfocusframe.go @@ -1004,7 +1004,11 @@ func miqt_exec_callback_QFocusFrame_HideEvent(self *C.QFocusFrame, cb C.intptr_t func (this *QFocusFrame) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QFocusFrame_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qfontcombobox.go b/qt6/gen_qfontcombobox.go index b33e3bae..908aa9ab 100644 --- a/qt6/gen_qfontcombobox.go +++ b/qt6/gen_qfontcombobox.go @@ -1228,7 +1228,11 @@ func miqt_exec_callback_QFontComboBox_DropEvent(self *C.QFontComboBox, cb C.intp func (this *QFontComboBox) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QFontComboBox_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qfontdatabase.go b/qt6/gen_qfontdatabase.go index df1db146..a63f63e6 100644 --- a/qt6/gen_qfontdatabase.go +++ b/qt6/gen_qfontdatabase.go @@ -333,7 +333,11 @@ func QFontDatabase_AddApplicationFont(fileName string) int { func QFontDatabase_AddApplicationFontFromData(fontData []byte) int { fontData_alias := C.struct_miqt_string{} - fontData_alias.data = (*C.char)(unsafe.Pointer(&fontData[0])) + if len(fontData) > 0 { + fontData_alias.data = (*C.char)(unsafe.Pointer(&fontData[0])) + } else { + fontData_alias.data = (*C.char)(unsafe.Pointer(nil)) + } fontData_alias.len = C.size_t(len(fontData)) return (int)(C.QFontDatabase_AddApplicationFontFromData(fontData_alias)) } diff --git a/qt6/gen_qfontdialog.go b/qt6/gen_qfontdialog.go index 1fe69b1a..06a63759 100644 --- a/qt6/gen_qfontdialog.go +++ b/qt6/gen_qfontdialog.go @@ -1263,7 +1263,11 @@ func miqt_exec_callback_QFontDialog_HideEvent(self *C.QFontDialog, cb C.intptr_t func (this *QFontDialog) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QFontDialog_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qframe.go b/qt6/gen_qframe.go index 5e522bef..b46ee353 100644 --- a/qt6/gen_qframe.go +++ b/qt6/gen_qframe.go @@ -1085,7 +1085,11 @@ func miqt_exec_callback_QFrame_HideEvent(self *C.QFrame, cb C.intptr_t, event *C func (this *QFrame) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QFrame_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qgraphicsview.go b/qt6/gen_qgraphicsview.go index 66dbb28b..520349df 100644 --- a/qt6/gen_qgraphicsview.go +++ b/qt6/gen_qgraphicsview.go @@ -1806,7 +1806,11 @@ func miqt_exec_callback_QGraphicsView_HideEvent(self *C.QGraphicsView, cb C.intp func (this *QGraphicsView) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QGraphicsView_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qgroupbox.go b/qt6/gen_qgroupbox.go index a06e04bf..97e3d311 100644 --- a/qt6/gen_qgroupbox.go +++ b/qt6/gen_qgroupbox.go @@ -1148,7 +1148,11 @@ func miqt_exec_callback_QGroupBox_HideEvent(self *C.QGroupBox, cb C.intptr_t, ev func (this *QGroupBox) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QGroupBox_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qheaderview.go b/qt6/gen_qheaderview.go index c61c34a5..b4d600d7 100644 --- a/qt6/gen_qheaderview.go +++ b/qt6/gen_qheaderview.go @@ -354,7 +354,11 @@ func (this *QHeaderView) SaveState() []byte { func (this *QHeaderView) RestoreState(state []byte) bool { state_alias := C.struct_miqt_string{} - state_alias.data = (*C.char)(unsafe.Pointer(&state[0])) + if len(state) > 0 { + state_alias.data = (*C.char)(unsafe.Pointer(&state[0])) + } else { + state_alias.data = (*C.char)(unsafe.Pointer(nil)) + } state_alias.len = C.size_t(len(state)) return (bool)(C.QHeaderView_RestoreState(this.h, state_alias)) } @@ -2940,7 +2944,11 @@ func miqt_exec_callback_QHeaderView_HideEvent(self *C.QHeaderView, cb C.intptr_t func (this *QHeaderView) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QHeaderView_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qidentityproxymodel.go b/qt6/gen_qidentityproxymodel.go index 7a73319c..20eae1a9 100644 --- a/qt6/gen_qidentityproxymodel.go +++ b/qt6/gen_qidentityproxymodel.go @@ -1522,7 +1522,11 @@ func miqt_exec_callback_QIdentityProxyModel_RoleNames(self *C.QIdentityProxyMode for virtualReturn_k, virtualReturn_v := range virtualReturn { virtualReturn_Keys_CArray[virtualReturn_ctr] = (C.int)(virtualReturn_k) virtualReturn_v_alias := C.struct_miqt_string{} - virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + if len(virtualReturn_v) > 0 { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + } else { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_v_alias.len = C.size_t(len(virtualReturn_v)) virtualReturn_Values_CArray[virtualReturn_ctr] = virtualReturn_v_alias virtualReturn_ctr++ diff --git a/qt6/gen_qimage.go b/qt6/gen_qimage.go index 9a678877..8ea4b610 100644 --- a/qt6/gen_qimage.go +++ b/qt6/gen_qimage.go @@ -577,7 +577,11 @@ func (this *QImage) LoadFromData2(buf *byte, lenVal int) bool { func (this *QImage) LoadFromDataWithData(data []byte) bool { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return (bool)(C.QImage_LoadFromDataWithData(this.h, data_alias)) } @@ -608,7 +612,11 @@ func QImage_FromData2(data *byte, size int) *QImage { func QImage_FromDataWithData(data []byte) *QImage { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) _goptr := newQImage(C.QImage_FromDataWithData(data_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer @@ -839,7 +847,11 @@ func (this *QImage) LoadFromData3(buf *byte, lenVal int, format string) bool { func (this *QImage) LoadFromData23(data []byte, format string) bool { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) format_Cstring := C.CString(format) defer C.free(unsafe.Pointer(format_Cstring)) @@ -896,7 +908,11 @@ func QImage_FromData3(data *byte, size int, format string) *QImage { func QImage_FromData23(data []byte, format string) *QImage { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) format_Cstring := C.CString(format) defer C.free(unsafe.Pointer(format_Cstring)) diff --git a/qt6/gen_qimageiohandler.go b/qt6/gen_qimageiohandler.go index b7e5f8a8..4ffa0490 100644 --- a/qt6/gen_qimageiohandler.go +++ b/qt6/gen_qimageiohandler.go @@ -107,14 +107,22 @@ func (this *QImageIOHandler) Device() *QIODevice { func (this *QImageIOHandler) SetFormat(format []byte) { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) C.QImageIOHandler_SetFormat(this.h, format_alias) } func (this *QImageIOHandler) SetFormatWithFormat(format []byte) { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) C.QImageIOHandler_SetFormatWithFormat(this.h, format_alias) } @@ -604,14 +612,22 @@ func QImageIOPlugin_Tr(s string) string { func (this *QImageIOPlugin) Capabilities(device *QIODevice, format []byte) QImageIOPlugin__Capability { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) return (QImageIOPlugin__Capability)(C.QImageIOPlugin_Capabilities(this.h, device.cPointer(), format_alias)) } func (this *QImageIOPlugin) Create(device *QIODevice, format []byte) *QImageIOHandler { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) return newQImageIOHandler(C.QImageIOPlugin_Create(this.h, device.cPointer(), format_alias)) } diff --git a/qt6/gen_qimagereader.go b/qt6/gen_qimagereader.go index 90d1bdd2..d4886681 100644 --- a/qt6/gen_qimagereader.go +++ b/qt6/gen_qimagereader.go @@ -80,7 +80,11 @@ func NewQImageReader3(fileName string) *QImageReader { // NewQImageReader4 constructs a new QImageReader object. func NewQImageReader4(device *QIODevice, format []byte) *QImageReader { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) return newQImageReader(C.QImageReader_new4(device.cPointer(), format_alias)) @@ -93,7 +97,11 @@ func NewQImageReader5(fileName string, format []byte) *QImageReader { fileName_ms.len = C.size_t(len(fileName)) defer C.free(unsafe.Pointer(fileName_ms.data)) format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) return newQImageReader(C.QImageReader_new5(fileName_ms, format_alias)) @@ -110,7 +118,11 @@ func QImageReader_Tr(sourceText string) string { func (this *QImageReader) SetFormat(format []byte) { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) C.QImageReader_SetFormat(this.h, format_alias) } @@ -384,7 +396,11 @@ func QImageReader_SupportedMimeTypes() [][]byte { func QImageReader_ImageFormatsForMimeType(mimeType []byte) [][]byte { mimeType_alias := C.struct_miqt_string{} - mimeType_alias.data = (*C.char)(unsafe.Pointer(&mimeType[0])) + if len(mimeType) > 0 { + mimeType_alias.data = (*C.char)(unsafe.Pointer(&mimeType[0])) + } else { + mimeType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } mimeType_alias.len = C.size_t(len(mimeType)) var _ma C.struct_miqt_array = C.QImageReader_ImageFormatsForMimeType(mimeType_alias) _ret := make([][]byte, int(_ma.len)) diff --git a/qt6/gen_qimagewriter.go b/qt6/gen_qimagewriter.go index c715a8bb..f2f9212a 100644 --- a/qt6/gen_qimagewriter.go +++ b/qt6/gen_qimagewriter.go @@ -63,7 +63,11 @@ func NewQImageWriter() *QImageWriter { // NewQImageWriter2 constructs a new QImageWriter object. func NewQImageWriter2(device *QIODevice, format []byte) *QImageWriter { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) return newQImageWriter(C.QImageWriter_new2(device.cPointer(), format_alias)) @@ -86,7 +90,11 @@ func NewQImageWriter4(fileName string, format []byte) *QImageWriter { fileName_ms.len = C.size_t(len(fileName)) defer C.free(unsafe.Pointer(fileName_ms.data)) format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) return newQImageWriter(C.QImageWriter_new4(fileName_ms, format_alias)) @@ -103,7 +111,11 @@ func QImageWriter_Tr(sourceText string) string { func (this *QImageWriter) SetFormat(format []byte) { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) C.QImageWriter_SetFormat(this.h, format_alias) } @@ -156,7 +168,11 @@ func (this *QImageWriter) Compression() int { func (this *QImageWriter) SetSubType(typeVal []byte) { typeVal_alias := C.struct_miqt_string{} - typeVal_alias.data = (*C.char)(unsafe.Pointer(&typeVal[0])) + if len(typeVal) > 0 { + typeVal_alias.data = (*C.char)(unsafe.Pointer(&typeVal[0])) + } else { + typeVal_alias.data = (*C.char)(unsafe.Pointer(nil)) + } typeVal_alias.len = C.size_t(len(typeVal)) C.QImageWriter_SetSubType(this.h, typeVal_alias) } @@ -268,7 +284,11 @@ func QImageWriter_SupportedMimeTypes() [][]byte { func QImageWriter_ImageFormatsForMimeType(mimeType []byte) [][]byte { mimeType_alias := C.struct_miqt_string{} - mimeType_alias.data = (*C.char)(unsafe.Pointer(&mimeType[0])) + if len(mimeType) > 0 { + mimeType_alias.data = (*C.char)(unsafe.Pointer(&mimeType[0])) + } else { + mimeType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } mimeType_alias.len = C.size_t(len(mimeType)) var _ma C.struct_miqt_array = C.QImageWriter_ImageFormatsForMimeType(mimeType_alias) _ret := make([][]byte, int(_ma.len)) diff --git a/qt6/gen_qinputdialog.go b/qt6/gen_qinputdialog.go index 18a620d3..f34fa11a 100644 --- a/qt6/gen_qinputdialog.go +++ b/qt6/gen_qinputdialog.go @@ -2004,7 +2004,11 @@ func miqt_exec_callback_QInputDialog_HideEvent(self *C.QInputDialog, cb C.intptr func (this *QInputDialog) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QInputDialog_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qiodevice.go b/qt6/gen_qiodevice.go index 0e349c45..e83bbc90 100644 --- a/qt6/gen_qiodevice.go +++ b/qt6/gen_qiodevice.go @@ -239,7 +239,11 @@ func (this *QIODevice) WriteWithData(data string) int64 { func (this *QIODevice) Write2(data []byte) int64 { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return (int64)(C.QIODevice_Write2(this.h, data_alias)) } diff --git a/qt6/gen_qitemeditorfactory.go b/qt6/gen_qitemeditorfactory.go index 6903ff71..f4ec2b27 100644 --- a/qt6/gen_qitemeditorfactory.go +++ b/qt6/gen_qitemeditorfactory.go @@ -198,7 +198,11 @@ func miqt_exec_callback_QItemEditorFactory_ValuePropertyName(self *C.QItemEditor virtualReturn := gofunc((&QItemEditorFactory{h: self}).callVirtualBase_ValuePropertyName, slotval1) virtualReturn_alias := C.struct_miqt_string{} - virtualReturn_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn[0])) + if len(virtualReturn) > 0 { + virtualReturn_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn[0])) + } else { + virtualReturn_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_alias.len = C.size_t(len(virtualReturn)) return virtualReturn_alias diff --git a/qt6/gen_qjsondocument.go b/qt6/gen_qjsondocument.go index b1b35102..f990f35c 100644 --- a/qt6/gen_qjsondocument.go +++ b/qt6/gen_qjsondocument.go @@ -171,7 +171,11 @@ func (this *QJsonDocument) ToVariant() *QVariant { func QJsonDocument_FromJson(json []byte) *QJsonDocument { json_alias := C.struct_miqt_string{} - json_alias.data = (*C.char)(unsafe.Pointer(&json[0])) + if len(json) > 0 { + json_alias.data = (*C.char)(unsafe.Pointer(&json[0])) + } else { + json_alias.data = (*C.char)(unsafe.Pointer(nil)) + } json_alias.len = C.size_t(len(json)) _goptr := newQJsonDocument(C.QJsonDocument_FromJson(json_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer @@ -247,7 +251,11 @@ func (this *QJsonDocument) IsNull() bool { func QJsonDocument_FromJson2(json []byte, error *QJsonParseError) *QJsonDocument { json_alias := C.struct_miqt_string{} - json_alias.data = (*C.char)(unsafe.Pointer(&json[0])) + if len(json) > 0 { + json_alias.data = (*C.char)(unsafe.Pointer(&json[0])) + } else { + json_alias.data = (*C.char)(unsafe.Pointer(nil)) + } json_alias.len = C.size_t(len(json)) _goptr := newQJsonDocument(C.QJsonDocument_FromJson2(json_alias, error.cPointer())) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer diff --git a/qt6/gen_qkeysequenceedit.go b/qt6/gen_qkeysequenceedit.go index a9855143..22deeda0 100644 --- a/qt6/gen_qkeysequenceedit.go +++ b/qt6/gen_qkeysequenceedit.go @@ -1037,7 +1037,11 @@ func miqt_exec_callback_QKeySequenceEdit_HideEvent(self *C.QKeySequenceEdit, cb func (this *QKeySequenceEdit) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QKeySequenceEdit_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qlabel.go b/qt6/gen_qlabel.go index b343d332..8e640039 100644 --- a/qt6/gen_qlabel.go +++ b/qt6/gen_qlabel.go @@ -1284,7 +1284,11 @@ func miqt_exec_callback_QLabel_HideEvent(self *C.QLabel, cb C.intptr_t, event *C func (this *QLabel) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QLabel_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qlcdnumber.go b/qt6/gen_qlcdnumber.go index b9c443af..9e8470da 100644 --- a/qt6/gen_qlcdnumber.go +++ b/qt6/gen_qlcdnumber.go @@ -1124,7 +1124,11 @@ func miqt_exec_callback_QLCDNumber_HideEvent(self *C.QLCDNumber, cb C.intptr_t, func (this *QLCDNumber) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QLCDNumber_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qlineedit.go b/qt6/gen_qlineedit.go index c070f11b..aa009e32 100644 --- a/qt6/gen_qlineedit.go +++ b/qt6/gen_qlineedit.go @@ -1583,7 +1583,11 @@ func miqt_exec_callback_QLineEdit_HideEvent(self *C.QLineEdit, cb C.intptr_t, ev func (this *QLineEdit) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QLineEdit_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qlistview.go b/qt6/gen_qlistview.go index 27492bf3..8863b59d 100644 --- a/qt6/gen_qlistview.go +++ b/qt6/gen_qlistview.go @@ -2549,7 +2549,11 @@ func miqt_exec_callback_QListView_HideEvent(self *C.QListView, cb C.intptr_t, ev func (this *QListView) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QListView_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qlistwidget.go b/qt6/gen_qlistwidget.go index 8f333a57..a670c5dd 100644 --- a/qt6/gen_qlistwidget.go +++ b/qt6/gen_qlistwidget.go @@ -3352,7 +3352,11 @@ func miqt_exec_callback_QListWidget_HideEvent(self *C.QListWidget, cb C.intptr_t func (this *QListWidget) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QListWidget_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qmainwindow.go b/qt6/gen_qmainwindow.go index e491142e..d2f2400a 100644 --- a/qt6/gen_qmainwindow.go +++ b/qt6/gen_qmainwindow.go @@ -315,7 +315,11 @@ func (this *QMainWindow) SaveState() []byte { func (this *QMainWindow) RestoreState(state []byte) bool { state_alias := C.struct_miqt_string{} - state_alias.data = (*C.char)(unsafe.Pointer(&state[0])) + if len(state) > 0 { + state_alias.data = (*C.char)(unsafe.Pointer(&state[0])) + } else { + state_alias.data = (*C.char)(unsafe.Pointer(nil)) + } state_alias.len = C.size_t(len(state)) return (bool)(C.QMainWindow_RestoreState(this.h, state_alias)) } @@ -431,7 +435,11 @@ func (this *QMainWindow) SaveState1(version int) []byte { func (this *QMainWindow) RestoreState2(state []byte, version int) bool { state_alias := C.struct_miqt_string{} - state_alias.data = (*C.char)(unsafe.Pointer(&state[0])) + if len(state) > 0 { + state_alias.data = (*C.char)(unsafe.Pointer(&state[0])) + } else { + state_alias.data = (*C.char)(unsafe.Pointer(nil)) + } state_alias.len = C.size_t(len(state)) return (bool)(C.QMainWindow_RestoreState2(this.h, state_alias, (C.int)(version))) } @@ -1298,7 +1306,11 @@ func miqt_exec_callback_QMainWindow_HideEvent(self *C.QMainWindow, cb C.intptr_t func (this *QMainWindow) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QMainWindow_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qmdiarea.go b/qt6/gen_qmdiarea.go index 363a28f7..c8820315 100644 --- a/qt6/gen_qmdiarea.go +++ b/qt6/gen_qmdiarea.go @@ -1382,7 +1382,11 @@ func miqt_exec_callback_QMdiArea_HideEvent(self *C.QMdiArea, cb C.intptr_t, even func (this *QMdiArea) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QMdiArea_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qmdisubwindow.go b/qt6/gen_qmdisubwindow.go index 85ce4a1b..2d53a28b 100644 --- a/qt6/gen_qmdisubwindow.go +++ b/qt6/gen_qmdisubwindow.go @@ -1182,7 +1182,11 @@ func miqt_exec_callback_QMdiSubWindow_DropEvent(self *C.QMdiSubWindow, cb C.intp func (this *QMdiSubWindow) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QMdiSubWindow_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qmenu.go b/qt6/gen_qmenu.go index 504a9742..e72f0b1e 100644 --- a/qt6/gen_qmenu.go +++ b/qt6/gen_qmenu.go @@ -1373,7 +1373,11 @@ func miqt_exec_callback_QMenu_ShowEvent(self *C.QMenu, cb C.intptr_t, event *C.Q func (this *QMenu) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QMenu_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qmenubar.go b/qt6/gen_qmenubar.go index b6d208e3..40ee5d0b 100644 --- a/qt6/gen_qmenubar.go +++ b/qt6/gen_qmenubar.go @@ -1196,7 +1196,11 @@ func miqt_exec_callback_QMenuBar_HideEvent(self *C.QMenuBar, cb C.intptr_t, even func (this *QMenuBar) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QMenuBar_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qmessageauthenticationcode.go b/qt6/gen_qmessageauthenticationcode.go index 1d781cb3..20f00a5d 100644 --- a/qt6/gen_qmessageauthenticationcode.go +++ b/qt6/gen_qmessageauthenticationcode.go @@ -54,7 +54,11 @@ func NewQMessageAuthenticationCode(method QCryptographicHash__Algorithm) *QMessa // NewQMessageAuthenticationCode2 constructs a new QMessageAuthenticationCode object. func NewQMessageAuthenticationCode2(method QCryptographicHash__Algorithm, key []byte) *QMessageAuthenticationCode { key_alias := C.struct_miqt_string{} - key_alias.data = (*C.char)(unsafe.Pointer(&key[0])) + if len(key) > 0 { + key_alias.data = (*C.char)(unsafe.Pointer(&key[0])) + } else { + key_alias.data = (*C.char)(unsafe.Pointer(nil)) + } key_alias.len = C.size_t(len(key)) return newQMessageAuthenticationCode(C.QMessageAuthenticationCode_new2((C.int)(method), key_alias)) @@ -66,7 +70,11 @@ func (this *QMessageAuthenticationCode) Reset() { func (this *QMessageAuthenticationCode) SetKey(key []byte) { key_alias := C.struct_miqt_string{} - key_alias.data = (*C.char)(unsafe.Pointer(&key[0])) + if len(key) > 0 { + key_alias.data = (*C.char)(unsafe.Pointer(&key[0])) + } else { + key_alias.data = (*C.char)(unsafe.Pointer(nil)) + } key_alias.len = C.size_t(len(key)) C.QMessageAuthenticationCode_SetKey(this.h, key_alias) } @@ -79,7 +87,11 @@ func (this *QMessageAuthenticationCode) AddData(data string, length int64) { func (this *QMessageAuthenticationCode) AddDataWithData(data []byte) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) C.QMessageAuthenticationCode_AddDataWithData(this.h, data_alias) } @@ -97,10 +109,18 @@ func (this *QMessageAuthenticationCode) Result() []byte { func QMessageAuthenticationCode_Hash(message []byte, key []byte, method QCryptographicHash__Algorithm) []byte { message_alias := C.struct_miqt_string{} - message_alias.data = (*C.char)(unsafe.Pointer(&message[0])) + if len(message) > 0 { + message_alias.data = (*C.char)(unsafe.Pointer(&message[0])) + } else { + message_alias.data = (*C.char)(unsafe.Pointer(nil)) + } message_alias.len = C.size_t(len(message)) key_alias := C.struct_miqt_string{} - key_alias.data = (*C.char)(unsafe.Pointer(&key[0])) + if len(key) > 0 { + key_alias.data = (*C.char)(unsafe.Pointer(&key[0])) + } else { + key_alias.data = (*C.char)(unsafe.Pointer(nil)) + } key_alias.len = C.size_t(len(key)) var _bytearray C.struct_miqt_string = C.QMessageAuthenticationCode_Hash(message_alias, key_alias, (C.int)(method)) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) diff --git a/qt6/gen_qmessagebox.go b/qt6/gen_qmessagebox.go index 6f4f8cf3..e0cd6690 100644 --- a/qt6/gen_qmessagebox.go +++ b/qt6/gen_qmessagebox.go @@ -2270,7 +2270,11 @@ func miqt_exec_callback_QMessageBox_HideEvent(self *C.QMessageBox, cb C.intptr_t func (this *QMessageBox) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QMessageBox_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qmetatype.go b/qt6/gen_qmetatype.go index ba3ff142..f3e9e47c 100644 --- a/qt6/gen_qmetatype.go +++ b/qt6/gen_qmetatype.go @@ -183,7 +183,11 @@ func NewQMetaType3(param1 *QMetaType) *QMetaType { func QMetaType_RegisterNormalizedTypedef(normalizedTypeName []byte, typeVal QMetaType) { normalizedTypeName_alias := C.struct_miqt_string{} - normalizedTypeName_alias.data = (*C.char)(unsafe.Pointer(&normalizedTypeName[0])) + if len(normalizedTypeName) > 0 { + normalizedTypeName_alias.data = (*C.char)(unsafe.Pointer(&normalizedTypeName[0])) + } else { + normalizedTypeName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } normalizedTypeName_alias.len = C.size_t(len(normalizedTypeName)) C.QMetaType_RegisterNormalizedTypedef(normalizedTypeName_alias, typeVal.cPointer()) } @@ -196,7 +200,11 @@ func QMetaType_Type(typeName string) int { func QMetaType_TypeWithTypeName(typeName []byte) int { typeName_alias := C.struct_miqt_string{} - typeName_alias.data = (*C.char)(unsafe.Pointer(&typeName[0])) + if len(typeName) > 0 { + typeName_alias.data = (*C.char)(unsafe.Pointer(&typeName[0])) + } else { + typeName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } typeName_alias.len = C.size_t(len(typeName)) return (int)(C.QMetaType_TypeWithTypeName(typeName_alias)) } diff --git a/qt6/gen_qmimedata.go b/qt6/gen_qmimedata.go index dbe4213c..e20de44d 100644 --- a/qt6/gen_qmimedata.go +++ b/qt6/gen_qmimedata.go @@ -184,7 +184,11 @@ func (this *QMimeData) SetData(mimetype string, data []byte) { mimetype_ms.len = C.size_t(len(mimetype)) defer C.free(unsafe.Pointer(mimetype_ms.data)) data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) C.QMimeData_SetData(this.h, mimetype_ms, data_alias) } diff --git a/qt6/gen_qmimedatabase.go b/qt6/gen_qmimedatabase.go index 06b623bc..a2f29d3e 100644 --- a/qt6/gen_qmimedatabase.go +++ b/qt6/gen_qmimedatabase.go @@ -103,7 +103,11 @@ func (this *QMimeDatabase) MimeTypesForFileName(fileName string) []QMimeType { func (this *QMimeDatabase) MimeTypeForData(data []byte) *QMimeType { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) _goptr := newQMimeType(C.QMimeDatabase_MimeTypeForData(this.h, data_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer @@ -138,7 +142,11 @@ func (this *QMimeDatabase) MimeTypeForFileNameAndData2(fileName string, data []b fileName_ms.len = C.size_t(len(fileName)) defer C.free(unsafe.Pointer(fileName_ms.data)) data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) _goptr := newQMimeType(C.QMimeDatabase_MimeTypeForFileNameAndData2(this.h, fileName_ms, data_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer diff --git a/qt6/gen_qmovie.go b/qt6/gen_qmovie.go index e051c74b..3729bc1f 100644 --- a/qt6/gen_qmovie.go +++ b/qt6/gen_qmovie.go @@ -96,7 +96,11 @@ func NewQMovie4(parent *QObject) *QMovie { // NewQMovie5 constructs a new QMovie object. func NewQMovie5(device *QIODevice, format []byte) *QMovie { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) return newQMovie(C.QMovie_new5(device.cPointer(), format_alias)) @@ -105,7 +109,11 @@ func NewQMovie5(device *QIODevice, format []byte) *QMovie { // NewQMovie6 constructs a new QMovie object. func NewQMovie6(device *QIODevice, format []byte, parent *QObject) *QMovie { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) return newQMovie(C.QMovie_new6(device.cPointer(), format_alias, parent.cPointer())) @@ -118,7 +126,11 @@ func NewQMovie7(fileName string, format []byte) *QMovie { fileName_ms.len = C.size_t(len(fileName)) defer C.free(unsafe.Pointer(fileName_ms.data)) format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) return newQMovie(C.QMovie_new7(fileName_ms, format_alias)) @@ -131,7 +143,11 @@ func NewQMovie8(fileName string, format []byte, parent *QObject) *QMovie { fileName_ms.len = C.size_t(len(fileName)) defer C.free(unsafe.Pointer(fileName_ms.data)) format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) return newQMovie(C.QMovie_new8(fileName_ms, format_alias, parent.cPointer())) @@ -194,7 +210,11 @@ func (this *QMovie) FileName() string { func (this *QMovie) SetFormat(format []byte) { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) C.QMovie_SetFormat(this.h, format_alias) } diff --git a/qt6/gen_qpdfwriter.go b/qt6/gen_qpdfwriter.go index b6a24aa4..9f782d27 100644 --- a/qt6/gen_qpdfwriter.go +++ b/qt6/gen_qpdfwriter.go @@ -140,7 +140,11 @@ func (this *QPdfWriter) Resolution() int { func (this *QPdfWriter) SetDocumentXmpMetadata(xmpMetadata []byte) { xmpMetadata_alias := C.struct_miqt_string{} - xmpMetadata_alias.data = (*C.char)(unsafe.Pointer(&xmpMetadata[0])) + if len(xmpMetadata) > 0 { + xmpMetadata_alias.data = (*C.char)(unsafe.Pointer(&xmpMetadata[0])) + } else { + xmpMetadata_alias.data = (*C.char)(unsafe.Pointer(nil)) + } xmpMetadata_alias.len = C.size_t(len(xmpMetadata)) C.QPdfWriter_SetDocumentXmpMetadata(this.h, xmpMetadata_alias) } @@ -158,7 +162,11 @@ func (this *QPdfWriter) AddFileAttachment(fileName string, data []byte) { fileName_ms.len = C.size_t(len(fileName)) defer C.free(unsafe.Pointer(fileName_ms.data)) data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) C.QPdfWriter_AddFileAttachment(this.h, fileName_ms, data_alias) } @@ -191,7 +199,11 @@ func (this *QPdfWriter) AddFileAttachment3(fileName string, data []byte, mimeTyp fileName_ms.len = C.size_t(len(fileName)) defer C.free(unsafe.Pointer(fileName_ms.data)) data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) mimeType_ms := C.struct_miqt_string{} mimeType_ms.data = C.CString(mimeType) diff --git a/qt6/gen_qpixmap.go b/qt6/gen_qpixmap.go index f19a3792..6bb83dee 100644 --- a/qt6/gen_qpixmap.go +++ b/qt6/gen_qpixmap.go @@ -274,7 +274,11 @@ func (this *QPixmap) LoadFromData(buf *byte, lenVal uint) bool { func (this *QPixmap) LoadFromDataWithData(data []byte) bool { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return (bool)(C.QPixmap_LoadFromDataWithData(this.h, data_alias)) } @@ -443,7 +447,11 @@ func (this *QPixmap) LoadFromData4(buf *byte, lenVal uint, format string, flags func (this *QPixmap) LoadFromData2(data []byte, format string) bool { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) format_Cstring := C.CString(format) defer C.free(unsafe.Pointer(format_Cstring)) @@ -452,7 +460,11 @@ func (this *QPixmap) LoadFromData2(data []byte, format string) bool { func (this *QPixmap) LoadFromData32(data []byte, format string, flags ImageConversionFlag) bool { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) format_Cstring := C.CString(format) defer C.free(unsafe.Pointer(format_Cstring)) diff --git a/qt6/gen_qplaintextedit.go b/qt6/gen_qplaintextedit.go index 27f2c1da..9cf3c4e0 100644 --- a/qt6/gen_qplaintextedit.go +++ b/qt6/gen_qplaintextedit.go @@ -1944,7 +1944,11 @@ func miqt_exec_callback_QPlainTextEdit_HideEvent(self *C.QPlainTextEdit, cb C.in func (this *QPlainTextEdit) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QPlainTextEdit_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qprogressbar.go b/qt6/gen_qprogressbar.go index 14a02aee..79badc33 100644 --- a/qt6/gen_qprogressbar.go +++ b/qt6/gen_qprogressbar.go @@ -1134,7 +1134,11 @@ func miqt_exec_callback_QProgressBar_HideEvent(self *C.QProgressBar, cb C.intptr func (this *QProgressBar) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QProgressBar_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qprogressdialog.go b/qt6/gen_qprogressdialog.go index 1216f1e5..6a4a2fd1 100644 --- a/qt6/gen_qprogressdialog.go +++ b/qt6/gen_qprogressdialog.go @@ -1286,7 +1286,11 @@ func miqt_exec_callback_QProgressDialog_HideEvent(self *C.QProgressDialog, cb C. func (this *QProgressDialog) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QProgressDialog_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qpropertyanimation.go b/qt6/gen_qpropertyanimation.go index 997fc86f..76ffed10 100644 --- a/qt6/gen_qpropertyanimation.go +++ b/qt6/gen_qpropertyanimation.go @@ -59,7 +59,11 @@ func NewQPropertyAnimation() *QPropertyAnimation { // NewQPropertyAnimation2 constructs a new QPropertyAnimation object. func NewQPropertyAnimation2(target *QObject, propertyName []byte) *QPropertyAnimation { propertyName_alias := C.struct_miqt_string{} - propertyName_alias.data = (*C.char)(unsafe.Pointer(&propertyName[0])) + if len(propertyName) > 0 { + propertyName_alias.data = (*C.char)(unsafe.Pointer(&propertyName[0])) + } else { + propertyName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } propertyName_alias.len = C.size_t(len(propertyName)) return newQPropertyAnimation(C.QPropertyAnimation_new2(target.cPointer(), propertyName_alias)) @@ -74,7 +78,11 @@ func NewQPropertyAnimation3(parent *QObject) *QPropertyAnimation { // NewQPropertyAnimation4 constructs a new QPropertyAnimation object. func NewQPropertyAnimation4(target *QObject, propertyName []byte, parent *QObject) *QPropertyAnimation { propertyName_alias := C.struct_miqt_string{} - propertyName_alias.data = (*C.char)(unsafe.Pointer(&propertyName[0])) + if len(propertyName) > 0 { + propertyName_alias.data = (*C.char)(unsafe.Pointer(&propertyName[0])) + } else { + propertyName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } propertyName_alias.len = C.size_t(len(propertyName)) return newQPropertyAnimation(C.QPropertyAnimation_new4(target.cPointer(), propertyName_alias, parent.cPointer())) @@ -116,7 +124,11 @@ func (this *QPropertyAnimation) PropertyName() []byte { func (this *QPropertyAnimation) SetPropertyName(propertyName []byte) { propertyName_alias := C.struct_miqt_string{} - propertyName_alias.data = (*C.char)(unsafe.Pointer(&propertyName[0])) + if len(propertyName) > 0 { + propertyName_alias.data = (*C.char)(unsafe.Pointer(&propertyName[0])) + } else { + propertyName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } propertyName_alias.len = C.size_t(len(propertyName)) C.QPropertyAnimation_SetPropertyName(this.h, propertyName_alias) } diff --git a/qt6/gen_qpushbutton.go b/qt6/gen_qpushbutton.go index 7e858b3a..18318b99 100644 --- a/qt6/gen_qpushbutton.go +++ b/qt6/gen_qpushbutton.go @@ -1180,7 +1180,11 @@ func miqt_exec_callback_QPushButton_HideEvent(self *C.QPushButton, cb C.intptr_t func (this *QPushButton) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QPushButton_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qradiobutton.go b/qt6/gen_qradiobutton.go index 9a7666b2..ee41426b 100644 --- a/qt6/gen_qradiobutton.go +++ b/qt6/gen_qradiobutton.go @@ -1124,7 +1124,11 @@ func miqt_exec_callback_QRadioButton_HideEvent(self *C.QRadioButton, cb C.intptr func (this *QRadioButton) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QRadioButton_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qrasterwindow.go b/qt6/gen_qrasterwindow.go index f335a28d..7924bb48 100644 --- a/qt6/gen_qrasterwindow.go +++ b/qt6/gen_qrasterwindow.go @@ -786,7 +786,11 @@ func miqt_exec_callback_QRasterWindow_TabletEvent(self *C.QRasterWindow, cb C.in func (this *QRasterWindow) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QRasterWindow_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qrawfont.go b/qt6/gen_qrawfont.go index 7e68574e..4c8dc0ba 100644 --- a/qt6/gen_qrawfont.go +++ b/qt6/gen_qrawfont.go @@ -79,7 +79,11 @@ func NewQRawFont2(fileName string, pixelSize float64) *QRawFont { // NewQRawFont3 constructs a new QRawFont object. func NewQRawFont3(fontData []byte, pixelSize float64) *QRawFont { fontData_alias := C.struct_miqt_string{} - fontData_alias.data = (*C.char)(unsafe.Pointer(&fontData[0])) + if len(fontData) > 0 { + fontData_alias.data = (*C.char)(unsafe.Pointer(&fontData[0])) + } else { + fontData_alias.data = (*C.char)(unsafe.Pointer(nil)) + } fontData_alias.len = C.size_t(len(fontData)) return newQRawFont(C.QRawFont_new3(fontData_alias, (C.double)(pixelSize))) @@ -104,7 +108,11 @@ func NewQRawFont5(fileName string, pixelSize float64, hintingPreference QFont__H // NewQRawFont6 constructs a new QRawFont object. func NewQRawFont6(fontData []byte, pixelSize float64, hintingPreference QFont__HintingPreference) *QRawFont { fontData_alias := C.struct_miqt_string{} - fontData_alias.data = (*C.char)(unsafe.Pointer(&fontData[0])) + if len(fontData) > 0 { + fontData_alias.data = (*C.char)(unsafe.Pointer(&fontData[0])) + } else { + fontData_alias.data = (*C.char)(unsafe.Pointer(nil)) + } fontData_alias.len = C.size_t(len(fontData)) return newQRawFont(C.QRawFont_new6(fontData_alias, (C.double)(pixelSize), (C.int)(hintingPreference))) @@ -294,7 +302,11 @@ func (this *QRawFont) LoadFromFile(fileName string, pixelSize float64, hintingPr func (this *QRawFont) LoadFromData(fontData []byte, pixelSize float64, hintingPreference QFont__HintingPreference) { fontData_alias := C.struct_miqt_string{} - fontData_alias.data = (*C.char)(unsafe.Pointer(&fontData[0])) + if len(fontData) > 0 { + fontData_alias.data = (*C.char)(unsafe.Pointer(&fontData[0])) + } else { + fontData_alias.data = (*C.char)(unsafe.Pointer(nil)) + } fontData_alias.len = C.size_t(len(fontData)) C.QRawFont_LoadFromData(this.h, fontData_alias, (C.double)(pixelSize), (C.int)(hintingPreference)) } diff --git a/qt6/gen_qrubberband.go b/qt6/gen_qrubberband.go index 7a10b8fd..5d441c80 100644 --- a/qt6/gen_qrubberband.go +++ b/qt6/gen_qrubberband.go @@ -1027,7 +1027,11 @@ func miqt_exec_callback_QRubberBand_HideEvent(self *C.QRubberBand, cb C.intptr_t func (this *QRubberBand) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QRubberBand_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qscrollarea.go b/qt6/gen_qscrollarea.go index 90e150c1..cd6829c3 100644 --- a/qt6/gen_qscrollarea.go +++ b/qt6/gen_qscrollarea.go @@ -1221,7 +1221,11 @@ func miqt_exec_callback_QScrollArea_HideEvent(self *C.QScrollArea, cb C.intptr_t func (this *QScrollArea) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QScrollArea_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qscrollbar.go b/qt6/gen_qscrollbar.go index b2ab3c3d..886a1da5 100644 --- a/qt6/gen_qscrollbar.go +++ b/qt6/gen_qscrollbar.go @@ -1066,7 +1066,11 @@ func miqt_exec_callback_QScrollBar_ShowEvent(self *C.QScrollBar, cb C.intptr_t, func (this *QScrollBar) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QScrollBar_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qsizegrip.go b/qt6/gen_qsizegrip.go index 190eceac..4a5aa8c9 100644 --- a/qt6/gen_qsizegrip.go +++ b/qt6/gen_qsizegrip.go @@ -974,7 +974,11 @@ func miqt_exec_callback_QSizeGrip_DropEvent(self *C.QSizeGrip, cb C.intptr_t, ev func (this *QSizeGrip) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QSizeGrip_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qslider.go b/qt6/gen_qslider.go index 574a5606..c3008e28 100644 --- a/qt6/gen_qslider.go +++ b/qt6/gen_qslider.go @@ -1099,7 +1099,11 @@ func miqt_exec_callback_QSlider_HideEvent(self *C.QSlider, cb C.intptr_t, event func (this *QSlider) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QSlider_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qsortfilterproxymodel.go b/qt6/gen_qsortfilterproxymodel.go index 5fdd4eed..914196a6 100644 --- a/qt6/gen_qsortfilterproxymodel.go +++ b/qt6/gen_qsortfilterproxymodel.go @@ -1883,7 +1883,11 @@ func miqt_exec_callback_QSortFilterProxyModel_RoleNames(self *C.QSortFilterProxy for virtualReturn_k, virtualReturn_v := range virtualReturn { virtualReturn_Keys_CArray[virtualReturn_ctr] = (C.int)(virtualReturn_k) virtualReturn_v_alias := C.struct_miqt_string{} - virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + if len(virtualReturn_v) > 0 { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + } else { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_v_alias.len = C.size_t(len(virtualReturn_v)) virtualReturn_Values_CArray[virtualReturn_ctr] = virtualReturn_v_alias virtualReturn_ctr++ diff --git a/qt6/gen_qspinbox.go b/qt6/gen_qspinbox.go index d7c46f91..9e92d51d 100644 --- a/qt6/gen_qspinbox.go +++ b/qt6/gen_qspinbox.go @@ -1396,7 +1396,11 @@ func miqt_exec_callback_QSpinBox_DropEvent(self *C.QSpinBox, cb C.intptr_t, even func (this *QSpinBox) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QSpinBox_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) @@ -3153,7 +3157,11 @@ func miqt_exec_callback_QDoubleSpinBox_DropEvent(self *C.QDoubleSpinBox, cb C.in func (this *QDoubleSpinBox) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QDoubleSpinBox_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qsplashscreen.go b/qt6/gen_qsplashscreen.go index a5f08eb7..f57c8508 100644 --- a/qt6/gen_qsplashscreen.go +++ b/qt6/gen_qsplashscreen.go @@ -1070,7 +1070,11 @@ func miqt_exec_callback_QSplashScreen_HideEvent(self *C.QSplashScreen, cb C.intp func (this *QSplashScreen) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QSplashScreen_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qsplitter.go b/qt6/gen_qsplitter.go index 360008e5..d5a3583d 100644 --- a/qt6/gen_qsplitter.go +++ b/qt6/gen_qsplitter.go @@ -182,7 +182,11 @@ func (this *QSplitter) SaveState() []byte { func (this *QSplitter) RestoreState(state []byte) bool { state_alias := C.struct_miqt_string{} - state_alias.data = (*C.char)(unsafe.Pointer(&state[0])) + if len(state) > 0 { + state_alias.data = (*C.char)(unsafe.Pointer(&state[0])) + } else { + state_alias.data = (*C.char)(unsafe.Pointer(nil)) + } state_alias.len = C.size_t(len(state)) return (bool)(C.QSplitter_RestoreState(this.h, state_alias)) } @@ -1207,7 +1211,11 @@ func miqt_exec_callback_QSplitter_HideEvent(self *C.QSplitter, cb C.intptr_t, ev func (this *QSplitter) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QSplitter_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) @@ -2523,7 +2531,11 @@ func miqt_exec_callback_QSplitterHandle_HideEvent(self *C.QSplitterHandle, cb C. func (this *QSplitterHandle) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QSplitterHandle_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qstackedwidget.go b/qt6/gen_qstackedwidget.go index d10705c4..befc47ee 100644 --- a/qt6/gen_qstackedwidget.go +++ b/qt6/gen_qstackedwidget.go @@ -1072,7 +1072,11 @@ func miqt_exec_callback_QStackedWidget_HideEvent(self *C.QStackedWidget, cb C.in func (this *QStackedWidget) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QStackedWidget_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qstandarditemmodel.go b/qt6/gen_qstandarditemmodel.go index a4e6cfd1..f9f45ca5 100644 --- a/qt6/gen_qstandarditemmodel.go +++ b/qt6/gen_qstandarditemmodel.go @@ -861,7 +861,11 @@ func (this *QStandardItemModel) SetItemRoleNames(roleNames map[int][]byte) { for roleNames_k, roleNames_v := range roleNames { roleNames_Keys_CArray[roleNames_ctr] = (C.int)(roleNames_k) roleNames_v_alias := C.struct_miqt_string{} - roleNames_v_alias.data = (*C.char)(unsafe.Pointer(&roleNames_v[0])) + if len(roleNames_v) > 0 { + roleNames_v_alias.data = (*C.char)(unsafe.Pointer(&roleNames_v[0])) + } else { + roleNames_v_alias.data = (*C.char)(unsafe.Pointer(nil)) + } roleNames_v_alias.len = C.size_t(len(roleNames_v)) roleNames_Values_CArray[roleNames_ctr] = roleNames_v_alias roleNames_ctr++ @@ -1361,7 +1365,11 @@ func miqt_exec_callback_QStandardItemModel_RoleNames(self *C.QStandardItemModel, for virtualReturn_k, virtualReturn_v := range virtualReturn { virtualReturn_Keys_CArray[virtualReturn_ctr] = (C.int)(virtualReturn_k) virtualReturn_v_alias := C.struct_miqt_string{} - virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + if len(virtualReturn_v) > 0 { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + } else { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_v_alias.len = C.size_t(len(virtualReturn_v)) virtualReturn_Values_CArray[virtualReturn_ctr] = virtualReturn_v_alias virtualReturn_ctr++ diff --git a/qt6/gen_qstatusbar.go b/qt6/gen_qstatusbar.go index bea52a0b..596ee826 100644 --- a/qt6/gen_qstatusbar.go +++ b/qt6/gen_qstatusbar.go @@ -1038,7 +1038,11 @@ func miqt_exec_callback_QStatusBar_HideEvent(self *C.QStatusBar, cb C.intptr_t, func (this *QStatusBar) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QStatusBar_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qstringlistmodel.go b/qt6/gen_qstringlistmodel.go index 7b63a0d4..1528b418 100644 --- a/qt6/gen_qstringlistmodel.go +++ b/qt6/gen_qstringlistmodel.go @@ -1285,7 +1285,11 @@ func miqt_exec_callback_QStringListModel_RoleNames(self *C.QStringListModel, cb for virtualReturn_k, virtualReturn_v := range virtualReturn { virtualReturn_Keys_CArray[virtualReturn_ctr] = (C.int)(virtualReturn_k) virtualReturn_v_alias := C.struct_miqt_string{} - virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + if len(virtualReturn_v) > 0 { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + } else { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_v_alias.len = C.size_t(len(virtualReturn_v)) virtualReturn_Values_CArray[virtualReturn_ctr] = virtualReturn_v_alias virtualReturn_ctr++ diff --git a/qt6/gen_qtabbar.go b/qt6/gen_qtabbar.go index da44593b..ce9a4934 100644 --- a/qt6/gen_qtabbar.go +++ b/qt6/gen_qtabbar.go @@ -1571,7 +1571,11 @@ func miqt_exec_callback_QTabBar_DropEvent(self *C.QTabBar, cb C.intptr_t, event func (this *QTabBar) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QTabBar_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qtableview.go b/qt6/gen_qtableview.go index 500cb58b..e2adf165 100644 --- a/qt6/gen_qtableview.go +++ b/qt6/gen_qtableview.go @@ -2521,7 +2521,11 @@ func miqt_exec_callback_QTableView_HideEvent(self *C.QTableView, cb C.intptr_t, func (this *QTableView) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QTableView_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qtablewidget.go b/qt6/gen_qtablewidget.go index e4eda529..810540b6 100644 --- a/qt6/gen_qtablewidget.go +++ b/qt6/gen_qtablewidget.go @@ -3605,7 +3605,11 @@ func miqt_exec_callback_QTableWidget_HideEvent(self *C.QTableWidget, cb C.intptr func (this *QTableWidget) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QTableWidget_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qtabwidget.go b/qt6/gen_qtabwidget.go index ea6023bb..5ff221d2 100644 --- a/qt6/gen_qtabwidget.go +++ b/qt6/gen_qtabwidget.go @@ -1393,7 +1393,11 @@ func miqt_exec_callback_QTabWidget_HideEvent(self *C.QTabWidget, cb C.intptr_t, func (this *QTabWidget) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QTabWidget_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qtextbrowser.go b/qt6/gen_qtextbrowser.go index 90125476..fe6aca5b 100644 --- a/qt6/gen_qtextbrowser.go +++ b/qt6/gen_qtextbrowser.go @@ -1731,7 +1731,11 @@ func miqt_exec_callback_QTextBrowser_HideEvent(self *C.QTextBrowser, cb C.intptr func (this *QTextBrowser) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QTextBrowser_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qtextdocumentwriter.go b/qt6/gen_qtextdocumentwriter.go index 12645959..d2c0a323 100644 --- a/qt6/gen_qtextdocumentwriter.go +++ b/qt6/gen_qtextdocumentwriter.go @@ -54,7 +54,11 @@ func NewQTextDocumentWriter() *QTextDocumentWriter { // NewQTextDocumentWriter2 constructs a new QTextDocumentWriter object. func NewQTextDocumentWriter2(device *QIODevice, format []byte) *QTextDocumentWriter { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) return newQTextDocumentWriter(C.QTextDocumentWriter_new2(device.cPointer(), format_alias)) @@ -77,7 +81,11 @@ func NewQTextDocumentWriter4(fileName string, format []byte) *QTextDocumentWrite fileName_ms.len = C.size_t(len(fileName)) defer C.free(unsafe.Pointer(fileName_ms.data)) format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) return newQTextDocumentWriter(C.QTextDocumentWriter_new4(fileName_ms, format_alias)) @@ -85,7 +93,11 @@ func NewQTextDocumentWriter4(fileName string, format []byte) *QTextDocumentWrite func (this *QTextDocumentWriter) SetFormat(format []byte) { format_alias := C.struct_miqt_string{} - format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + if len(format) > 0 { + format_alias.data = (*C.char)(unsafe.Pointer(&format[0])) + } else { + format_alias.data = (*C.char)(unsafe.Pointer(nil)) + } format_alias.len = C.size_t(len(format)) C.QTextDocumentWriter_SetFormat(this.h, format_alias) } diff --git a/qt6/gen_qtextedit.go b/qt6/gen_qtextedit.go index 321a065a..6b49c450 100644 --- a/qt6/gen_qtextedit.go +++ b/qt6/gen_qtextedit.go @@ -2041,7 +2041,11 @@ func miqt_exec_callback_QTextEdit_HideEvent(self *C.QTextEdit, cb C.intptr_t, ev func (this *QTextEdit) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QTextEdit_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qtextstream.go b/qt6/gen_qtextstream.go index dfc2171d..1c599473 100644 --- a/qt6/gen_qtextstream.go +++ b/qt6/gen_qtextstream.go @@ -100,7 +100,11 @@ func NewQTextStream2(device *QIODevice) *QTextStream { // NewQTextStream3 constructs a new QTextStream object. func NewQTextStream3(array []byte) *QTextStream { array_alias := C.struct_miqt_string{} - array_alias.data = (*C.char)(unsafe.Pointer(&array[0])) + if len(array) > 0 { + array_alias.data = (*C.char)(unsafe.Pointer(&array[0])) + } else { + array_alias.data = (*C.char)(unsafe.Pointer(nil)) + } array_alias.len = C.size_t(len(array)) return newQTextStream(C.QTextStream_new3(array_alias)) @@ -109,7 +113,11 @@ func NewQTextStream3(array []byte) *QTextStream { // NewQTextStream4 constructs a new QTextStream object. func NewQTextStream4(array []byte, openMode QIODeviceBase__OpenModeFlag) *QTextStream { array_alias := C.struct_miqt_string{} - array_alias.data = (*C.char)(unsafe.Pointer(&array[0])) + if len(array) > 0 { + array_alias.data = (*C.char)(unsafe.Pointer(&array[0])) + } else { + array_alias.data = (*C.char)(unsafe.Pointer(nil)) + } array_alias.len = C.size_t(len(array)) return newQTextStream(C.QTextStream_new4(array_alias, (C.int)(openMode))) @@ -337,7 +345,11 @@ func (this *QTextStream) OperatorShiftRightWithQString(s string) *QTextStream { func (this *QTextStream) OperatorShiftRightWithArray(array []byte) *QTextStream { array_alias := C.struct_miqt_string{} - array_alias.data = (*C.char)(unsafe.Pointer(&array[0])) + if len(array) > 0 { + array_alias.data = (*C.char)(unsafe.Pointer(&array[0])) + } else { + array_alias.data = (*C.char)(unsafe.Pointer(nil)) + } array_alias.len = C.size_t(len(array)) return newQTextStream(C.QTextStream_OperatorShiftRightWithArray(this.h, array_alias)) } @@ -406,7 +418,11 @@ func (this *QTextStream) OperatorShiftLeftWithQString(s string) *QTextStream { func (this *QTextStream) OperatorShiftLeftWithArray(array []byte) *QTextStream { array_alias := C.struct_miqt_string{} - array_alias.data = (*C.char)(unsafe.Pointer(&array[0])) + if len(array) > 0 { + array_alias.data = (*C.char)(unsafe.Pointer(&array[0])) + } else { + array_alias.data = (*C.char)(unsafe.Pointer(nil)) + } array_alias.len = C.size_t(len(array)) return newQTextStream(C.QTextStream_OperatorShiftLeftWithArray(this.h, array_alias)) } diff --git a/qt6/gen_qtimezone.go b/qt6/gen_qtimezone.go index 45cb2447..67d7b654 100644 --- a/qt6/gen_qtimezone.go +++ b/qt6/gen_qtimezone.go @@ -78,7 +78,11 @@ func NewQTimeZone() *QTimeZone { // NewQTimeZone2 constructs a new QTimeZone object. func NewQTimeZone2(ianaId []byte) *QTimeZone { ianaId_alias := C.struct_miqt_string{} - ianaId_alias.data = (*C.char)(unsafe.Pointer(&ianaId[0])) + if len(ianaId) > 0 { + ianaId_alias.data = (*C.char)(unsafe.Pointer(&ianaId[0])) + } else { + ianaId_alias.data = (*C.char)(unsafe.Pointer(nil)) + } ianaId_alias.len = C.size_t(len(ianaId)) return newQTimeZone(C.QTimeZone_new2(ianaId_alias)) @@ -93,7 +97,11 @@ func NewQTimeZone3(offsetSeconds int) *QTimeZone { // NewQTimeZone4 constructs a new QTimeZone object. func NewQTimeZone4(zoneId []byte, offsetSeconds int, name string, abbreviation string) *QTimeZone { zoneId_alias := C.struct_miqt_string{} - zoneId_alias.data = (*C.char)(unsafe.Pointer(&zoneId[0])) + if len(zoneId) > 0 { + zoneId_alias.data = (*C.char)(unsafe.Pointer(&zoneId[0])) + } else { + zoneId_alias.data = (*C.char)(unsafe.Pointer(nil)) + } zoneId_alias.len = C.size_t(len(zoneId)) name_ms := C.struct_miqt_string{} name_ms.data = C.CString(name) @@ -116,7 +124,11 @@ func NewQTimeZone5(other *QTimeZone) *QTimeZone { // NewQTimeZone6 constructs a new QTimeZone object. func NewQTimeZone6(zoneId []byte, offsetSeconds int, name string, abbreviation string, territory QLocale__Country) *QTimeZone { zoneId_alias := C.struct_miqt_string{} - zoneId_alias.data = (*C.char)(unsafe.Pointer(&zoneId[0])) + if len(zoneId) > 0 { + zoneId_alias.data = (*C.char)(unsafe.Pointer(&zoneId[0])) + } else { + zoneId_alias.data = (*C.char)(unsafe.Pointer(nil)) + } zoneId_alias.len = C.size_t(len(zoneId)) name_ms := C.struct_miqt_string{} name_ms.data = C.CString(name) @@ -133,7 +145,11 @@ func NewQTimeZone6(zoneId []byte, offsetSeconds int, name string, abbreviation s // NewQTimeZone7 constructs a new QTimeZone object. func NewQTimeZone7(zoneId []byte, offsetSeconds int, name string, abbreviation string, territory QLocale__Country, comment string) *QTimeZone { zoneId_alias := C.struct_miqt_string{} - zoneId_alias.data = (*C.char)(unsafe.Pointer(&zoneId[0])) + if len(zoneId) > 0 { + zoneId_alias.data = (*C.char)(unsafe.Pointer(&zoneId[0])) + } else { + zoneId_alias.data = (*C.char)(unsafe.Pointer(nil)) + } zoneId_alias.len = C.size_t(len(zoneId)) name_ms := C.struct_miqt_string{} name_ms.data = C.CString(name) @@ -281,7 +297,11 @@ func QTimeZone_Utc() *QTimeZone { func QTimeZone_IsTimeZoneIdAvailable(ianaId []byte) bool { ianaId_alias := C.struct_miqt_string{} - ianaId_alias.data = (*C.char)(unsafe.Pointer(&ianaId[0])) + if len(ianaId) > 0 { + ianaId_alias.data = (*C.char)(unsafe.Pointer(&ianaId[0])) + } else { + ianaId_alias.data = (*C.char)(unsafe.Pointer(nil)) + } ianaId_alias.len = C.size_t(len(ianaId)) return (bool)(C.QTimeZone_IsTimeZoneIdAvailable(ianaId_alias)) } @@ -327,7 +347,11 @@ func QTimeZone_AvailableTimeZoneIdsWithOffsetSeconds(offsetSeconds int) [][]byte func QTimeZone_IanaIdToWindowsId(ianaId []byte) []byte { ianaId_alias := C.struct_miqt_string{} - ianaId_alias.data = (*C.char)(unsafe.Pointer(&ianaId[0])) + if len(ianaId) > 0 { + ianaId_alias.data = (*C.char)(unsafe.Pointer(&ianaId[0])) + } else { + ianaId_alias.data = (*C.char)(unsafe.Pointer(nil)) + } ianaId_alias.len = C.size_t(len(ianaId)) var _bytearray C.struct_miqt_string = C.QTimeZone_IanaIdToWindowsId(ianaId_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) @@ -337,7 +361,11 @@ func QTimeZone_IanaIdToWindowsId(ianaId []byte) []byte { func QTimeZone_WindowsIdToDefaultIanaId(windowsId []byte) []byte { windowsId_alias := C.struct_miqt_string{} - windowsId_alias.data = (*C.char)(unsafe.Pointer(&windowsId[0])) + if len(windowsId) > 0 { + windowsId_alias.data = (*C.char)(unsafe.Pointer(&windowsId[0])) + } else { + windowsId_alias.data = (*C.char)(unsafe.Pointer(nil)) + } windowsId_alias.len = C.size_t(len(windowsId)) var _bytearray C.struct_miqt_string = C.QTimeZone_WindowsIdToDefaultIanaId(windowsId_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) @@ -347,7 +375,11 @@ func QTimeZone_WindowsIdToDefaultIanaId(windowsId []byte) []byte { func QTimeZone_WindowsIdToDefaultIanaId2(windowsId []byte, territory QLocale__Country) []byte { windowsId_alias := C.struct_miqt_string{} - windowsId_alias.data = (*C.char)(unsafe.Pointer(&windowsId[0])) + if len(windowsId) > 0 { + windowsId_alias.data = (*C.char)(unsafe.Pointer(&windowsId[0])) + } else { + windowsId_alias.data = (*C.char)(unsafe.Pointer(nil)) + } windowsId_alias.len = C.size_t(len(windowsId)) var _bytearray C.struct_miqt_string = C.QTimeZone_WindowsIdToDefaultIanaId2(windowsId_alias, (C.uint16_t)(territory)) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) @@ -357,7 +389,11 @@ func QTimeZone_WindowsIdToDefaultIanaId2(windowsId []byte, territory QLocale__Co func QTimeZone_WindowsIdToIanaIds(windowsId []byte) [][]byte { windowsId_alias := C.struct_miqt_string{} - windowsId_alias.data = (*C.char)(unsafe.Pointer(&windowsId[0])) + if len(windowsId) > 0 { + windowsId_alias.data = (*C.char)(unsafe.Pointer(&windowsId[0])) + } else { + windowsId_alias.data = (*C.char)(unsafe.Pointer(nil)) + } windowsId_alias.len = C.size_t(len(windowsId)) var _ma C.struct_miqt_array = C.QTimeZone_WindowsIdToIanaIds(windowsId_alias) _ret := make([][]byte, int(_ma.len)) @@ -373,7 +409,11 @@ func QTimeZone_WindowsIdToIanaIds(windowsId []byte) [][]byte { func QTimeZone_WindowsIdToIanaIds2(windowsId []byte, territory QLocale__Country) [][]byte { windowsId_alias := C.struct_miqt_string{} - windowsId_alias.data = (*C.char)(unsafe.Pointer(&windowsId[0])) + if len(windowsId) > 0 { + windowsId_alias.data = (*C.char)(unsafe.Pointer(&windowsId[0])) + } else { + windowsId_alias.data = (*C.char)(unsafe.Pointer(nil)) + } windowsId_alias.len = C.size_t(len(windowsId)) var _ma C.struct_miqt_array = C.QTimeZone_WindowsIdToIanaIds2(windowsId_alias, (C.uint16_t)(territory)) _ret := make([][]byte, int(_ma.len)) diff --git a/qt6/gen_qtoolbar.go b/qt6/gen_qtoolbar.go index 51484a09..50f4c923 100644 --- a/qt6/gen_qtoolbar.go +++ b/qt6/gen_qtoolbar.go @@ -1272,7 +1272,11 @@ func miqt_exec_callback_QToolBar_HideEvent(self *C.QToolBar, cb C.intptr_t, even func (this *QToolBar) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QToolBar_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qtoolbox.go b/qt6/gen_qtoolbox.go index 2324bbee..7704e82d 100644 --- a/qt6/gen_qtoolbox.go +++ b/qt6/gen_qtoolbox.go @@ -1182,7 +1182,11 @@ func miqt_exec_callback_QToolBox_HideEvent(self *C.QToolBox, cb C.intptr_t, even func (this *QToolBox) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QToolBox_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qtoolbutton.go b/qt6/gen_qtoolbutton.go index 9dfec5ab..1708599e 100644 --- a/qt6/gen_qtoolbutton.go +++ b/qt6/gen_qtoolbutton.go @@ -1184,7 +1184,11 @@ func miqt_exec_callback_QToolButton_HideEvent(self *C.QToolButton, cb C.intptr_t func (this *QToolButton) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QToolButton_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qtransposeproxymodel.go b/qt6/gen_qtransposeproxymodel.go index abcf3c85..1b99ef45 100644 --- a/qt6/gen_qtransposeproxymodel.go +++ b/qt6/gen_qtransposeproxymodel.go @@ -1488,7 +1488,11 @@ func miqt_exec_callback_QTransposeProxyModel_RoleNames(self *C.QTransposeProxyMo for virtualReturn_k, virtualReturn_v := range virtualReturn { virtualReturn_Keys_CArray[virtualReturn_ctr] = (C.int)(virtualReturn_k) virtualReturn_v_alias := C.struct_miqt_string{} - virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + if len(virtualReturn_v) > 0 { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn_v[0])) + } else { + virtualReturn_v_alias.data = (*C.char)(unsafe.Pointer(nil)) + } virtualReturn_v_alias.len = C.size_t(len(virtualReturn_v)) virtualReturn_Values_CArray[virtualReturn_ctr] = virtualReturn_v_alias virtualReturn_ctr++ diff --git a/qt6/gen_qtreeview.go b/qt6/gen_qtreeview.go index 953d8660..d5e9757b 100644 --- a/qt6/gen_qtreeview.go +++ b/qt6/gen_qtreeview.go @@ -2695,7 +2695,11 @@ func miqt_exec_callback_QTreeView_HideEvent(self *C.QTreeView, cb C.intptr_t, ev func (this *QTreeView) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QTreeView_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qtreewidget.go b/qt6/gen_qtreewidget.go index 5c09cf1f..3973bfa7 100644 --- a/qt6/gen_qtreewidget.go +++ b/qt6/gen_qtreewidget.go @@ -3659,7 +3659,11 @@ func miqt_exec_callback_QTreeWidget_HideEvent(self *C.QTreeWidget, cb C.intptr_t func (this *QTreeWidget) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QTreeWidget_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qundoview.go b/qt6/gen_qundoview.go index 8237c708..c46a60bf 100644 --- a/qt6/gen_qundoview.go +++ b/qt6/gen_qundoview.go @@ -2390,7 +2390,11 @@ func miqt_exec_callback_QUndoView_HideEvent(self *C.QUndoView, cb C.intptr_t, ev func (this *QUndoView) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QUndoView_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qurl.go b/qt6/gen_qurl.go index 3f8da4ee..320859fc 100644 --- a/qt6/gen_qurl.go +++ b/qt6/gen_qurl.go @@ -184,7 +184,11 @@ func (this *QUrl) ToEncoded() []byte { func QUrl_FromEncoded(url []byte) *QUrl { url_alias := C.struct_miqt_string{} - url_alias.data = (*C.char)(unsafe.Pointer(&url[0])) + if len(url) > 0 { + url_alias.data = (*C.char)(unsafe.Pointer(&url[0])) + } else { + url_alias.data = (*C.char)(unsafe.Pointer(nil)) + } url_alias.len = C.size_t(len(url)) _goptr := newQUrl(C.QUrl_FromEncoded(url_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer @@ -439,7 +443,11 @@ func (this *QUrl) OperatorNotEqual(url *QUrl) bool { func QUrl_FromPercentEncoding(param1 []byte) string { param1_alias := C.struct_miqt_string{} - param1_alias.data = (*C.char)(unsafe.Pointer(¶m1[0])) + if len(param1) > 0 { + param1_alias.data = (*C.char)(unsafe.Pointer(¶m1[0])) + } else { + param1_alias.data = (*C.char)(unsafe.Pointer(nil)) + } param1_alias.len = C.size_t(len(param1)) var _ms C.struct_miqt_string = C.QUrl_FromPercentEncoding(param1_alias) _ret := C.GoStringN(_ms.data, C.int(int64(_ms.len))) @@ -460,7 +468,11 @@ func QUrl_ToPercentEncoding(param1 string) []byte { func QUrl_FromAce(domain []byte) string { domain_alias := C.struct_miqt_string{} - domain_alias.data = (*C.char)(unsafe.Pointer(&domain[0])) + if len(domain) > 0 { + domain_alias.data = (*C.char)(unsafe.Pointer(&domain[0])) + } else { + domain_alias.data = (*C.char)(unsafe.Pointer(nil)) + } domain_alias.len = C.size_t(len(domain)) var _ms C.struct_miqt_string = C.QUrl_FromAce(domain_alias) _ret := C.GoStringN(_ms.data, C.int(int64(_ms.len))) @@ -557,7 +569,11 @@ func (this *QUrl) SetUrl2(url string, mode QUrl__ParsingMode) { func QUrl_FromEncoded2(url []byte, mode QUrl__ParsingMode) *QUrl { url_alias := C.struct_miqt_string{} - url_alias.data = (*C.char)(unsafe.Pointer(&url[0])) + if len(url) > 0 { + url_alias.data = (*C.char)(unsafe.Pointer(&url[0])) + } else { + url_alias.data = (*C.char)(unsafe.Pointer(nil)) + } url_alias.len = C.size_t(len(url)) _goptr := newQUrl(C.QUrl_FromEncoded2(url_alias, (C.int)(mode))) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer @@ -729,7 +745,11 @@ func QUrl_ToPercentEncoding2(param1 string, exclude []byte) []byte { param1_ms.len = C.size_t(len(param1)) defer C.free(unsafe.Pointer(param1_ms.data)) exclude_alias := C.struct_miqt_string{} - exclude_alias.data = (*C.char)(unsafe.Pointer(&exclude[0])) + if len(exclude) > 0 { + exclude_alias.data = (*C.char)(unsafe.Pointer(&exclude[0])) + } else { + exclude_alias.data = (*C.char)(unsafe.Pointer(nil)) + } exclude_alias.len = C.size_t(len(exclude)) var _bytearray C.struct_miqt_string = C.QUrl_ToPercentEncoding2(param1_ms, exclude_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) @@ -743,10 +763,18 @@ func QUrl_ToPercentEncoding3(param1 string, exclude []byte, include []byte) []by param1_ms.len = C.size_t(len(param1)) defer C.free(unsafe.Pointer(param1_ms.data)) exclude_alias := C.struct_miqt_string{} - exclude_alias.data = (*C.char)(unsafe.Pointer(&exclude[0])) + if len(exclude) > 0 { + exclude_alias.data = (*C.char)(unsafe.Pointer(&exclude[0])) + } else { + exclude_alias.data = (*C.char)(unsafe.Pointer(nil)) + } exclude_alias.len = C.size_t(len(exclude)) include_alias := C.struct_miqt_string{} - include_alias.data = (*C.char)(unsafe.Pointer(&include[0])) + if len(include) > 0 { + include_alias.data = (*C.char)(unsafe.Pointer(&include[0])) + } else { + include_alias.data = (*C.char)(unsafe.Pointer(nil)) + } include_alias.len = C.size_t(len(include)) var _bytearray C.struct_miqt_string = C.QUrl_ToPercentEncoding3(param1_ms, exclude_alias, include_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) @@ -756,7 +784,11 @@ func QUrl_ToPercentEncoding3(param1 string, exclude []byte, include []byte) []by func QUrl_FromAce2(domain []byte, options QUrl__AceProcessingOption) string { domain_alias := C.struct_miqt_string{} - domain_alias.data = (*C.char)(unsafe.Pointer(&domain[0])) + if len(domain) > 0 { + domain_alias.data = (*C.char)(unsafe.Pointer(&domain[0])) + } else { + domain_alias.data = (*C.char)(unsafe.Pointer(nil)) + } domain_alias.len = C.size_t(len(domain)) var _ms C.struct_miqt_string = C.QUrl_FromAce2(domain_alias, (C.uint)(options)) _ret := C.GoStringN(_ms.data, C.int(int64(_ms.len))) diff --git a/qt6/gen_quuid.go b/qt6/gen_quuid.go index cc969e58..3cc6848a 100644 --- a/qt6/gen_quuid.go +++ b/qt6/gen_quuid.go @@ -160,7 +160,11 @@ func QUuid_CreateUuid() *QUuid { func QUuid_CreateUuidV3(ns *QUuid, baseData []byte) *QUuid { baseData_alias := C.struct_miqt_string{} - baseData_alias.data = (*C.char)(unsafe.Pointer(&baseData[0])) + if len(baseData) > 0 { + baseData_alias.data = (*C.char)(unsafe.Pointer(&baseData[0])) + } else { + baseData_alias.data = (*C.char)(unsafe.Pointer(nil)) + } baseData_alias.len = C.size_t(len(baseData)) _goptr := newQUuid(C.QUuid_CreateUuidV3(ns.cPointer(), baseData_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer @@ -169,7 +173,11 @@ func QUuid_CreateUuidV3(ns *QUuid, baseData []byte) *QUuid { func QUuid_CreateUuidV5(ns *QUuid, baseData []byte) *QUuid { baseData_alias := C.struct_miqt_string{} - baseData_alias.data = (*C.char)(unsafe.Pointer(&baseData[0])) + if len(baseData) > 0 { + baseData_alias.data = (*C.char)(unsafe.Pointer(&baseData[0])) + } else { + baseData_alias.data = (*C.char)(unsafe.Pointer(nil)) + } baseData_alias.len = C.size_t(len(baseData)) _goptr := newQUuid(C.QUuid_CreateUuidV5(ns.cPointer(), baseData_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer diff --git a/qt6/gen_qvariant.go b/qt6/gen_qvariant.go index d953bbb4..2f78166b 100644 --- a/qt6/gen_qvariant.go +++ b/qt6/gen_qvariant.go @@ -180,7 +180,11 @@ func NewQVariant11(str string) *QVariant { // NewQVariant12 constructs a new QVariant object. func NewQVariant12(bytearray []byte) *QVariant { bytearray_alias := C.struct_miqt_string{} - bytearray_alias.data = (*C.char)(unsafe.Pointer(&bytearray[0])) + if len(bytearray) > 0 { + bytearray_alias.data = (*C.char)(unsafe.Pointer(&bytearray[0])) + } else { + bytearray_alias.data = (*C.char)(unsafe.Pointer(nil)) + } bytearray_alias.len = C.size_t(len(bytearray)) return newQVariant(C.QVariant_new12(bytearray_alias)) diff --git a/qt6/gen_qwidget.go b/qt6/gen_qwidget.go index 738b71e6..1289eeb6 100644 --- a/qt6/gen_qwidget.go +++ b/qt6/gen_qwidget.go @@ -1039,7 +1039,11 @@ func (this *QWidget) SaveGeometry() []byte { func (this *QWidget) RestoreGeometry(geometry []byte) bool { geometry_alias := C.struct_miqt_string{} - geometry_alias.data = (*C.char)(unsafe.Pointer(&geometry[0])) + if len(geometry) > 0 { + geometry_alias.data = (*C.char)(unsafe.Pointer(&geometry[0])) + } else { + geometry_alias.data = (*C.char)(unsafe.Pointer(nil)) + } geometry_alias.len = C.size_t(len(geometry)) return (bool)(C.QWidget_RestoreGeometry(this.h, geometry_alias)) } @@ -2379,7 +2383,11 @@ func miqt_exec_callback_QWidget_HideEvent(self *C.QWidget, cb C.intptr_t, event func (this *QWidget) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QWidget_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qwindow.go b/qt6/gen_qwindow.go index 14a9a4ab..d85608c0 100644 --- a/qt6/gen_qwindow.go +++ b/qt6/gen_qwindow.go @@ -1641,7 +1641,11 @@ func miqt_exec_callback_QWindow_TabletEvent(self *C.QWindow, cb C.intptr_t, para func (this *QWindow) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QWindow_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qwizard.go b/qt6/gen_qwizard.go index 42e4696d..fdb7f88f 100644 --- a/qt6/gen_qwizard.go +++ b/qt6/gen_qwizard.go @@ -1568,7 +1568,11 @@ func miqt_exec_callback_QWizard_HideEvent(self *C.QWizard, cb C.intptr_t, event func (this *QWizard) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QWizard_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) @@ -3119,7 +3123,11 @@ func miqt_exec_callback_QWizardPage_HideEvent(self *C.QWizardPage, cb C.intptr_t func (this *QWizardPage) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QWizardPage_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/gen_qxmlstream.go b/qt6/gen_qxmlstream.go index 5cbf5d2f..36624af2 100644 --- a/qt6/gen_qxmlstream.go +++ b/qt6/gen_qxmlstream.go @@ -466,7 +466,11 @@ func NewQXmlStreamReader2(device *QIODevice) *QXmlStreamReader { // NewQXmlStreamReader3 constructs a new QXmlStreamReader object. func NewQXmlStreamReader3(data []byte) *QXmlStreamReader { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return newQXmlStreamReader(C.QXmlStreamReader_new3(data_alias)) @@ -500,7 +504,11 @@ func (this *QXmlStreamReader) Device() *QIODevice { func (this *QXmlStreamReader) AddData(data []byte) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) C.QXmlStreamReader_AddData(this.h, data_alias) } diff --git a/qt6/multimedia/gen_qaudiobuffer.go b/qt6/multimedia/gen_qaudiobuffer.go index bc32c57b..dadfd3a0 100644 --- a/qt6/multimedia/gen_qaudiobuffer.go +++ b/qt6/multimedia/gen_qaudiobuffer.go @@ -60,7 +60,11 @@ func NewQAudioBuffer2(other *QAudioBuffer) *QAudioBuffer { // NewQAudioBuffer3 constructs a new QAudioBuffer object. func NewQAudioBuffer3(data []byte, format *QAudioFormat) *QAudioBuffer { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return newQAudioBuffer(C.QAudioBuffer_new3(data_alias, format.cPointer())) @@ -75,7 +79,11 @@ func NewQAudioBuffer4(numFrames int, format *QAudioFormat) *QAudioBuffer { // NewQAudioBuffer5 constructs a new QAudioBuffer object. func NewQAudioBuffer5(data []byte, format *QAudioFormat, startTime int64) *QAudioBuffer { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return newQAudioBuffer(C.QAudioBuffer_new5(data_alias, format.cPointer(), (C.longlong)(startTime))) diff --git a/qt6/multimedia/gen_qvideowidget.go b/qt6/multimedia/gen_qvideowidget.go index b146cb02..5f63dae3 100644 --- a/qt6/multimedia/gen_qvideowidget.go +++ b/qt6/multimedia/gen_qvideowidget.go @@ -1003,7 +1003,11 @@ func miqt_exec_callback_QVideoWidget_DropEvent(self *C.QVideoWidget, cb C.intptr func (this *QVideoWidget) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QVideoWidget_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/network/gen_qabstractnetworkcache.go b/qt6/network/gen_qabstractnetworkcache.go index 7e3f547e..605bbff4 100644 --- a/qt6/network/gen_qabstractnetworkcache.go +++ b/qt6/network/gen_qabstractnetworkcache.go @@ -130,11 +130,19 @@ func (this *QNetworkCacheMetaData) SetRawHeaders(headers []struct { headers_i_Second_CArray := (*[0xffff]C.struct_miqt_string)(C.malloc(C.size_t(int(unsafe.Sizeof(C.struct_miqt_string{}))))) defer C.free(unsafe.Pointer(headers_i_Second_CArray)) headers_i_First_alias := C.struct_miqt_string{} - headers_i_First_alias.data = (*C.char)(unsafe.Pointer(&headers[i].First[0])) + if len(headers[i].First) > 0 { + headers_i_First_alias.data = (*C.char)(unsafe.Pointer(&headers[i].First[0])) + } else { + headers_i_First_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headers_i_First_alias.len = C.size_t(len(headers[i].First)) headers_i_First_CArray[0] = headers_i_First_alias headers_i_Second_alias := C.struct_miqt_string{} - headers_i_Second_alias.data = (*C.char)(unsafe.Pointer(&headers[i].Second[0])) + if len(headers[i].Second) > 0 { + headers_i_Second_alias.data = (*C.char)(unsafe.Pointer(&headers[i].Second[0])) + } else { + headers_i_Second_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headers_i_Second_alias.len = C.size_t(len(headers[i].Second)) headers_i_Second_CArray[0] = headers_i_Second_alias headers_i_pair := C.struct_miqt_map{ diff --git a/qt6/network/gen_qdtls.go b/qt6/network/gen_qdtls.go index 0ed8bedb..75eba511 100644 --- a/qt6/network/gen_qdtls.go +++ b/qt6/network/gen_qdtls.go @@ -117,7 +117,11 @@ func (this *QDtlsClientVerifier) CookieGeneratorParameters() *QDtlsClientVerifie func (this *QDtlsClientVerifier) VerifyClient(socket *QUdpSocket, dgram []byte, address *QHostAddress, port uint16) bool { dgram_alias := C.struct_miqt_string{} - dgram_alias.data = (*C.char)(unsafe.Pointer(&dgram[0])) + if len(dgram) > 0 { + dgram_alias.data = (*C.char)(unsafe.Pointer(&dgram[0])) + } else { + dgram_alias.data = (*C.char)(unsafe.Pointer(nil)) + } dgram_alias.len = C.size_t(len(dgram)) return (bool)(C.QDtlsClientVerifier_VerifyClient(this.h, socket.cPointer(), dgram_alias, address.cPointer(), (C.uint16_t)(port))) } @@ -532,14 +536,22 @@ func (this *QDtls) SessionProtocol() QSsl__SslProtocol { func (this *QDtls) WriteDatagramEncrypted(socket *QUdpSocket, dgram []byte) int64 { dgram_alias := C.struct_miqt_string{} - dgram_alias.data = (*C.char)(unsafe.Pointer(&dgram[0])) + if len(dgram) > 0 { + dgram_alias.data = (*C.char)(unsafe.Pointer(&dgram[0])) + } else { + dgram_alias.data = (*C.char)(unsafe.Pointer(nil)) + } dgram_alias.len = C.size_t(len(dgram)) return (int64)(C.QDtls_WriteDatagramEncrypted(this.h, socket.cPointer(), dgram_alias)) } func (this *QDtls) DecryptDatagram(socket *QUdpSocket, dgram []byte) []byte { dgram_alias := C.struct_miqt_string{} - dgram_alias.data = (*C.char)(unsafe.Pointer(&dgram[0])) + if len(dgram) > 0 { + dgram_alias.data = (*C.char)(unsafe.Pointer(&dgram[0])) + } else { + dgram_alias.data = (*C.char)(unsafe.Pointer(nil)) + } dgram_alias.len = C.size_t(len(dgram)) var _bytearray C.struct_miqt_string = C.QDtls_DecryptDatagram(this.h, socket.cPointer(), dgram_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) @@ -649,7 +661,11 @@ func (this *QDtls) SetPeer3(address *QHostAddress, port uint16, verificationName func (this *QDtls) DoHandshake2(socket *QUdpSocket, dgram []byte) bool { dgram_alias := C.struct_miqt_string{} - dgram_alias.data = (*C.char)(unsafe.Pointer(&dgram[0])) + if len(dgram) > 0 { + dgram_alias.data = (*C.char)(unsafe.Pointer(&dgram[0])) + } else { + dgram_alias.data = (*C.char)(unsafe.Pointer(nil)) + } dgram_alias.len = C.size_t(len(dgram)) return (bool)(C.QDtls_DoHandshake2(this.h, socket.cPointer(), dgram_alias)) } @@ -897,7 +913,11 @@ func NewQDtlsClientVerifier__GeneratorParameters() *QDtlsClientVerifier__Generat // NewQDtlsClientVerifier__GeneratorParameters2 constructs a new QDtlsClientVerifier::GeneratorParameters object. func NewQDtlsClientVerifier__GeneratorParameters2(a qt6.QCryptographicHash__Algorithm, s []byte) *QDtlsClientVerifier__GeneratorParameters { s_alias := C.struct_miqt_string{} - s_alias.data = (*C.char)(unsafe.Pointer(&s[0])) + if len(s) > 0 { + s_alias.data = (*C.char)(unsafe.Pointer(&s[0])) + } else { + s_alias.data = (*C.char)(unsafe.Pointer(nil)) + } s_alias.len = C.size_t(len(s)) return newQDtlsClientVerifier__GeneratorParameters(C.QDtlsClientVerifier__GeneratorParameters_new2((C.int)(a), s_alias)) diff --git a/qt6/network/gen_qhttpmultipart.go b/qt6/network/gen_qhttpmultipart.go index 522a9a9e..c81acaeb 100644 --- a/qt6/network/gen_qhttpmultipart.go +++ b/qt6/network/gen_qhttpmultipart.go @@ -90,17 +90,29 @@ func (this *QHttpPart) SetHeader(header QNetworkRequest__KnownHeaders, value *qt func (this *QHttpPart) SetRawHeader(headerName []byte, headerValue []byte) { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) headerValue_alias := C.struct_miqt_string{} - headerValue_alias.data = (*C.char)(unsafe.Pointer(&headerValue[0])) + if len(headerValue) > 0 { + headerValue_alias.data = (*C.char)(unsafe.Pointer(&headerValue[0])) + } else { + headerValue_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerValue_alias.len = C.size_t(len(headerValue)) C.QHttpPart_SetRawHeader(this.h, headerName_alias, headerValue_alias) } func (this *QHttpPart) SetBody(body []byte) { body_alias := C.struct_miqt_string{} - body_alias.data = (*C.char)(unsafe.Pointer(&body[0])) + if len(body) > 0 { + body_alias.data = (*C.char)(unsafe.Pointer(&body[0])) + } else { + body_alias.data = (*C.char)(unsafe.Pointer(nil)) + } body_alias.len = C.size_t(len(body)) C.QHttpPart_SetBody(this.h, body_alias) } @@ -219,7 +231,11 @@ func (this *QHttpMultiPart) Boundary() []byte { func (this *QHttpMultiPart) SetBoundary(boundary []byte) { boundary_alias := C.struct_miqt_string{} - boundary_alias.data = (*C.char)(unsafe.Pointer(&boundary[0])) + if len(boundary) > 0 { + boundary_alias.data = (*C.char)(unsafe.Pointer(&boundary[0])) + } else { + boundary_alias.data = (*C.char)(unsafe.Pointer(nil)) + } boundary_alias.len = C.size_t(len(boundary)) C.QHttpMultiPart_SetBoundary(this.h, boundary_alias) } diff --git a/qt6/network/gen_qnetworkaccessmanager.go b/qt6/network/gen_qnetworkaccessmanager.go index 53d61814..17734d7d 100644 --- a/qt6/network/gen_qnetworkaccessmanager.go +++ b/qt6/network/gen_qnetworkaccessmanager.go @@ -201,7 +201,11 @@ func (this *QNetworkAccessManager) Post(request *QNetworkRequest, data *qt6.QIOD func (this *QNetworkAccessManager) Post2(request *QNetworkRequest, data []byte) *QNetworkReply { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return newQNetworkReply(C.QNetworkAccessManager_Post2(this.h, request.cPointer(), data_alias)) } @@ -212,7 +216,11 @@ func (this *QNetworkAccessManager) Put(request *QNetworkRequest, data *qt6.QIODe func (this *QNetworkAccessManager) Put2(request *QNetworkRequest, data []byte) *QNetworkReply { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return newQNetworkReply(C.QNetworkAccessManager_Put2(this.h, request.cPointer(), data_alias)) } @@ -223,17 +231,29 @@ func (this *QNetworkAccessManager) DeleteResource(request *QNetworkRequest) *QNe func (this *QNetworkAccessManager) SendCustomRequest(request *QNetworkRequest, verb []byte) *QNetworkReply { verb_alias := C.struct_miqt_string{} - verb_alias.data = (*C.char)(unsafe.Pointer(&verb[0])) + if len(verb) > 0 { + verb_alias.data = (*C.char)(unsafe.Pointer(&verb[0])) + } else { + verb_alias.data = (*C.char)(unsafe.Pointer(nil)) + } verb_alias.len = C.size_t(len(verb)) return newQNetworkReply(C.QNetworkAccessManager_SendCustomRequest(this.h, request.cPointer(), verb_alias)) } func (this *QNetworkAccessManager) SendCustomRequest2(request *QNetworkRequest, verb []byte, data []byte) *QNetworkReply { verb_alias := C.struct_miqt_string{} - verb_alias.data = (*C.char)(unsafe.Pointer(&verb[0])) + if len(verb) > 0 { + verb_alias.data = (*C.char)(unsafe.Pointer(&verb[0])) + } else { + verb_alias.data = (*C.char)(unsafe.Pointer(nil)) + } verb_alias.len = C.size_t(len(verb)) data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return newQNetworkReply(C.QNetworkAccessManager_SendCustomRequest2(this.h, request.cPointer(), verb_alias, data_alias)) } @@ -248,7 +268,11 @@ func (this *QNetworkAccessManager) Put3(request *QNetworkRequest, multiPart *QHt func (this *QNetworkAccessManager) SendCustomRequest3(request *QNetworkRequest, verb []byte, multiPart *QHttpMultiPart) *QNetworkReply { verb_alias := C.struct_miqt_string{} - verb_alias.data = (*C.char)(unsafe.Pointer(&verb[0])) + if len(verb) > 0 { + verb_alias.data = (*C.char)(unsafe.Pointer(&verb[0])) + } else { + verb_alias.data = (*C.char)(unsafe.Pointer(nil)) + } verb_alias.len = C.size_t(len(verb)) return newQNetworkReply(C.QNetworkAccessManager_SendCustomRequest3(this.h, request.cPointer(), verb_alias, multiPart.cPointer())) } @@ -479,7 +503,11 @@ func (this *QNetworkAccessManager) EnableStrictTransportSecurityStore2(enabled b func (this *QNetworkAccessManager) SendCustomRequest32(request *QNetworkRequest, verb []byte, data *qt6.QIODevice) *QNetworkReply { verb_alias := C.struct_miqt_string{} - verb_alias.data = (*C.char)(unsafe.Pointer(&verb[0])) + if len(verb) > 0 { + verb_alias.data = (*C.char)(unsafe.Pointer(&verb[0])) + } else { + verb_alias.data = (*C.char)(unsafe.Pointer(nil)) + } verb_alias.len = C.size_t(len(verb)) return newQNetworkReply(C.QNetworkAccessManager_SendCustomRequest32(this.h, request.cPointer(), verb_alias, (*C.QIODevice)(data.UnsafePointer()))) } diff --git a/qt6/network/gen_qnetworkcookie.go b/qt6/network/gen_qnetworkcookie.go index d722d8be..af5ea0b8 100644 --- a/qt6/network/gen_qnetworkcookie.go +++ b/qt6/network/gen_qnetworkcookie.go @@ -77,7 +77,11 @@ func NewQNetworkCookie2(other *QNetworkCookie) *QNetworkCookie { // NewQNetworkCookie3 constructs a new QNetworkCookie object. func NewQNetworkCookie3(name []byte) *QNetworkCookie { name_alias := C.struct_miqt_string{} - name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + if len(name) > 0 { + name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + } else { + name_alias.data = (*C.char)(unsafe.Pointer(nil)) + } name_alias.len = C.size_t(len(name)) return newQNetworkCookie(C.QNetworkCookie_new3(name_alias)) @@ -86,10 +90,18 @@ func NewQNetworkCookie3(name []byte) *QNetworkCookie { // NewQNetworkCookie4 constructs a new QNetworkCookie object. func NewQNetworkCookie4(name []byte, value []byte) *QNetworkCookie { name_alias := C.struct_miqt_string{} - name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + if len(name) > 0 { + name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + } else { + name_alias.data = (*C.char)(unsafe.Pointer(nil)) + } name_alias.len = C.size_t(len(name)) value_alias := C.struct_miqt_string{} - value_alias.data = (*C.char)(unsafe.Pointer(&value[0])) + if len(value) > 0 { + value_alias.data = (*C.char)(unsafe.Pointer(&value[0])) + } else { + value_alias.data = (*C.char)(unsafe.Pointer(nil)) + } value_alias.len = C.size_t(len(value)) return newQNetworkCookie(C.QNetworkCookie_new4(name_alias, value_alias)) @@ -188,7 +200,11 @@ func (this *QNetworkCookie) Name() []byte { func (this *QNetworkCookie) SetName(cookieName []byte) { cookieName_alias := C.struct_miqt_string{} - cookieName_alias.data = (*C.char)(unsafe.Pointer(&cookieName[0])) + if len(cookieName) > 0 { + cookieName_alias.data = (*C.char)(unsafe.Pointer(&cookieName[0])) + } else { + cookieName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } cookieName_alias.len = C.size_t(len(cookieName)) C.QNetworkCookie_SetName(this.h, cookieName_alias) } @@ -202,7 +218,11 @@ func (this *QNetworkCookie) Value() []byte { func (this *QNetworkCookie) SetValue(value []byte) { value_alias := C.struct_miqt_string{} - value_alias.data = (*C.char)(unsafe.Pointer(&value[0])) + if len(value) > 0 { + value_alias.data = (*C.char)(unsafe.Pointer(&value[0])) + } else { + value_alias.data = (*C.char)(unsafe.Pointer(nil)) + } value_alias.len = C.size_t(len(value)) C.QNetworkCookie_SetValue(this.h, value_alias) } @@ -224,7 +244,11 @@ func (this *QNetworkCookie) Normalize(url *qt6.QUrl) { func QNetworkCookie_ParseCookies(cookieString []byte) []QNetworkCookie { cookieString_alias := C.struct_miqt_string{} - cookieString_alias.data = (*C.char)(unsafe.Pointer(&cookieString[0])) + if len(cookieString) > 0 { + cookieString_alias.data = (*C.char)(unsafe.Pointer(&cookieString[0])) + } else { + cookieString_alias.data = (*C.char)(unsafe.Pointer(nil)) + } cookieString_alias.len = C.size_t(len(cookieString)) var _ma C.struct_miqt_array = C.QNetworkCookie_ParseCookies(cookieString_alias) _ret := make([]QNetworkCookie, int(_ma.len)) diff --git a/qt6/network/gen_qnetworkdatagram.go b/qt6/network/gen_qnetworkdatagram.go index 17b7ac60..dc9afe1e 100644 --- a/qt6/network/gen_qnetworkdatagram.go +++ b/qt6/network/gen_qnetworkdatagram.go @@ -54,7 +54,11 @@ func NewQNetworkDatagram() *QNetworkDatagram { // NewQNetworkDatagram2 constructs a new QNetworkDatagram object. func NewQNetworkDatagram2(data []byte) *QNetworkDatagram { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return newQNetworkDatagram(C.QNetworkDatagram_new2(data_alias)) @@ -69,7 +73,11 @@ func NewQNetworkDatagram3(other *QNetworkDatagram) *QNetworkDatagram { // NewQNetworkDatagram4 constructs a new QNetworkDatagram object. func NewQNetworkDatagram4(data []byte, destinationAddress *QHostAddress) *QNetworkDatagram { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return newQNetworkDatagram(C.QNetworkDatagram_new4(data_alias, destinationAddress.cPointer())) @@ -78,7 +86,11 @@ func NewQNetworkDatagram4(data []byte, destinationAddress *QHostAddress) *QNetwo // NewQNetworkDatagram5 constructs a new QNetworkDatagram object. func NewQNetworkDatagram5(data []byte, destinationAddress *QHostAddress, port uint16) *QNetworkDatagram { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return newQNetworkDatagram(C.QNetworkDatagram_new5(data_alias, destinationAddress.cPointer(), (C.uint16_t)(port))) @@ -157,14 +169,22 @@ func (this *QNetworkDatagram) Data() []byte { func (this *QNetworkDatagram) SetData(data []byte) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) C.QNetworkDatagram_SetData(this.h, data_alias) } func (this *QNetworkDatagram) MakeReply(payload []byte) *QNetworkDatagram { payload_alias := C.struct_miqt_string{} - payload_alias.data = (*C.char)(unsafe.Pointer(&payload[0])) + if len(payload) > 0 { + payload_alias.data = (*C.char)(unsafe.Pointer(&payload[0])) + } else { + payload_alias.data = (*C.char)(unsafe.Pointer(nil)) + } payload_alias.len = C.size_t(len(payload)) _goptr := newQNetworkDatagram(C.QNetworkDatagram_MakeReply(this.h, payload_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer diff --git a/qt6/network/gen_qnetworkproxy.go b/qt6/network/gen_qnetworkproxy.go index 72ae403d..a106a82a 100644 --- a/qt6/network/gen_qnetworkproxy.go +++ b/qt6/network/gen_qnetworkproxy.go @@ -480,7 +480,11 @@ func (this *QNetworkProxy) SetHeader(header QNetworkRequest__KnownHeaders, value func (this *QNetworkProxy) HasRawHeader(headerName []byte) bool { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) return (bool)(C.QNetworkProxy_HasRawHeader(this.h, headerName_alias)) } @@ -500,7 +504,11 @@ func (this *QNetworkProxy) RawHeaderList() [][]byte { func (this *QNetworkProxy) RawHeader(headerName []byte) []byte { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) var _bytearray C.struct_miqt_string = C.QNetworkProxy_RawHeader(this.h, headerName_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) @@ -510,10 +518,18 @@ func (this *QNetworkProxy) RawHeader(headerName []byte) []byte { func (this *QNetworkProxy) SetRawHeader(headerName []byte, value []byte) { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) value_alias := C.struct_miqt_string{} - value_alias.data = (*C.char)(unsafe.Pointer(&value[0])) + if len(value) > 0 { + value_alias.data = (*C.char)(unsafe.Pointer(&value[0])) + } else { + value_alias.data = (*C.char)(unsafe.Pointer(nil)) + } value_alias.len = C.size_t(len(value)) C.QNetworkProxy_SetRawHeader(this.h, headerName_alias, value_alias) } diff --git a/qt6/network/gen_qnetworkreply.go b/qt6/network/gen_qnetworkreply.go index 3c57a6ce..b69921df 100644 --- a/qt6/network/gen_qnetworkreply.go +++ b/qt6/network/gen_qnetworkreply.go @@ -165,7 +165,11 @@ func (this *QNetworkReply) Header(header QNetworkRequest__KnownHeaders) *qt6.QVa func (this *QNetworkReply) HasRawHeader(headerName []byte) bool { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) return (bool)(C.QNetworkReply_HasRawHeader(this.h, headerName_alias)) } @@ -185,7 +189,11 @@ func (this *QNetworkReply) RawHeaderList() [][]byte { func (this *QNetworkReply) RawHeader(headerName []byte) []byte { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) var _bytearray C.struct_miqt_string = C.QNetworkReply_RawHeader(this.h, headerName_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) diff --git a/qt6/network/gen_qnetworkrequest.go b/qt6/network/gen_qnetworkrequest.go index b6f09c13..8bb22679 100644 --- a/qt6/network/gen_qnetworkrequest.go +++ b/qt6/network/gen_qnetworkrequest.go @@ -194,7 +194,11 @@ func (this *QNetworkRequest) SetHeader(header QNetworkRequest__KnownHeaders, val func (this *QNetworkRequest) HasRawHeader(headerName []byte) bool { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) return (bool)(C.QNetworkRequest_HasRawHeader(this.h, headerName_alias)) } @@ -214,7 +218,11 @@ func (this *QNetworkRequest) RawHeaderList() [][]byte { func (this *QNetworkRequest) RawHeader(headerName []byte) []byte { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) var _bytearray C.struct_miqt_string = C.QNetworkRequest_RawHeader(this.h, headerName_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) @@ -224,10 +232,18 @@ func (this *QNetworkRequest) RawHeader(headerName []byte) []byte { func (this *QNetworkRequest) SetRawHeader(headerName []byte, value []byte) { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) value_alias := C.struct_miqt_string{} - value_alias.data = (*C.char)(unsafe.Pointer(&value[0])) + if len(value) > 0 { + value_alias.data = (*C.char)(unsafe.Pointer(&value[0])) + } else { + value_alias.data = (*C.char)(unsafe.Pointer(nil)) + } value_alias.len = C.size_t(len(value)) C.QNetworkRequest_SetRawHeader(this.h, headerName_alias, value_alias) } diff --git a/qt6/network/gen_qsslcertificate.go b/qt6/network/gen_qsslcertificate.go index ad8c7c62..ee0b6d26 100644 --- a/qt6/network/gen_qsslcertificate.go +++ b/qt6/network/gen_qsslcertificate.go @@ -95,7 +95,11 @@ func NewQSslCertificate4(device *qt6.QIODevice, format QSsl__EncodingFormat) *QS // NewQSslCertificate5 constructs a new QSslCertificate object. func NewQSslCertificate5(data []byte) *QSslCertificate { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return newQSslCertificate(C.QSslCertificate_new5(data_alias)) @@ -104,7 +108,11 @@ func NewQSslCertificate5(data []byte) *QSslCertificate { // NewQSslCertificate6 constructs a new QSslCertificate object. func NewQSslCertificate6(data []byte, format QSsl__EncodingFormat) *QSslCertificate { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) return newQSslCertificate(C.QSslCertificate_new6(data_alias, (C.int)(format))) @@ -178,7 +186,11 @@ func (this *QSslCertificate) IssuerInfo(info QSslCertificate__SubjectInfo) []str func (this *QSslCertificate) IssuerInfoWithAttribute(attribute []byte) []string { attribute_alias := C.struct_miqt_string{} - attribute_alias.data = (*C.char)(unsafe.Pointer(&attribute[0])) + if len(attribute) > 0 { + attribute_alias.data = (*C.char)(unsafe.Pointer(&attribute[0])) + } else { + attribute_alias.data = (*C.char)(unsafe.Pointer(nil)) + } attribute_alias.len = C.size_t(len(attribute)) var _ma C.struct_miqt_array = C.QSslCertificate_IssuerInfoWithAttribute(this.h, attribute_alias) _ret := make([]string, int(_ma.len)) @@ -207,7 +219,11 @@ func (this *QSslCertificate) SubjectInfo(info QSslCertificate__SubjectInfo) []st func (this *QSslCertificate) SubjectInfoWithAttribute(attribute []byte) []string { attribute_alias := C.struct_miqt_string{} - attribute_alias.data = (*C.char)(unsafe.Pointer(&attribute[0])) + if len(attribute) > 0 { + attribute_alias.data = (*C.char)(unsafe.Pointer(&attribute[0])) + } else { + attribute_alias.data = (*C.char)(unsafe.Pointer(nil)) + } attribute_alias.len = C.size_t(len(attribute)) var _ma C.struct_miqt_array = C.QSslCertificate_SubjectInfoWithAttribute(this.h, attribute_alias) _ret := make([]string, int(_ma.len)) @@ -342,7 +358,11 @@ func QSslCertificate_FromDevice(device *qt6.QIODevice) []QSslCertificate { func QSslCertificate_FromData(data []byte) []QSslCertificate { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) var _ma C.struct_miqt_array = C.QSslCertificate_FromData(data_alias) _ret := make([]QSslCertificate, int(_ma.len)) @@ -434,7 +454,11 @@ func QSslCertificate_FromDevice2(device *qt6.QIODevice, format QSsl__EncodingFor func QSslCertificate_FromData2(data []byte, format QSsl__EncodingFormat) []QSslCertificate { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) var _ma C.struct_miqt_array = C.QSslCertificate_FromData2(data_alias, (C.int)(format)) _ret := make([]QSslCertificate, int(_ma.len)) @@ -487,7 +511,11 @@ func QSslCertificate_ImportPkcs125(device *qt6.QIODevice, key *QSslKey, cert *QS } caCertificates_ma := C.struct_miqt_array{len: C.size_t(len(caCertificates)), data: unsafe.Pointer(caCertificates_CArray)} passPhrase_alias := C.struct_miqt_string{} - passPhrase_alias.data = (*C.char)(unsafe.Pointer(&passPhrase[0])) + if len(passPhrase) > 0 { + passPhrase_alias.data = (*C.char)(unsafe.Pointer(&passPhrase[0])) + } else { + passPhrase_alias.data = (*C.char)(unsafe.Pointer(nil)) + } passPhrase_alias.len = C.size_t(len(passPhrase)) return (bool)(C.QSslCertificate_ImportPkcs125((*C.QIODevice)(device.UnsafePointer()), key.cPointer(), cert.cPointer(), caCertificates_ma, passPhrase_alias)) } diff --git a/qt6/network/gen_qsslconfiguration.go b/qt6/network/gen_qsslconfiguration.go index 55eed5dd..81ff0921 100644 --- a/qt6/network/gen_qsslconfiguration.go +++ b/qt6/network/gen_qsslconfiguration.go @@ -295,7 +295,11 @@ func (this *QSslConfiguration) SessionTicket() []byte { func (this *QSslConfiguration) SetSessionTicket(sessionTicket []byte) { sessionTicket_alias := C.struct_miqt_string{} - sessionTicket_alias.data = (*C.char)(unsafe.Pointer(&sessionTicket[0])) + if len(sessionTicket) > 0 { + sessionTicket_alias.data = (*C.char)(unsafe.Pointer(&sessionTicket[0])) + } else { + sessionTicket_alias.data = (*C.char)(unsafe.Pointer(nil)) + } sessionTicket_alias.len = C.size_t(len(sessionTicket)) C.QSslConfiguration_SetSessionTicket(this.h, sessionTicket_alias) } @@ -353,7 +357,11 @@ func (this *QSslConfiguration) PreSharedKeyIdentityHint() []byte { func (this *QSslConfiguration) SetPreSharedKeyIdentityHint(hint []byte) { hint_alias := C.struct_miqt_string{} - hint_alias.data = (*C.char)(unsafe.Pointer(&hint[0])) + if len(hint) > 0 { + hint_alias.data = (*C.char)(unsafe.Pointer(&hint[0])) + } else { + hint_alias.data = (*C.char)(unsafe.Pointer(nil)) + } hint_alias.len = C.size_t(len(hint)) C.QSslConfiguration_SetPreSharedKeyIdentityHint(this.h, hint_alias) } @@ -370,7 +378,11 @@ func (this *QSslConfiguration) SetDiffieHellmanParameters(dhparams *QSslDiffieHe func (this *QSslConfiguration) SetBackendConfigurationOption(name []byte, value *qt6.QVariant) { name_alias := C.struct_miqt_string{} - name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + if len(name) > 0 { + name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + } else { + name_alias.data = (*C.char)(unsafe.Pointer(nil)) + } name_alias.len = C.size_t(len(name)) C.QSslConfiguration_SetBackendConfigurationOption(this.h, name_alias, (*C.QVariant)(value.UnsafePointer())) } @@ -436,7 +448,11 @@ func (this *QSslConfiguration) SetAllowedNextProtocols(protocols [][]byte) { defer C.free(unsafe.Pointer(protocols_CArray)) for i := range protocols { protocols_i_alias := C.struct_miqt_string{} - protocols_i_alias.data = (*C.char)(unsafe.Pointer(&protocols[i][0])) + if len(protocols[i]) > 0 { + protocols_i_alias.data = (*C.char)(unsafe.Pointer(&protocols[i][0])) + } else { + protocols_i_alias.data = (*C.char)(unsafe.Pointer(nil)) + } protocols_i_alias.len = C.size_t(len(protocols[i])) protocols_CArray[i] = protocols_i_alias } diff --git a/qt6/network/gen_qssldiffiehellmanparameters.go b/qt6/network/gen_qssldiffiehellmanparameters.go index feafb134..7ccb5d58 100644 --- a/qt6/network/gen_qssldiffiehellmanparameters.go +++ b/qt6/network/gen_qssldiffiehellmanparameters.go @@ -82,7 +82,11 @@ func (this *QSslDiffieHellmanParameters) Swap(other *QSslDiffieHellmanParameters func QSslDiffieHellmanParameters_FromEncoded(encoded []byte) *QSslDiffieHellmanParameters { encoded_alias := C.struct_miqt_string{} - encoded_alias.data = (*C.char)(unsafe.Pointer(&encoded[0])) + if len(encoded) > 0 { + encoded_alias.data = (*C.char)(unsafe.Pointer(&encoded[0])) + } else { + encoded_alias.data = (*C.char)(unsafe.Pointer(nil)) + } encoded_alias.len = C.size_t(len(encoded)) _goptr := newQSslDiffieHellmanParameters(C.QSslDiffieHellmanParameters_FromEncoded(encoded_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer @@ -116,7 +120,11 @@ func (this *QSslDiffieHellmanParameters) ErrorString() string { func QSslDiffieHellmanParameters_FromEncoded2(encoded []byte, format QSsl__EncodingFormat) *QSslDiffieHellmanParameters { encoded_alias := C.struct_miqt_string{} - encoded_alias.data = (*C.char)(unsafe.Pointer(&encoded[0])) + if len(encoded) > 0 { + encoded_alias.data = (*C.char)(unsafe.Pointer(&encoded[0])) + } else { + encoded_alias.data = (*C.char)(unsafe.Pointer(nil)) + } encoded_alias.len = C.size_t(len(encoded)) _goptr := newQSslDiffieHellmanParameters(C.QSslDiffieHellmanParameters_FromEncoded2(encoded_alias, (C.int)(format))) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer diff --git a/qt6/network/gen_qsslkey.go b/qt6/network/gen_qsslkey.go index ec83cfb9..3f0a2bf2 100644 --- a/qt6/network/gen_qsslkey.go +++ b/qt6/network/gen_qsslkey.go @@ -55,7 +55,11 @@ func NewQSslKey() *QSslKey { // NewQSslKey2 constructs a new QSslKey object. func NewQSslKey2(encoded []byte, algorithm QSsl__KeyAlgorithm) *QSslKey { encoded_alias := C.struct_miqt_string{} - encoded_alias.data = (*C.char)(unsafe.Pointer(&encoded[0])) + if len(encoded) > 0 { + encoded_alias.data = (*C.char)(unsafe.Pointer(&encoded[0])) + } else { + encoded_alias.data = (*C.char)(unsafe.Pointer(nil)) + } encoded_alias.len = C.size_t(len(encoded)) return newQSslKey(C.QSslKey_new2(encoded_alias, (C.int)(algorithm))) @@ -82,7 +86,11 @@ func NewQSslKey5(other *QSslKey) *QSslKey { // NewQSslKey6 constructs a new QSslKey object. func NewQSslKey6(encoded []byte, algorithm QSsl__KeyAlgorithm, format QSsl__EncodingFormat) *QSslKey { encoded_alias := C.struct_miqt_string{} - encoded_alias.data = (*C.char)(unsafe.Pointer(&encoded[0])) + if len(encoded) > 0 { + encoded_alias.data = (*C.char)(unsafe.Pointer(&encoded[0])) + } else { + encoded_alias.data = (*C.char)(unsafe.Pointer(nil)) + } encoded_alias.len = C.size_t(len(encoded)) return newQSslKey(C.QSslKey_new6(encoded_alias, (C.int)(algorithm), (C.int)(format))) @@ -91,7 +99,11 @@ func NewQSslKey6(encoded []byte, algorithm QSsl__KeyAlgorithm, format QSsl__Enco // NewQSslKey7 constructs a new QSslKey object. func NewQSslKey7(encoded []byte, algorithm QSsl__KeyAlgorithm, format QSsl__EncodingFormat, typeVal QSsl__KeyType) *QSslKey { encoded_alias := C.struct_miqt_string{} - encoded_alias.data = (*C.char)(unsafe.Pointer(&encoded[0])) + if len(encoded) > 0 { + encoded_alias.data = (*C.char)(unsafe.Pointer(&encoded[0])) + } else { + encoded_alias.data = (*C.char)(unsafe.Pointer(nil)) + } encoded_alias.len = C.size_t(len(encoded)) return newQSslKey(C.QSslKey_new7(encoded_alias, (C.int)(algorithm), (C.int)(format), (C.int)(typeVal))) @@ -100,10 +112,18 @@ func NewQSslKey7(encoded []byte, algorithm QSsl__KeyAlgorithm, format QSsl__Enco // NewQSslKey8 constructs a new QSslKey object. func NewQSslKey8(encoded []byte, algorithm QSsl__KeyAlgorithm, format QSsl__EncodingFormat, typeVal QSsl__KeyType, passPhrase []byte) *QSslKey { encoded_alias := C.struct_miqt_string{} - encoded_alias.data = (*C.char)(unsafe.Pointer(&encoded[0])) + if len(encoded) > 0 { + encoded_alias.data = (*C.char)(unsafe.Pointer(&encoded[0])) + } else { + encoded_alias.data = (*C.char)(unsafe.Pointer(nil)) + } encoded_alias.len = C.size_t(len(encoded)) passPhrase_alias := C.struct_miqt_string{} - passPhrase_alias.data = (*C.char)(unsafe.Pointer(&passPhrase[0])) + if len(passPhrase) > 0 { + passPhrase_alias.data = (*C.char)(unsafe.Pointer(&passPhrase[0])) + } else { + passPhrase_alias.data = (*C.char)(unsafe.Pointer(nil)) + } passPhrase_alias.len = C.size_t(len(passPhrase)) return newQSslKey(C.QSslKey_new8(encoded_alias, (C.int)(algorithm), (C.int)(format), (C.int)(typeVal), passPhrase_alias)) @@ -124,7 +144,11 @@ func NewQSslKey10(device *qt6.QIODevice, algorithm QSsl__KeyAlgorithm, format QS // NewQSslKey11 constructs a new QSslKey object. func NewQSslKey11(device *qt6.QIODevice, algorithm QSsl__KeyAlgorithm, format QSsl__EncodingFormat, typeVal QSsl__KeyType, passPhrase []byte) *QSslKey { passPhrase_alias := C.struct_miqt_string{} - passPhrase_alias.data = (*C.char)(unsafe.Pointer(&passPhrase[0])) + if len(passPhrase) > 0 { + passPhrase_alias.data = (*C.char)(unsafe.Pointer(&passPhrase[0])) + } else { + passPhrase_alias.data = (*C.char)(unsafe.Pointer(nil)) + } passPhrase_alias.len = C.size_t(len(passPhrase)) return newQSslKey(C.QSslKey_new11((*C.QIODevice)(device.UnsafePointer()), (C.int)(algorithm), (C.int)(format), (C.int)(typeVal), passPhrase_alias)) @@ -192,7 +216,11 @@ func (this *QSslKey) OperatorNotEqual(key *QSslKey) bool { func (this *QSslKey) ToPem1(passPhrase []byte) []byte { passPhrase_alias := C.struct_miqt_string{} - passPhrase_alias.data = (*C.char)(unsafe.Pointer(&passPhrase[0])) + if len(passPhrase) > 0 { + passPhrase_alias.data = (*C.char)(unsafe.Pointer(&passPhrase[0])) + } else { + passPhrase_alias.data = (*C.char)(unsafe.Pointer(nil)) + } passPhrase_alias.len = C.size_t(len(passPhrase)) var _bytearray C.struct_miqt_string = C.QSslKey_ToPem1(this.h, passPhrase_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) @@ -202,7 +230,11 @@ func (this *QSslKey) ToPem1(passPhrase []byte) []byte { func (this *QSslKey) ToDer1(passPhrase []byte) []byte { passPhrase_alias := C.struct_miqt_string{} - passPhrase_alias.data = (*C.char)(unsafe.Pointer(&passPhrase[0])) + if len(passPhrase) > 0 { + passPhrase_alias.data = (*C.char)(unsafe.Pointer(&passPhrase[0])) + } else { + passPhrase_alias.data = (*C.char)(unsafe.Pointer(nil)) + } passPhrase_alias.len = C.size_t(len(passPhrase)) var _bytearray C.struct_miqt_string = C.QSslKey_ToDer1(this.h, passPhrase_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) diff --git a/qt6/network/gen_qsslpresharedkeyauthenticator.go b/qt6/network/gen_qsslpresharedkeyauthenticator.go index a42c90fd..dc39aa94 100644 --- a/qt6/network/gen_qsslpresharedkeyauthenticator.go +++ b/qt6/network/gen_qsslpresharedkeyauthenticator.go @@ -74,7 +74,11 @@ func (this *QSslPreSharedKeyAuthenticator) IdentityHint() []byte { func (this *QSslPreSharedKeyAuthenticator) SetIdentity(identity []byte) { identity_alias := C.struct_miqt_string{} - identity_alias.data = (*C.char)(unsafe.Pointer(&identity[0])) + if len(identity) > 0 { + identity_alias.data = (*C.char)(unsafe.Pointer(&identity[0])) + } else { + identity_alias.data = (*C.char)(unsafe.Pointer(nil)) + } identity_alias.len = C.size_t(len(identity)) C.QSslPreSharedKeyAuthenticator_SetIdentity(this.h, identity_alias) } @@ -92,7 +96,11 @@ func (this *QSslPreSharedKeyAuthenticator) MaximumIdentityLength() int { func (this *QSslPreSharedKeyAuthenticator) SetPreSharedKey(preSharedKey []byte) { preSharedKey_alias := C.struct_miqt_string{} - preSharedKey_alias.data = (*C.char)(unsafe.Pointer(&preSharedKey[0])) + if len(preSharedKey) > 0 { + preSharedKey_alias.data = (*C.char)(unsafe.Pointer(&preSharedKey[0])) + } else { + preSharedKey_alias.data = (*C.char)(unsafe.Pointer(nil)) + } preSharedKey_alias.len = C.size_t(len(preSharedKey)) C.QSslPreSharedKeyAuthenticator_SetPreSharedKey(this.h, preSharedKey_alias) } diff --git a/qt6/network/gen_qsslsocket.go b/qt6/network/gen_qsslsocket.go index f6e7b6b6..a1395e52 100644 --- a/qt6/network/gen_qsslsocket.go +++ b/qt6/network/gen_qsslsocket.go @@ -812,7 +812,11 @@ func (this *QSslSocket) SetPrivateKey4(fileName string, algorithm QSsl__KeyAlgor fileName_ms.len = C.size_t(len(fileName)) defer C.free(unsafe.Pointer(fileName_ms.data)) passPhrase_alias := C.struct_miqt_string{} - passPhrase_alias.data = (*C.char)(unsafe.Pointer(&passPhrase[0])) + if len(passPhrase) > 0 { + passPhrase_alias.data = (*C.char)(unsafe.Pointer(&passPhrase[0])) + } else { + passPhrase_alias.data = (*C.char)(unsafe.Pointer(nil)) + } passPhrase_alias.len = C.size_t(len(passPhrase)) C.QSslSocket_SetPrivateKey4(this.h, fileName_ms, (C.int)(algorithm), (C.int)(format), passPhrase_alias) } diff --git a/qt6/network/gen_qudpsocket.go b/qt6/network/gen_qudpsocket.go index acd031ca..1e69944e 100644 --- a/qt6/network/gen_qudpsocket.go +++ b/qt6/network/gen_qudpsocket.go @@ -144,7 +144,11 @@ func (this *QUdpSocket) WriteDatagram2(data string, lenVal int64, host *QHostAdd func (this *QUdpSocket) WriteDatagram3(datagram []byte, host *QHostAddress, port uint16) int64 { datagram_alias := C.struct_miqt_string{} - datagram_alias.data = (*C.char)(unsafe.Pointer(&datagram[0])) + if len(datagram) > 0 { + datagram_alias.data = (*C.char)(unsafe.Pointer(&datagram[0])) + } else { + datagram_alias.data = (*C.char)(unsafe.Pointer(nil)) + } datagram_alias.len = C.size_t(len(datagram)) return (int64)(C.QUdpSocket_WriteDatagram3(this.h, datagram_alias, host.cPointer(), (C.uint16_t)(port))) } diff --git a/qt6/printsupport/gen_qabstractprintdialog.go b/qt6/printsupport/gen_qabstractprintdialog.go index 660c03c6..63976eb7 100644 --- a/qt6/printsupport/gen_qabstractprintdialog.go +++ b/qt6/printsupport/gen_qabstractprintdialog.go @@ -1157,7 +1157,11 @@ func miqt_exec_callback_QAbstractPrintDialog_HideEvent(self *C.QAbstractPrintDia func (this *QAbstractPrintDialog) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QAbstractPrintDialog_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/printsupport/gen_qpagesetupdialog.go b/qt6/printsupport/gen_qpagesetupdialog.go index 236eec2d..cc3a2db3 100644 --- a/qt6/printsupport/gen_qpagesetupdialog.go +++ b/qt6/printsupport/gen_qpagesetupdialog.go @@ -1115,7 +1115,11 @@ func miqt_exec_callback_QPageSetupDialog_HideEvent(self *C.QPageSetupDialog, cb func (this *QPageSetupDialog) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QPageSetupDialog_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/printsupport/gen_qprintdialog.go b/qt6/printsupport/gen_qprintdialog.go index 9e0f964e..413e1e8b 100644 --- a/qt6/printsupport/gen_qprintdialog.go +++ b/qt6/printsupport/gen_qprintdialog.go @@ -1159,7 +1159,11 @@ func miqt_exec_callback_QPrintDialog_HideEvent(self *C.QPrintDialog, cb C.intptr func (this *QPrintDialog) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QPrintDialog_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/printsupport/gen_qprintpreviewdialog.go b/qt6/printsupport/gen_qprintpreviewdialog.go index 9b7af001..b9b19b3c 100644 --- a/qt6/printsupport/gen_qprintpreviewdialog.go +++ b/qt6/printsupport/gen_qprintpreviewdialog.go @@ -1147,7 +1147,11 @@ func miqt_exec_callback_QPrintPreviewDialog_HideEvent(self *C.QPrintPreviewDialo func (this *QPrintPreviewDialog) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QPrintPreviewDialog_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/printsupport/gen_qprintpreviewwidget.go b/qt6/printsupport/gen_qprintpreviewwidget.go index 78b75839..453f37c7 100644 --- a/qt6/printsupport/gen_qprintpreviewwidget.go +++ b/qt6/printsupport/gen_qprintpreviewwidget.go @@ -1118,7 +1118,11 @@ func miqt_exec_callback_QPrintPreviewWidget_HideEvent(self *C.QPrintPreviewWidge func (this *QPrintPreviewWidget) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QPrintPreviewWidget_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/svg/gen_qsvgrenderer.go b/qt6/svg/gen_qsvgrenderer.go index 626e6573..75720627 100644 --- a/qt6/svg/gen_qsvgrenderer.go +++ b/qt6/svg/gen_qsvgrenderer.go @@ -70,7 +70,11 @@ func NewQSvgRenderer2(filename string) *QSvgRenderer { // NewQSvgRenderer3 constructs a new QSvgRenderer object. func NewQSvgRenderer3(contents []byte) *QSvgRenderer { contents_alias := C.struct_miqt_string{} - contents_alias.data = (*C.char)(unsafe.Pointer(&contents[0])) + if len(contents) > 0 { + contents_alias.data = (*C.char)(unsafe.Pointer(&contents[0])) + } else { + contents_alias.data = (*C.char)(unsafe.Pointer(nil)) + } contents_alias.len = C.size_t(len(contents)) return newQSvgRenderer(C.QSvgRenderer_new3(contents_alias)) @@ -101,7 +105,11 @@ func NewQSvgRenderer6(filename string, parent *qt6.QObject) *QSvgRenderer { // NewQSvgRenderer7 constructs a new QSvgRenderer object. func NewQSvgRenderer7(contents []byte, parent *qt6.QObject) *QSvgRenderer { contents_alias := C.struct_miqt_string{} - contents_alias.data = (*C.char)(unsafe.Pointer(&contents[0])) + if len(contents) > 0 { + contents_alias.data = (*C.char)(unsafe.Pointer(&contents[0])) + } else { + contents_alias.data = (*C.char)(unsafe.Pointer(nil)) + } contents_alias.len = C.size_t(len(contents)) return newQSvgRenderer(C.QSvgRenderer_new7(contents_alias, (*C.QObject)(parent.UnsafePointer()))) @@ -232,7 +240,11 @@ func (this *QSvgRenderer) Load(filename string) bool { func (this *QSvgRenderer) LoadWithContents(contents []byte) bool { contents_alias := C.struct_miqt_string{} - contents_alias.data = (*C.char)(unsafe.Pointer(&contents[0])) + if len(contents) > 0 { + contents_alias.data = (*C.char)(unsafe.Pointer(&contents[0])) + } else { + contents_alias.data = (*C.char)(unsafe.Pointer(nil)) + } contents_alias.len = C.size_t(len(contents)) return (bool)(C.QSvgRenderer_LoadWithContents(this.h, contents_alias)) } diff --git a/qt6/svg/gen_qsvgwidget.go b/qt6/svg/gen_qsvgwidget.go index 07299925..84b7d136 100644 --- a/qt6/svg/gen_qsvgwidget.go +++ b/qt6/svg/gen_qsvgwidget.go @@ -122,7 +122,11 @@ func (this *QSvgWidget) Load(file string) { func (this *QSvgWidget) LoadWithContents(contents []byte) { contents_alias := C.struct_miqt_string{} - contents_alias.data = (*C.char)(unsafe.Pointer(&contents[0])) + if len(contents) > 0 { + contents_alias.data = (*C.char)(unsafe.Pointer(&contents[0])) + } else { + contents_alias.data = (*C.char)(unsafe.Pointer(nil)) + } contents_alias.len = C.size_t(len(contents)) C.QSvgWidget_LoadWithContents(this.h, contents_alias) } @@ -986,7 +990,11 @@ func miqt_exec_callback_QSvgWidget_HideEvent(self *C.QSvgWidget, cb C.intptr_t, func (this *QSvgWidget) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QSvgWidget_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result)))) diff --git a/qt6/webengine/gen_qwebenginehttprequest.go b/qt6/webengine/gen_qwebenginehttprequest.go index a27693e6..44fe16b6 100644 --- a/qt6/webengine/gen_qwebenginehttprequest.go +++ b/qt6/webengine/gen_qwebenginehttprequest.go @@ -149,14 +149,22 @@ func (this *QWebEngineHttpRequest) PostData() []byte { func (this *QWebEngineHttpRequest) SetPostData(postData []byte) { postData_alias := C.struct_miqt_string{} - postData_alias.data = (*C.char)(unsafe.Pointer(&postData[0])) + if len(postData) > 0 { + postData_alias.data = (*C.char)(unsafe.Pointer(&postData[0])) + } else { + postData_alias.data = (*C.char)(unsafe.Pointer(nil)) + } postData_alias.len = C.size_t(len(postData)) C.QWebEngineHttpRequest_SetPostData(this.h, postData_alias) } func (this *QWebEngineHttpRequest) HasHeader(headerName []byte) bool { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) return (bool)(C.QWebEngineHttpRequest_HasHeader(this.h, headerName_alias)) } @@ -176,7 +184,11 @@ func (this *QWebEngineHttpRequest) Headers() [][]byte { func (this *QWebEngineHttpRequest) Header(headerName []byte) []byte { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) var _bytearray C.struct_miqt_string = C.QWebEngineHttpRequest_Header(this.h, headerName_alias) _ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len))) @@ -186,17 +198,29 @@ func (this *QWebEngineHttpRequest) Header(headerName []byte) []byte { func (this *QWebEngineHttpRequest) SetHeader(headerName []byte, value []byte) { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) value_alias := C.struct_miqt_string{} - value_alias.data = (*C.char)(unsafe.Pointer(&value[0])) + if len(value) > 0 { + value_alias.data = (*C.char)(unsafe.Pointer(&value[0])) + } else { + value_alias.data = (*C.char)(unsafe.Pointer(nil)) + } value_alias.len = C.size_t(len(value)) C.QWebEngineHttpRequest_SetHeader(this.h, headerName_alias, value_alias) } func (this *QWebEngineHttpRequest) UnsetHeader(headerName []byte) { headerName_alias := C.struct_miqt_string{} - headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + if len(headerName) > 0 { + headerName_alias.data = (*C.char)(unsafe.Pointer(&headerName[0])) + } else { + headerName_alias.data = (*C.char)(unsafe.Pointer(nil)) + } headerName_alias.len = C.size_t(len(headerName)) C.QWebEngineHttpRequest_UnsetHeader(this.h, headerName_alias) } diff --git a/qt6/webengine/gen_qwebenginepage.go b/qt6/webengine/gen_qwebenginepage.go index d997c939..04842961 100644 --- a/qt6/webengine/gen_qwebenginepage.go +++ b/qt6/webengine/gen_qwebenginepage.go @@ -300,7 +300,11 @@ func (this *QWebEnginePage) SetHtml(html string) { func (this *QWebEnginePage) SetContent(data []byte) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) C.QWebEnginePage_SetContent(this.h, data_alias) } @@ -1278,7 +1282,11 @@ func (this *QWebEnginePage) SetHtml2(html string, baseUrl *qt6.QUrl) { func (this *QWebEnginePage) SetContent2(data []byte, mimeType string) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) mimeType_ms := C.struct_miqt_string{} mimeType_ms.data = C.CString(mimeType) @@ -1289,7 +1297,11 @@ func (this *QWebEnginePage) SetContent2(data []byte, mimeType string) { func (this *QWebEnginePage) SetContent3(data []byte, mimeType string, baseUrl *qt6.QUrl) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) mimeType_ms := C.struct_miqt_string{} mimeType_ms.data = C.CString(mimeType) diff --git a/qt6/webengine/gen_qwebengineprofile.go b/qt6/webengine/gen_qwebengineprofile.go index 17ad261d..51cbd5b5 100644 --- a/qt6/webengine/gen_qwebengineprofile.go +++ b/qt6/webengine/gen_qwebengineprofile.go @@ -249,21 +249,33 @@ func (this *QWebEngineProfile) Scripts() *QWebEngineScriptCollection { func (this *QWebEngineProfile) UrlSchemeHandler(param1 []byte) *QWebEngineUrlSchemeHandler { param1_alias := C.struct_miqt_string{} - param1_alias.data = (*C.char)(unsafe.Pointer(¶m1[0])) + if len(param1) > 0 { + param1_alias.data = (*C.char)(unsafe.Pointer(¶m1[0])) + } else { + param1_alias.data = (*C.char)(unsafe.Pointer(nil)) + } param1_alias.len = C.size_t(len(param1)) return newQWebEngineUrlSchemeHandler(C.QWebEngineProfile_UrlSchemeHandler(this.h, param1_alias)) } func (this *QWebEngineProfile) InstallUrlSchemeHandler(scheme []byte, param2 *QWebEngineUrlSchemeHandler) { scheme_alias := C.struct_miqt_string{} - scheme_alias.data = (*C.char)(unsafe.Pointer(&scheme[0])) + if len(scheme) > 0 { + scheme_alias.data = (*C.char)(unsafe.Pointer(&scheme[0])) + } else { + scheme_alias.data = (*C.char)(unsafe.Pointer(nil)) + } scheme_alias.len = C.size_t(len(scheme)) C.QWebEngineProfile_InstallUrlSchemeHandler(this.h, scheme_alias, param2.cPointer()) } func (this *QWebEngineProfile) RemoveUrlScheme(scheme []byte) { scheme_alias := C.struct_miqt_string{} - scheme_alias.data = (*C.char)(unsafe.Pointer(&scheme[0])) + if len(scheme) > 0 { + scheme_alias.data = (*C.char)(unsafe.Pointer(&scheme[0])) + } else { + scheme_alias.data = (*C.char)(unsafe.Pointer(nil)) + } scheme_alias.len = C.size_t(len(scheme)) C.QWebEngineProfile_RemoveUrlScheme(this.h, scheme_alias) } diff --git a/qt6/webengine/gen_qwebengineurlrequestinfo.go b/qt6/webengine/gen_qwebengineurlrequestinfo.go index 56c67569..1bb0a753 100644 --- a/qt6/webengine/gen_qwebengineurlrequestinfo.go +++ b/qt6/webengine/gen_qwebengineurlrequestinfo.go @@ -132,10 +132,18 @@ func (this *QWebEngineUrlRequestInfo) Redirect(url *qt6.QUrl) { func (this *QWebEngineUrlRequestInfo) SetHttpHeader(name []byte, value []byte) { name_alias := C.struct_miqt_string{} - name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + if len(name) > 0 { + name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + } else { + name_alias.data = (*C.char)(unsafe.Pointer(nil)) + } name_alias.len = C.size_t(len(name)) value_alias := C.struct_miqt_string{} - value_alias.data = (*C.char)(unsafe.Pointer(&value[0])) + if len(value) > 0 { + value_alias.data = (*C.char)(unsafe.Pointer(&value[0])) + } else { + value_alias.data = (*C.char)(unsafe.Pointer(nil)) + } value_alias.len = C.size_t(len(value)) C.QWebEngineUrlRequestInfo_SetHttpHeader(this.h, name_alias, value_alias) } diff --git a/qt6/webengine/gen_qwebengineurlrequestjob.go b/qt6/webengine/gen_qwebengineurlrequestjob.go index b074c175..a8bbeb5f 100644 --- a/qt6/webengine/gen_qwebengineurlrequestjob.go +++ b/qt6/webengine/gen_qwebengineurlrequestjob.go @@ -101,7 +101,11 @@ func (this *QWebEngineUrlRequestJob) Initiator() *qt6.QUrl { func (this *QWebEngineUrlRequestJob) Reply(contentType []byte, device *qt6.QIODevice) { contentType_alias := C.struct_miqt_string{} - contentType_alias.data = (*C.char)(unsafe.Pointer(&contentType[0])) + if len(contentType) > 0 { + contentType_alias.data = (*C.char)(unsafe.Pointer(&contentType[0])) + } else { + contentType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } contentType_alias.len = C.size_t(len(contentType)) C.QWebEngineUrlRequestJob_Reply(this.h, contentType_alias, (*C.QIODevice)(device.UnsafePointer())) } diff --git a/qt6/webengine/gen_qwebengineurlscheme.go b/qt6/webengine/gen_qwebengineurlscheme.go index 89d5bb1f..b8a84f00 100644 --- a/qt6/webengine/gen_qwebengineurlscheme.go +++ b/qt6/webengine/gen_qwebengineurlscheme.go @@ -82,7 +82,11 @@ func NewQWebEngineUrlScheme() *QWebEngineUrlScheme { // NewQWebEngineUrlScheme2 constructs a new QWebEngineUrlScheme object. func NewQWebEngineUrlScheme2(name []byte) *QWebEngineUrlScheme { name_alias := C.struct_miqt_string{} - name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + if len(name) > 0 { + name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + } else { + name_alias.data = (*C.char)(unsafe.Pointer(nil)) + } name_alias.len = C.size_t(len(name)) return newQWebEngineUrlScheme(C.QWebEngineUrlScheme_new2(name_alias)) @@ -115,7 +119,11 @@ func (this *QWebEngineUrlScheme) Name() []byte { func (this *QWebEngineUrlScheme) SetName(newValue []byte) { newValue_alias := C.struct_miqt_string{} - newValue_alias.data = (*C.char)(unsafe.Pointer(&newValue[0])) + if len(newValue) > 0 { + newValue_alias.data = (*C.char)(unsafe.Pointer(&newValue[0])) + } else { + newValue_alias.data = (*C.char)(unsafe.Pointer(nil)) + } newValue_alias.len = C.size_t(len(newValue)) C.QWebEngineUrlScheme_SetName(this.h, newValue_alias) } @@ -150,7 +158,11 @@ func QWebEngineUrlScheme_RegisterScheme(scheme *QWebEngineUrlScheme) { func QWebEngineUrlScheme_SchemeByName(name []byte) *QWebEngineUrlScheme { name_alias := C.struct_miqt_string{} - name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + if len(name) > 0 { + name_alias.data = (*C.char)(unsafe.Pointer(&name[0])) + } else { + name_alias.data = (*C.char)(unsafe.Pointer(nil)) + } name_alias.len = C.size_t(len(name)) _goptr := newQWebEngineUrlScheme(C.QWebEngineUrlScheme_SchemeByName(name_alias)) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer diff --git a/qt6/webengine/gen_qwebengineview.go b/qt6/webengine/gen_qwebengineview.go index b8a57549..6824c231 100644 --- a/qt6/webengine/gen_qwebengineview.go +++ b/qt6/webengine/gen_qwebengineview.go @@ -137,7 +137,11 @@ func (this *QWebEngineView) SetHtml(html string) { func (this *QWebEngineView) SetContent(data []byte) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) C.QWebEngineView_SetContent(this.h, data_alias) } @@ -528,7 +532,11 @@ func (this *QWebEngineView) SetHtml2(html string, baseUrl *qt6.QUrl) { func (this *QWebEngineView) SetContent2(data []byte, mimeType string) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) mimeType_ms := C.struct_miqt_string{} mimeType_ms.data = C.CString(mimeType) @@ -539,7 +547,11 @@ func (this *QWebEngineView) SetContent2(data []byte, mimeType string) { func (this *QWebEngineView) SetContent3(data []byte, mimeType string, baseUrl *qt6.QUrl) { data_alias := C.struct_miqt_string{} - data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + if len(data) > 0 { + data_alias.data = (*C.char)(unsafe.Pointer(&data[0])) + } else { + data_alias.data = (*C.char)(unsafe.Pointer(nil)) + } data_alias.len = C.size_t(len(data)) mimeType_ms := C.struct_miqt_string{} mimeType_ms.data = C.CString(mimeType) @@ -1433,7 +1445,11 @@ func miqt_exec_callback_QWebEngineView_ActionEvent(self *C.QWebEngineView, cb C. func (this *QWebEngineView) callVirtualBase_NativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool { eventType_alias := C.struct_miqt_string{} - eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + if len(eventType) > 0 { + eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0])) + } else { + eventType_alias.data = (*C.char)(unsafe.Pointer(nil)) + } eventType_alias.len = C.size_t(len(eventType)) return (bool)(C.QWebEngineView_virtualbase_NativeEvent(unsafe.Pointer(this.h), eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result))))