2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qslider.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
type QSlider__TickPosition int
|
|
|
|
|
|
|
|
const (
|
|
|
|
QSlider__TickPosition__NoTicks QSlider__TickPosition = 0
|
|
|
|
QSlider__TickPosition__TicksAbove QSlider__TickPosition = 1
|
|
|
|
QSlider__TickPosition__TicksLeft QSlider__TickPosition = 1
|
|
|
|
QSlider__TickPosition__TicksBelow QSlider__TickPosition = 2
|
|
|
|
QSlider__TickPosition__TicksRight QSlider__TickPosition = 2
|
|
|
|
QSlider__TickPosition__TicksBothSides QSlider__TickPosition = 3
|
|
|
|
)
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QSlider struct {
|
|
|
|
h *C.QSlider
|
|
|
|
*QAbstractSlider
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSlider) cPointer() *C.QSlider {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQSlider(h *C.QSlider) *QSlider {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QSlider{h: h, QAbstractSlider: newQAbstractSlider_U(unsafe.Pointer(h))}
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQSlider_U(h unsafe.Pointer) *QSlider {
|
|
|
|
return newQSlider((*C.QSlider)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQSlider constructs a new QSlider object.
|
|
|
|
func NewQSlider() *QSlider {
|
|
|
|
ret := C.QSlider_new()
|
|
|
|
return newQSlider(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQSlider2 constructs a new QSlider object.
|
2024-09-04 06:54:22 +00:00
|
|
|
func NewQSlider2(orientation Orientation) *QSlider {
|
2024-08-29 07:01:51 +00:00
|
|
|
ret := C.QSlider_new2((C.uintptr_t)(orientation))
|
|
|
|
return newQSlider(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQSlider3 constructs a new QSlider object.
|
|
|
|
func NewQSlider3(parent *QWidget) *QSlider {
|
|
|
|
ret := C.QSlider_new3(parent.cPointer())
|
|
|
|
return newQSlider(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQSlider4 constructs a new QSlider object.
|
2024-09-04 06:54:22 +00:00
|
|
|
func NewQSlider4(orientation Orientation, parent *QWidget) *QSlider {
|
2024-08-29 07:01:51 +00:00
|
|
|
ret := C.QSlider_new4((C.uintptr_t)(orientation), parent.cPointer())
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQSlider(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSlider) MetaObject() *QMetaObject {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QSlider_MetaObject(this.h)
|
|
|
|
return newQMetaObject_U(unsafe.Pointer(_ret))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QSlider_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.QSlider_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 QSlider_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.QSlider_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 *QSlider) SizeHint() *QSize {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QSlider_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 *QSlider) MinimumSizeHint() *QSize {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QSlider_MinimumSizeHint(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
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QSlider) SetTickPosition(position QSlider__TickPosition) {
|
2024-08-29 07:01:51 +00:00
|
|
|
C.QSlider_SetTickPosition(this.h, (C.uintptr_t)(position))
|
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QSlider) TickPosition() QSlider__TickPosition {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QSlider_TickPosition(this.h)
|
|
|
|
return (QSlider__TickPosition)(_ret)
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QSlider) SetTickInterval(ti int) {
|
|
|
|
C.QSlider_SetTickInterval(this.h, (C.int)(ti))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSlider) TickInterval() int {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QSlider_TickInterval(this.h)
|
|
|
|
return (int)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSlider) Event(event *QEvent) bool {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QSlider_Event(this.h, event.cPointer())
|
|
|
|
return (bool)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QSlider_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.QSlider_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 QSlider_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.QSlider_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 QSlider_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.QSlider_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 QSlider_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.QSlider_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 *QSlider) Delete() {
|
|
|
|
C.QSlider_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 *QSlider) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QSlider) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|