2024-10-20 18:21:03 +13:00
|
|
|
package qt6
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qdatetime.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QDateTime__YearRange int
|
|
|
|
|
|
|
|
const (
|
|
|
|
QDateTime__First QDateTime__YearRange = -292275056
|
|
|
|
QDateTime__Last QDateTime__YearRange = 292278994
|
|
|
|
)
|
|
|
|
|
|
|
|
type QDate struct {
|
2025-01-18 17:57:48 +13:00
|
|
|
h *C.QDate
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) cPointer() *C.QDate {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 19:29:06 +13:00
|
|
|
// newQDate constructs the type using only CGO pointers.
|
2024-10-20 18:21:03 +13:00
|
|
|
func newQDate(h *C.QDate) *QDate {
|
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-12-07 17:15:57 +13:00
|
|
|
|
2024-10-20 18:21:03 +13:00
|
|
|
return &QDate{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 19:29:06 +13:00
|
|
|
// UnsafeNewQDate constructs the type using only unsafe pointers.
|
2024-10-20 18:21:03 +13:00
|
|
|
func UnsafeNewQDate(h unsafe.Pointer) *QDate {
|
2024-12-07 17:15:57 +13:00
|
|
|
return newQDate((*C.QDate)(h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQDate constructs a new QDate object.
|
|
|
|
func NewQDate() *QDate {
|
2024-11-19 19:29:06 +13:00
|
|
|
|
2025-01-18 17:57:48 +13:00
|
|
|
return newQDate(C.QDate_new())
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQDate2 constructs a new QDate object.
|
|
|
|
func NewQDate2(y int, m int, d int) *QDate {
|
2024-11-19 19:29:06 +13:00
|
|
|
|
2025-01-18 17:57:48 +13:00
|
|
|
return newQDate(C.QDate_new2((C.int)(y), (C.int)(m), (C.int)(d)))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQDate3 constructs a new QDate object.
|
|
|
|
func NewQDate3(y int, m int, d int, cal QCalendar) *QDate {
|
2024-11-19 19:29:06 +13:00
|
|
|
|
2025-01-18 17:57:48 +13:00
|
|
|
return newQDate(C.QDate_new3((C.int)(y), (C.int)(m), (C.int)(d), cal.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQDate4 constructs a new QDate object.
|
|
|
|
func NewQDate4(param1 *QDate) *QDate {
|
2024-11-19 19:29:06 +13:00
|
|
|
|
2025-01-18 17:57:48 +13:00
|
|
|
return newQDate(C.QDate_new4(param1.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) IsNull() bool {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (bool)(C.QDate_isNull(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) IsValid() bool {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (bool)(C.QDate_isValid(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) Year() int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QDate_year(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) Month() int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QDate_month(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) Day() int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QDate_day(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) DayOfWeek() int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QDate_dayOfWeek(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) DayOfYear() int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QDate_dayOfYear(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) DaysInMonth() int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QDate_daysInMonth(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) DaysInYear() int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QDate_daysInYear(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) WeekNumber() int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QDate_weekNumber(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) YearWithCal(cal QCalendar) int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QDate_yearWithCal(this.h, cal.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) MonthWithCal(cal QCalendar) int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QDate_monthWithCal(this.h, cal.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) DayWithCal(cal QCalendar) int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QDate_dayWithCal(this.h, cal.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) DayOfWeekWithCal(cal QCalendar) int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QDate_dayOfWeekWithCal(this.h, cal.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) DayOfYearWithCal(cal QCalendar) int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QDate_dayOfYearWithCal(this.h, cal.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) DaysInMonthWithCal(cal QCalendar) int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QDate_daysInMonthWithCal(this.h, cal.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) DaysInYearWithCal(cal QCalendar) int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QDate_daysInYearWithCal(this.h, cal.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) StartOfDay() *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDate_startOfDay(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) EndOfDay() *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDate_endOfDay(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) StartOfDayWithZone(zone *QTimeZone) *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDate_startOfDayWithZone(this.h, zone.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) EndOfDayWithZone(zone *QTimeZone) *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDate_endOfDayWithZone(this.h, zone.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) ToString() string {
|
2025-02-01 13:45:16 +13:00
|
|
|
var _ms C.struct_miqt_string = C.QDate_toString(this.h)
|
2024-10-20 18:21:03 +13:00
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) ToStringWithFormat(format string) string {
|
|
|
|
format_ms := C.struct_miqt_string{}
|
|
|
|
format_ms.data = C.CString(format)
|
|
|
|
format_ms.len = C.size_t(len(format))
|
|
|
|
defer C.free(unsafe.Pointer(format_ms.data))
|
2025-02-01 13:45:16 +13:00
|
|
|
var _ms C.struct_miqt_string = C.QDate_toStringWithFormat(this.h, format_ms)
|
2024-10-20 18:21:03 +13:00
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) SetDate(year int, month int, day int) bool {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (bool)(C.QDate_setDate(this.h, (C.int)(year), (C.int)(month), (C.int)(day)))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) SetDate2(year int, month int, day int, cal QCalendar) bool {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (bool)(C.QDate_setDate2(this.h, (C.int)(year), (C.int)(month), (C.int)(day), cal.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) GetDate(year *int, month *int, day *int) {
|
2025-02-01 13:45:16 +13:00
|
|
|
C.QDate_getDate(this.h, (*C.int)(unsafe.Pointer(year)), (*C.int)(unsafe.Pointer(month)), (*C.int)(unsafe.Pointer(day)))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) AddDays(days int64) *QDate {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDate(C.QDate_addDays(this.h, (C.longlong)(days)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) AddMonths(months int) *QDate {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDate(C.QDate_addMonths(this.h, (C.int)(months)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) AddYears(years int) *QDate {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDate(C.QDate_addYears(this.h, (C.int)(years)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) AddMonths2(months int, cal QCalendar) *QDate {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDate(C.QDate_addMonths2(this.h, (C.int)(months), cal.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) AddYears2(years int, cal QCalendar) *QDate {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDate(C.QDate_addYears2(this.h, (C.int)(years), cal.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) DaysTo(d QDate) int64 {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int64)(C.QDate_daysTo(this.h, d.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func QDate_CurrentDate() *QDate {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDate(C.QDate_currentDate())
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
2025-02-01 13:45:16 +13:00
|
|
|
func QDate_FromStringWithString(stringVal string) *QDate {
|
2024-10-20 18:21:03 +13:00
|
|
|
stringVal_ms := C.struct_miqt_string{}
|
|
|
|
stringVal_ms.data = C.CString(stringVal)
|
|
|
|
stringVal_ms.len = C.size_t(len(stringVal))
|
|
|
|
defer C.free(unsafe.Pointer(stringVal_ms.data))
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDate(C.QDate_fromStringWithString(stringVal_ms))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func QDate_FromString4(stringVal string, format string) *QDate {
|
|
|
|
stringVal_ms := C.struct_miqt_string{}
|
|
|
|
stringVal_ms.data = C.CString(stringVal)
|
|
|
|
stringVal_ms.len = C.size_t(len(stringVal))
|
|
|
|
defer C.free(unsafe.Pointer(stringVal_ms.data))
|
|
|
|
format_ms := C.struct_miqt_string{}
|
|
|
|
format_ms.data = C.CString(format)
|
|
|
|
format_ms.len = C.size_t(len(format))
|
|
|
|
defer C.free(unsafe.Pointer(format_ms.data))
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDate(C.QDate_fromString4(stringVal_ms, format_ms))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func QDate_IsValid2(y int, m int, d int) bool {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (bool)(C.QDate_isValid2((C.int)(y), (C.int)(m), (C.int)(d)))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func QDate_IsLeapYear(year int) bool {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (bool)(C.QDate_isLeapYear((C.int)(year)))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func QDate_FromJulianDay(jd_ int64) *QDate {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDate(C.QDate_fromJulianDay((C.longlong)(jd_)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) ToJulianDay() int64 {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int64)(C.QDate_toJulianDay(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) WeekNumber1(yearNum *int) int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QDate_weekNumber1(this.h, (*C.int)(unsafe.Pointer(yearNum))))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) StartOfDay1(spec TimeSpec) *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDate_startOfDay1(this.h, (C.int)(spec)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) StartOfDay2(spec TimeSpec, offsetSeconds int) *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDate_startOfDay2(this.h, (C.int)(spec), (C.int)(offsetSeconds)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) EndOfDay1(spec TimeSpec) *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDate_endOfDay1(this.h, (C.int)(spec)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) EndOfDay2(spec TimeSpec, offsetSeconds int) *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDate_endOfDay2(this.h, (C.int)(spec), (C.int)(offsetSeconds)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) ToString1(format DateFormat) string {
|
2025-02-01 13:45:16 +13:00
|
|
|
var _ms C.struct_miqt_string = C.QDate_toString1(this.h, (C.int)(format))
|
2024-10-20 18:21:03 +13:00
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDate) ToString22(format string, cal QCalendar) string {
|
|
|
|
format_ms := C.struct_miqt_string{}
|
|
|
|
format_ms.data = C.CString(format)
|
|
|
|
format_ms.len = C.size_t(len(format))
|
|
|
|
defer C.free(unsafe.Pointer(format_ms.data))
|
2025-02-01 13:45:16 +13:00
|
|
|
var _ms C.struct_miqt_string = C.QDate_toString22(this.h, format_ms, cal.cPointer())
|
2024-10-20 18:21:03 +13:00
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func QDate_FromString23(stringVal string, format DateFormat) *QDate {
|
|
|
|
stringVal_ms := C.struct_miqt_string{}
|
|
|
|
stringVal_ms.data = C.CString(stringVal)
|
|
|
|
stringVal_ms.len = C.size_t(len(stringVal))
|
|
|
|
defer C.free(unsafe.Pointer(stringVal_ms.data))
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDate(C.QDate_fromString23(stringVal_ms, (C.int)(format)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func QDate_FromString34(stringVal string, format string, cal QCalendar) *QDate {
|
|
|
|
stringVal_ms := C.struct_miqt_string{}
|
|
|
|
stringVal_ms.data = C.CString(stringVal)
|
|
|
|
stringVal_ms.len = C.size_t(len(stringVal))
|
|
|
|
defer C.free(unsafe.Pointer(stringVal_ms.data))
|
|
|
|
format_ms := C.struct_miqt_string{}
|
|
|
|
format_ms.data = C.CString(format)
|
|
|
|
format_ms.len = C.size_t(len(format))
|
|
|
|
defer C.free(unsafe.Pointer(format_ms.data))
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDate(C.QDate_fromString34(stringVal_ms, format_ms, cal.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
// Delete this object from C++ memory.
|
|
|
|
func (this *QDate) Delete() {
|
2025-02-01 13:45:16 +13:00
|
|
|
C.QDate_delete(this.h)
|
2024-10-20 18:21:03 +13: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 *QDate) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QDate) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
type QTime struct {
|
2025-01-18 17:57:48 +13:00
|
|
|
h *C.QTime
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTime) cPointer() *C.QTime {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTime) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 19:29:06 +13:00
|
|
|
// newQTime constructs the type using only CGO pointers.
|
2024-10-20 18:21:03 +13:00
|
|
|
func newQTime(h *C.QTime) *QTime {
|
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-12-07 17:15:57 +13:00
|
|
|
|
2024-10-20 18:21:03 +13:00
|
|
|
return &QTime{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 19:29:06 +13:00
|
|
|
// UnsafeNewQTime constructs the type using only unsafe pointers.
|
2024-10-20 18:21:03 +13:00
|
|
|
func UnsafeNewQTime(h unsafe.Pointer) *QTime {
|
2024-12-07 17:15:57 +13:00
|
|
|
return newQTime((*C.QTime)(h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQTime constructs a new QTime object.
|
|
|
|
func NewQTime() *QTime {
|
2024-11-19 19:29:06 +13:00
|
|
|
|
2025-01-18 17:57:48 +13:00
|
|
|
return newQTime(C.QTime_new())
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQTime2 constructs a new QTime object.
|
|
|
|
func NewQTime2(h int, m int) *QTime {
|
2024-11-19 19:29:06 +13:00
|
|
|
|
2025-01-18 17:57:48 +13:00
|
|
|
return newQTime(C.QTime_new2((C.int)(h), (C.int)(m)))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQTime3 constructs a new QTime object.
|
|
|
|
func NewQTime3(param1 *QTime) *QTime {
|
2024-11-19 19:29:06 +13:00
|
|
|
|
2025-01-18 17:57:48 +13:00
|
|
|
return newQTime(C.QTime_new3(param1.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQTime4 constructs a new QTime object.
|
|
|
|
func NewQTime4(h int, m int, s int) *QTime {
|
2024-11-19 19:29:06 +13:00
|
|
|
|
2025-01-18 17:57:48 +13:00
|
|
|
return newQTime(C.QTime_new4((C.int)(h), (C.int)(m), (C.int)(s)))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQTime5 constructs a new QTime object.
|
|
|
|
func NewQTime5(h int, m int, s int, ms int) *QTime {
|
2024-11-19 19:29:06 +13:00
|
|
|
|
2025-01-18 17:57:48 +13:00
|
|
|
return newQTime(C.QTime_new5((C.int)(h), (C.int)(m), (C.int)(s), (C.int)(ms)))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTime) IsNull() bool {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (bool)(C.QTime_isNull(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTime) IsValid() bool {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (bool)(C.QTime_isValid(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTime) Hour() int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QTime_hour(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTime) Minute() int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QTime_minute(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTime) Second() int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QTime_second(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTime) Msec() int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QTime_msec(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTime) ToString() string {
|
2025-02-01 13:45:16 +13:00
|
|
|
var _ms C.struct_miqt_string = C.QTime_toString(this.h)
|
2024-10-20 18:21:03 +13:00
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTime) ToStringWithFormat(format string) string {
|
|
|
|
format_ms := C.struct_miqt_string{}
|
|
|
|
format_ms.data = C.CString(format)
|
|
|
|
format_ms.len = C.size_t(len(format))
|
|
|
|
defer C.free(unsafe.Pointer(format_ms.data))
|
2025-02-01 13:45:16 +13:00
|
|
|
var _ms C.struct_miqt_string = C.QTime_toStringWithFormat(this.h, format_ms)
|
2024-10-20 18:21:03 +13:00
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTime) SetHMS(h int, m int, s int) bool {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (bool)(C.QTime_setHMS(this.h, (C.int)(h), (C.int)(m), (C.int)(s)))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTime) AddSecs(secs int) *QTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQTime(C.QTime_addSecs(this.h, (C.int)(secs)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTime) SecsTo(t QTime) int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QTime_secsTo(this.h, t.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTime) AddMSecs(ms int) *QTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQTime(C.QTime_addMSecs(this.h, (C.int)(ms)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTime) MsecsTo(t QTime) int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QTime_msecsTo(this.h, t.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func QTime_FromMSecsSinceStartOfDay(msecs int) *QTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQTime(C.QTime_fromMSecsSinceStartOfDay((C.int)(msecs)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTime) MsecsSinceStartOfDay() int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QTime_msecsSinceStartOfDay(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func QTime_CurrentTime() *QTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQTime(C.QTime_currentTime())
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
2025-02-01 13:45:16 +13:00
|
|
|
func QTime_FromStringWithString(stringVal string) *QTime {
|
2024-10-20 18:21:03 +13:00
|
|
|
stringVal_ms := C.struct_miqt_string{}
|
|
|
|
stringVal_ms.data = C.CString(stringVal)
|
|
|
|
stringVal_ms.len = C.size_t(len(stringVal))
|
|
|
|
defer C.free(unsafe.Pointer(stringVal_ms.data))
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQTime(C.QTime_fromStringWithString(stringVal_ms))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func QTime_FromString4(stringVal string, format string) *QTime {
|
|
|
|
stringVal_ms := C.struct_miqt_string{}
|
|
|
|
stringVal_ms.data = C.CString(stringVal)
|
|
|
|
stringVal_ms.len = C.size_t(len(stringVal))
|
|
|
|
defer C.free(unsafe.Pointer(stringVal_ms.data))
|
|
|
|
format_ms := C.struct_miqt_string{}
|
|
|
|
format_ms.data = C.CString(format)
|
|
|
|
format_ms.len = C.size_t(len(format))
|
|
|
|
defer C.free(unsafe.Pointer(format_ms.data))
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQTime(C.QTime_fromString4(stringVal_ms, format_ms))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func QTime_IsValid2(h int, m int, s int) bool {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (bool)(C.QTime_isValid2((C.int)(h), (C.int)(m), (C.int)(s)))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTime) ToString1(f DateFormat) string {
|
2025-02-01 13:45:16 +13:00
|
|
|
var _ms C.struct_miqt_string = C.QTime_toString1(this.h, (C.int)(f))
|
2024-10-20 18:21:03 +13:00
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTime) SetHMS4(h int, m int, s int, ms int) bool {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (bool)(C.QTime_setHMS4(this.h, (C.int)(h), (C.int)(m), (C.int)(s), (C.int)(ms)))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func QTime_FromString23(stringVal string, format DateFormat) *QTime {
|
|
|
|
stringVal_ms := C.struct_miqt_string{}
|
|
|
|
stringVal_ms.data = C.CString(stringVal)
|
|
|
|
stringVal_ms.len = C.size_t(len(stringVal))
|
|
|
|
defer C.free(unsafe.Pointer(stringVal_ms.data))
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQTime(C.QTime_fromString23(stringVal_ms, (C.int)(format)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func QTime_IsValid4(h int, m int, s int, ms int) bool {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (bool)(C.QTime_isValid4((C.int)(h), (C.int)(m), (C.int)(s), (C.int)(ms)))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
// Delete this object from C++ memory.
|
|
|
|
func (this *QTime) Delete() {
|
2025-02-01 13:45:16 +13:00
|
|
|
C.QTime_delete(this.h)
|
2024-10-20 18:21:03 +13: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 *QTime) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QTime) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
type QDateTime struct {
|
2025-01-18 17:57:48 +13:00
|
|
|
h *C.QDateTime
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) cPointer() *C.QDateTime {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 19:29:06 +13:00
|
|
|
// newQDateTime constructs the type using only CGO pointers.
|
2024-10-20 18:21:03 +13:00
|
|
|
func newQDateTime(h *C.QDateTime) *QDateTime {
|
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-12-07 17:15:57 +13:00
|
|
|
|
2024-10-20 18:21:03 +13:00
|
|
|
return &QDateTime{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 19:29:06 +13:00
|
|
|
// UnsafeNewQDateTime constructs the type using only unsafe pointers.
|
2024-10-20 18:21:03 +13:00
|
|
|
func UnsafeNewQDateTime(h unsafe.Pointer) *QDateTime {
|
2024-12-07 17:15:57 +13:00
|
|
|
return newQDateTime((*C.QDateTime)(h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQDateTime constructs a new QDateTime object.
|
|
|
|
func NewQDateTime() *QDateTime {
|
2024-11-19 19:29:06 +13:00
|
|
|
|
2025-01-18 17:57:48 +13:00
|
|
|
return newQDateTime(C.QDateTime_new())
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQDateTime2 constructs a new QDateTime object.
|
|
|
|
func NewQDateTime2(date QDate, time QTime) *QDateTime {
|
2024-11-19 19:29:06 +13:00
|
|
|
|
2025-01-18 17:57:48 +13:00
|
|
|
return newQDateTime(C.QDateTime_new2(date.cPointer(), time.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQDateTime3 constructs a new QDateTime object.
|
|
|
|
func NewQDateTime3(date QDate, time QTime, timeZone *QTimeZone) *QDateTime {
|
2024-11-19 19:29:06 +13:00
|
|
|
|
2025-01-18 17:57:48 +13:00
|
|
|
return newQDateTime(C.QDateTime_new3(date.cPointer(), time.cPointer(), timeZone.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQDateTime4 constructs a new QDateTime object.
|
|
|
|
func NewQDateTime4(other *QDateTime) *QDateTime {
|
2024-11-19 19:29:06 +13:00
|
|
|
|
2025-01-18 17:57:48 +13:00
|
|
|
return newQDateTime(C.QDateTime_new4(other.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQDateTime5 constructs a new QDateTime object.
|
|
|
|
func NewQDateTime5(date QDate, time QTime, spec TimeSpec) *QDateTime {
|
2024-11-19 19:29:06 +13:00
|
|
|
|
2025-01-18 17:57:48 +13:00
|
|
|
return newQDateTime(C.QDateTime_new5(date.cPointer(), time.cPointer(), (C.int)(spec)))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQDateTime6 constructs a new QDateTime object.
|
|
|
|
func NewQDateTime6(date QDate, time QTime, spec TimeSpec, offsetSeconds int) *QDateTime {
|
2024-11-19 19:29:06 +13:00
|
|
|
|
2025-01-18 17:57:48 +13:00
|
|
|
return newQDateTime(C.QDateTime_new6(date.cPointer(), time.cPointer(), (C.int)(spec), (C.int)(offsetSeconds)))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) OperatorAssign(other *QDateTime) {
|
2025-02-01 13:45:16 +13:00
|
|
|
C.QDateTime_operatorAssign(this.h, other.cPointer())
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) Swap(other *QDateTime) {
|
2025-02-01 13:45:16 +13:00
|
|
|
C.QDateTime_swap(this.h, other.cPointer())
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) IsNull() bool {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (bool)(C.QDateTime_isNull(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) IsValid() bool {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (bool)(C.QDateTime_isValid(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) Date() *QDate {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDate(C.QDateTime_date(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) Time() *QTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQTime(C.QDateTime_time(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) TimeSpec() TimeSpec {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (TimeSpec)(C.QDateTime_timeSpec(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) OffsetFromUtc() int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QDateTime_offsetFromUtc(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) TimeZone() *QTimeZone {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQTimeZone(C.QDateTime_timeZone(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) TimeZoneAbbreviation() string {
|
2025-02-01 13:45:16 +13:00
|
|
|
var _ms C.struct_miqt_string = C.QDateTime_timeZoneAbbreviation(this.h)
|
2024-10-20 18:21:03 +13:00
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) IsDaylightTime() bool {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (bool)(C.QDateTime_isDaylightTime(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) ToMSecsSinceEpoch() int64 {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int64)(C.QDateTime_toMSecsSinceEpoch(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) ToSecsSinceEpoch() int64 {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int64)(C.QDateTime_toSecsSinceEpoch(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) SetDate(date QDate) {
|
2025-02-01 13:45:16 +13:00
|
|
|
C.QDateTime_setDate(this.h, date.cPointer())
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) SetTime(time QTime) {
|
2025-02-01 13:45:16 +13:00
|
|
|
C.QDateTime_setTime(this.h, time.cPointer())
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) SetTimeSpec(spec TimeSpec) {
|
2025-02-01 13:45:16 +13:00
|
|
|
C.QDateTime_setTimeSpec(this.h, (C.int)(spec))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) SetOffsetFromUtc(offsetSeconds int) {
|
2025-02-01 13:45:16 +13:00
|
|
|
C.QDateTime_setOffsetFromUtc(this.h, (C.int)(offsetSeconds))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) SetTimeZone(toZone *QTimeZone) {
|
2025-02-01 13:45:16 +13:00
|
|
|
C.QDateTime_setTimeZone(this.h, toZone.cPointer())
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) SetMSecsSinceEpoch(msecs int64) {
|
2025-02-01 13:45:16 +13:00
|
|
|
C.QDateTime_setMSecsSinceEpoch(this.h, (C.longlong)(msecs))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) SetSecsSinceEpoch(secs int64) {
|
2025-02-01 13:45:16 +13:00
|
|
|
C.QDateTime_setSecsSinceEpoch(this.h, (C.longlong)(secs))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) ToString() string {
|
2025-02-01 13:45:16 +13:00
|
|
|
var _ms C.struct_miqt_string = C.QDateTime_toString(this.h)
|
2024-10-20 18:21:03 +13:00
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) ToStringWithFormat(format string) string {
|
|
|
|
format_ms := C.struct_miqt_string{}
|
|
|
|
format_ms.data = C.CString(format)
|
|
|
|
format_ms.len = C.size_t(len(format))
|
|
|
|
defer C.free(unsafe.Pointer(format_ms.data))
|
2025-02-01 13:45:16 +13:00
|
|
|
var _ms C.struct_miqt_string = C.QDateTime_toStringWithFormat(this.h, format_ms)
|
2024-10-20 18:21:03 +13:00
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) AddDays(days int64) *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDateTime_addDays(this.h, (C.longlong)(days)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) AddMonths(months int) *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDateTime_addMonths(this.h, (C.int)(months)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) AddYears(years int) *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDateTime_addYears(this.h, (C.int)(years)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) AddSecs(secs int64) *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDateTime_addSecs(this.h, (C.longlong)(secs)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) AddMSecs(msecs int64) *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDateTime_addMSecs(this.h, (C.longlong)(msecs)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) ToTimeSpec(spec TimeSpec) *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDateTime_toTimeSpec(this.h, (C.int)(spec)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) ToLocalTime() *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDateTime_toLocalTime(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) ToUTC() *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDateTime_toUTC(this.h))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) ToOffsetFromUtc(offsetSeconds int) *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDateTime_toOffsetFromUtc(this.h, (C.int)(offsetSeconds)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) ToTimeZone(toZone *QTimeZone) *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDateTime_toTimeZone(this.h, toZone.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) DaysTo(param1 *QDateTime) int64 {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int64)(C.QDateTime_daysTo(this.h, param1.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) SecsTo(param1 *QDateTime) int64 {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int64)(C.QDateTime_secsTo(this.h, param1.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) MsecsTo(param1 *QDateTime) int64 {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int64)(C.QDateTime_msecsTo(this.h, param1.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func QDateTime_CurrentDateTime() *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDateTime_currentDateTime())
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func QDateTime_CurrentDateTimeUtc() *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDateTime_currentDateTimeUtc())
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
2025-02-01 13:45:16 +13:00
|
|
|
func QDateTime_FromStringWithString(stringVal string) *QDateTime {
|
2024-10-20 18:21:03 +13:00
|
|
|
stringVal_ms := C.struct_miqt_string{}
|
|
|
|
stringVal_ms.data = C.CString(stringVal)
|
|
|
|
stringVal_ms.len = C.size_t(len(stringVal))
|
|
|
|
defer C.free(unsafe.Pointer(stringVal_ms.data))
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDateTime_fromStringWithString(stringVal_ms))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func QDateTime_FromString4(stringVal string, format string) *QDateTime {
|
|
|
|
stringVal_ms := C.struct_miqt_string{}
|
|
|
|
stringVal_ms.data = C.CString(stringVal)
|
|
|
|
stringVal_ms.len = C.size_t(len(stringVal))
|
|
|
|
defer C.free(unsafe.Pointer(stringVal_ms.data))
|
|
|
|
format_ms := C.struct_miqt_string{}
|
|
|
|
format_ms.data = C.CString(format)
|
|
|
|
format_ms.len = C.size_t(len(format))
|
|
|
|
defer C.free(unsafe.Pointer(format_ms.data))
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDateTime_fromString4(stringVal_ms, format_ms))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func QDateTime_FromMSecsSinceEpoch(msecs int64) *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDateTime_fromMSecsSinceEpoch((C.longlong)(msecs)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func QDateTime_FromSecsSinceEpoch(secs int64) *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDateTime_fromSecsSinceEpoch((C.longlong)(secs)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func QDateTime_FromMSecsSinceEpoch2(msecs int64, timeZone *QTimeZone) *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDateTime_fromMSecsSinceEpoch2((C.longlong)(msecs), timeZone.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func QDateTime_FromSecsSinceEpoch2(secs int64, timeZone *QTimeZone) *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDateTime_fromSecsSinceEpoch2((C.longlong)(secs), timeZone.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func QDateTime_CurrentMSecsSinceEpoch() int64 {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int64)(C.QDateTime_currentMSecsSinceEpoch())
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func QDateTime_CurrentSecsSinceEpoch() int64 {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int64)(C.QDateTime_currentSecsSinceEpoch())
|
2024-10-20 18:21:03 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) ToString1(format DateFormat) string {
|
2025-02-01 13:45:16 +13:00
|
|
|
var _ms C.struct_miqt_string = C.QDateTime_toString1(this.h, (C.int)(format))
|
2024-10-20 18:21:03 +13:00
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDateTime) ToString22(format string, cal QCalendar) string {
|
|
|
|
format_ms := C.struct_miqt_string{}
|
|
|
|
format_ms.data = C.CString(format)
|
|
|
|
format_ms.len = C.size_t(len(format))
|
|
|
|
defer C.free(unsafe.Pointer(format_ms.data))
|
2025-02-01 13:45:16 +13:00
|
|
|
var _ms C.struct_miqt_string = C.QDateTime_toString22(this.h, format_ms, cal.cPointer())
|
2024-10-20 18:21:03 +13:00
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func QDateTime_FromString23(stringVal string, format DateFormat) *QDateTime {
|
|
|
|
stringVal_ms := C.struct_miqt_string{}
|
|
|
|
stringVal_ms.data = C.CString(stringVal)
|
|
|
|
stringVal_ms.len = C.size_t(len(stringVal))
|
|
|
|
defer C.free(unsafe.Pointer(stringVal_ms.data))
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDateTime_fromString23(stringVal_ms, (C.int)(format)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func QDateTime_FromString34(stringVal string, format string, cal QCalendar) *QDateTime {
|
|
|
|
stringVal_ms := C.struct_miqt_string{}
|
|
|
|
stringVal_ms.data = C.CString(stringVal)
|
|
|
|
stringVal_ms.len = C.size_t(len(stringVal))
|
|
|
|
defer C.free(unsafe.Pointer(stringVal_ms.data))
|
|
|
|
format_ms := C.struct_miqt_string{}
|
|
|
|
format_ms.data = C.CString(format)
|
|
|
|
format_ms.len = C.size_t(len(format))
|
|
|
|
defer C.free(unsafe.Pointer(format_ms.data))
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDateTime_fromString34(stringVal_ms, format_ms, cal.cPointer()))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func QDateTime_FromMSecsSinceEpoch22(msecs int64, spec TimeSpec) *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDateTime_fromMSecsSinceEpoch22((C.longlong)(msecs), (C.int)(spec)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func QDateTime_FromMSecsSinceEpoch3(msecs int64, spec TimeSpec, offsetFromUtc int) *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDateTime_fromMSecsSinceEpoch3((C.longlong)(msecs), (C.int)(spec), (C.int)(offsetFromUtc)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func QDateTime_FromSecsSinceEpoch22(secs int64, spec TimeSpec) *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDateTime_fromSecsSinceEpoch22((C.longlong)(secs), (C.int)(spec)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func QDateTime_FromSecsSinceEpoch3(secs int64, spec TimeSpec, offsetFromUtc int) *QDateTime {
|
2025-02-01 13:45:16 +13:00
|
|
|
_goptr := newQDateTime(C.QDateTime_fromSecsSinceEpoch3((C.longlong)(secs), (C.int)(spec), (C.int)(offsetFromUtc)))
|
2024-10-20 18:21:03 +13:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
// Delete this object from C++ memory.
|
|
|
|
func (this *QDateTime) Delete() {
|
2025-02-01 13:45:16 +13:00
|
|
|
C.QDateTime_delete(this.h)
|
2024-10-20 18:21:03 +13: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 *QDateTime) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QDateTime) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|