miqt/qt6/gen_qstatictext.go

180 lines
4.6 KiB
Go
Raw Normal View History

2024-10-20 05:21:03 +00:00
package qt6
/*
#include "gen_qstatictext.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
"unsafe"
)
type QStaticText__PerformanceHint int
const (
QStaticText__ModerateCaching QStaticText__PerformanceHint = 0
QStaticText__AggressiveCaching QStaticText__PerformanceHint = 1
)
type QStaticText struct {
2024-11-19 06:29:06 +00:00
h *C.QStaticText
isSubclass bool
2024-10-20 05:21:03 +00:00
}
func (this *QStaticText) cPointer() *C.QStaticText {
if this == nil {
return nil
}
return this.h
}
func (this *QStaticText) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQStaticText constructs the type using only CGO pointers.
2024-10-20 05:21:03 +00:00
func newQStaticText(h *C.QStaticText) *QStaticText {
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
2024-10-20 05:21:03 +00:00
return &QStaticText{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQStaticText constructs the type using only unsafe pointers.
2024-10-20 05:21:03 +00:00
func UnsafeNewQStaticText(h unsafe.Pointer) *QStaticText {
2024-12-07 04:15:57 +00:00
return newQStaticText((*C.QStaticText)(h))
2024-10-20 05:21:03 +00:00
}
// NewQStaticText constructs a new QStaticText object.
func NewQStaticText() *QStaticText {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQStaticText(C.QStaticText_new())
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQStaticText2 constructs a new QStaticText object.
func NewQStaticText2(text string) *QStaticText {
text_ms := C.struct_miqt_string{}
text_ms.data = C.CString(text)
text_ms.len = C.size_t(len(text))
defer C.free(unsafe.Pointer(text_ms.data))
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQStaticText(C.QStaticText_new2(text_ms))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQStaticText3 constructs a new QStaticText object.
func NewQStaticText3(other *QStaticText) *QStaticText {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQStaticText(C.QStaticText_new3(other.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
func (this *QStaticText) OperatorAssign(param1 *QStaticText) {
C.QStaticText_OperatorAssign(this.h, param1.cPointer())
}
func (this *QStaticText) Swap(other *QStaticText) {
C.QStaticText_Swap(this.h, other.cPointer())
}
func (this *QStaticText) SetText(text string) {
text_ms := C.struct_miqt_string{}
text_ms.data = C.CString(text)
text_ms.len = C.size_t(len(text))
defer C.free(unsafe.Pointer(text_ms.data))
C.QStaticText_SetText(this.h, text_ms)
}
func (this *QStaticText) Text() string {
var _ms C.struct_miqt_string = C.QStaticText_Text(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QStaticText) SetTextFormat(textFormat TextFormat) {
C.QStaticText_SetTextFormat(this.h, (C.int)(textFormat))
}
func (this *QStaticText) TextFormat() TextFormat {
return (TextFormat)(C.QStaticText_TextFormat(this.h))
}
func (this *QStaticText) SetTextWidth(textWidth float64) {
C.QStaticText_SetTextWidth(this.h, (C.double)(textWidth))
}
func (this *QStaticText) TextWidth() float64 {
return (float64)(C.QStaticText_TextWidth(this.h))
}
func (this *QStaticText) SetTextOption(textOption *QTextOption) {
C.QStaticText_SetTextOption(this.h, textOption.cPointer())
}
func (this *QStaticText) TextOption() *QTextOption {
_goptr := newQTextOption(C.QStaticText_TextOption(this.h))
2024-10-20 05:21:03 +00:00
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QStaticText) Size() *QSizeF {
_goptr := newQSizeF(C.QStaticText_Size(this.h))
2024-10-20 05:21:03 +00:00
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QStaticText) Prepare() {
C.QStaticText_Prepare(this.h)
}
func (this *QStaticText) SetPerformanceHint(performanceHint QStaticText__PerformanceHint) {
C.QStaticText_SetPerformanceHint(this.h, (C.int)(performanceHint))
}
func (this *QStaticText) PerformanceHint() QStaticText__PerformanceHint {
return (QStaticText__PerformanceHint)(C.QStaticText_PerformanceHint(this.h))
}
func (this *QStaticText) OperatorEqual(param1 *QStaticText) bool {
return (bool)(C.QStaticText_OperatorEqual(this.h, param1.cPointer()))
}
func (this *QStaticText) OperatorNotEqual(param1 *QStaticText) bool {
return (bool)(C.QStaticText_OperatorNotEqual(this.h, param1.cPointer()))
}
func (this *QStaticText) Prepare1(matrix *QTransform) {
C.QStaticText_Prepare1(this.h, matrix.cPointer())
}
func (this *QStaticText) Prepare2(matrix *QTransform, font *QFont) {
C.QStaticText_Prepare2(this.h, matrix.cPointer(), font.cPointer())
}
// Delete this object from C++ memory.
func (this *QStaticText) Delete() {
2024-11-19 06:29:06 +00:00
C.QStaticText_Delete(this.h, C.bool(this.isSubclass))
2024-10-20 05:21:03 +00:00
}
// GoGC adds a Go Finalizer to this pointer, so that it will be deleted
// from C++ memory once it is unreachable from Go memory.
func (this *QStaticText) GoGC() {
runtime.SetFinalizer(this, func(this *QStaticText) {
this.Delete()
runtime.KeepAlive(this.h)
})
}