class Qt::DateTime

Public Class Methods

new(*args) click to toggle source
Calls superclass method
# File lib/Qt/qtruby4.rb, line 691
def initialize(*args)
  if args.size == 1 && args[0].class.name == "DateTime"
    return super(  Qt::Date.new(args[0].year, args[0].month, args[0].day),
            Qt::Time.new(args[0].hour, args[0].min, args[0].sec) )
  elsif args.size == 1 && args[0].class.name == "Time"
    result = super(  Qt::Date.new(args[0].year, args[0].month, args[0].day),
            Qt::Time.new(args[0].hour, args[0].min, args[0].sec, args[0].usec / 1000) )
    result.timeSpec = (args[0].utc? ? Qt::UTC : Qt::LocalTime)
    return result
  else
    return super(*args)
  end
end

Public Instance Methods

inspect() click to toggle source
Calls superclass method
# File lib/Qt/qtruby4.rb, line 715
def inspect
  str = super
  str.sub(/>$/, " %s>" % toString)
end
pretty_print(pp) click to toggle source
# File lib/Qt/qtruby4.rb, line 720
def pretty_print(pp)
  str = to_s
  pp.text str.sub(/>$/, " %s>" % toString)
end
to_time() click to toggle source
# File lib/Qt/qtruby4.rb, line 705
def to_time
  if timeSpec == Qt::UTC
    return ::Time.utc(  date.year, date.month, date.day,
              time.hour, time.minute, time.second, time.msec * 1000 )
  else
    return ::Time.local(  date.year, date.month, date.day,
                time.hour, time.minute, time.second, time.msec * 1000 )
  end
end