2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qscrollbar.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QScrollBar struct {
|
|
|
|
h *C.QScrollBar
|
|
|
|
*QAbstractSlider
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QScrollBar) cPointer() *C.QScrollBar {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQScrollBar(h *C.QScrollBar) *QScrollBar {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QScrollBar{h: h, QAbstractSlider: newQAbstractSlider_U(unsafe.Pointer(h))}
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQScrollBar_U(h unsafe.Pointer) *QScrollBar {
|
|
|
|
return newQScrollBar((*C.QScrollBar)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQScrollBar constructs a new QScrollBar object.
|
|
|
|
func NewQScrollBar() *QScrollBar {
|
|
|
|
ret := C.QScrollBar_new()
|
|
|
|
return newQScrollBar(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQScrollBar2 constructs a new QScrollBar object.
|
2024-09-04 06:54:22 +00:00
|
|
|
func NewQScrollBar2(param1 Orientation) *QScrollBar {
|
2024-08-29 07:01:51 +00:00
|
|
|
ret := C.QScrollBar_new2((C.uintptr_t)(param1))
|
|
|
|
return newQScrollBar(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQScrollBar3 constructs a new QScrollBar object.
|
|
|
|
func NewQScrollBar3(parent *QWidget) *QScrollBar {
|
|
|
|
ret := C.QScrollBar_new3(parent.cPointer())
|
|
|
|
return newQScrollBar(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQScrollBar4 constructs a new QScrollBar object.
|
2024-09-04 06:54:22 +00:00
|
|
|
func NewQScrollBar4(param1 Orientation, parent *QWidget) *QScrollBar {
|
2024-08-29 07:01:51 +00:00
|
|
|
ret := C.QScrollBar_new4((C.uintptr_t)(param1), parent.cPointer())
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQScrollBar(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QScrollBar) MetaObject() *QMetaObject {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QScrollBar_MetaObject(this.h)
|
|
|
|
return newQMetaObject_U(unsafe.Pointer(_ret))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QScrollBar_Tr(s string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QScrollBar_Tr(s_Cstring)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QScrollBar_TrUtf8(s string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QScrollBar_TrUtf8(s_Cstring)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QScrollBar) SizeHint() *QSize {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QScrollBar_SizeHint(this.h)
|
|
|
|
_goptr := newQSize(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QScrollBar) Event(event *QEvent) bool {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QScrollBar_Event(this.h, event.cPointer())
|
|
|
|
return (bool)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QScrollBar_Tr2(s string, c string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
|
|
|
c_Cstring := C.CString(c)
|
|
|
|
defer C.free(unsafe.Pointer(c_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QScrollBar_Tr2(s_Cstring, c_Cstring)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QScrollBar_Tr3(s string, c string, n int) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
|
|
|
c_Cstring := C.CString(c)
|
|
|
|
defer C.free(unsafe.Pointer(c_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QScrollBar_Tr3(s_Cstring, c_Cstring, (C.int)(n))
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QScrollBar_TrUtf82(s string, c string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
|
|
|
c_Cstring := C.CString(c)
|
|
|
|
defer C.free(unsafe.Pointer(c_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QScrollBar_TrUtf82(s_Cstring, c_Cstring)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QScrollBar_TrUtf83(s string, c string, n int) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
|
|
|
c_Cstring := C.CString(c)
|
|
|
|
defer C.free(unsafe.Pointer(c_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QScrollBar_TrUtf83(s_Cstring, c_Cstring, (C.int)(n))
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QScrollBar) Delete() {
|
|
|
|
C.QScrollBar_Delete(this.h)
|
|
|
|
}
|
2024-09-14 22:29:05 +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 *QScrollBar) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QScrollBar) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|