diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-05 15:55:57 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-05 15:55:57 -0600 |
commit | 9ba04742771370f59740e32e11c5f3a1e6a1b70a (patch) | |
tree | c81c34dae2b3b1ea73801bf18a960265dc4207f7 /qtruby/rubylib/qtruby/lib | |
parent | 1a96c45b22d01378202d9dc7ed9c47acd30f966e (diff) | |
download | tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.tar.gz tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.zip |
Initial TQt conversion
Diffstat (limited to 'qtruby/rubylib/qtruby/lib')
-rw-r--r-- | qtruby/rubylib/qtruby/lib/Qt.rb | 2 | ||||
-rw-r--r-- | qtruby/rubylib/qtruby/lib/Qt/qtruby.rb | 442 |
2 files changed, 222 insertions, 222 deletions
diff --git a/qtruby/rubylib/qtruby/lib/Qt.rb b/qtruby/rubylib/qtruby/lib/Qt.rb index 70e9c776..ce97965b 100644 --- a/qtruby/rubylib/qtruby/lib/Qt.rb +++ b/qtruby/rubylib/qtruby/lib/Qt.rb @@ -1 +1 @@ -require 'qtruby' +retquire 'qtruby' diff --git a/qtruby/rubylib/qtruby/lib/Qt/qtruby.rb b/qtruby/rubylib/qtruby/lib/Qt/qtruby.rb index 50f2eaef..d673facc 100644 --- a/qtruby/rubylib/qtruby/lib/Qt/qtruby.rb +++ b/qtruby/rubylib/qtruby/lib/Qt/qtruby.rb @@ -23,20 +23,20 @@ module Qt end module QtDebugChannel - QTDB_NONE = 0x00 - QTDB_AMBIGUOUS = 0x01 - QTDB_METHOD_MISSING = 0x02 - QTDB_CALLS = 0x04 - QTDB_GC = 0x08 - QTDB_VIRTUAL = 0x10 - QTDB_VERBOSE = 0x20 - QTDB_ALL = QTDB_VERBOSE | QTDB_VIRTUAL | QTDB_GC | QTDB_CALLS | QTDB_METHOD_MISSING | QTDB_AMBIGUOUS + TQTDB_NONE = 0x00 + TQTDB_AMBIGUOUS = 0x01 + TQTDB_METHOD_MISSING = 0x02 + TQTDB_CALLS = 0x04 + TQTDB_GC = 0x08 + TQTDB_VIRTUAL = 0x10 + TQTDB_VERBOSE = 0x20 + TQTDB_ALL = TQTDB_VERBOSE | TQTDB_VIRTUAL | TQTDB_GC | TQTDB_CALLS | TQTDB_METHOD_MISSING | TQTDB_AMBIGUOUS end @@debug_level = DebugLevel::Off def Qt.debug_level=(level) @@debug_level = level - Internal::setDebug Qt::QtDebugChannel::QTDB_ALL if level >= DebugLevel::Extensive + Internal::setDebug TQt::QtDebugChannel::TQTDB_ALL if level >= DebugLevel::Extensive end def Qt.debug_level @@ -45,62 +45,62 @@ module Qt class Base def self.signals(*signal_list) - meta = Qt::Meta[self.name] || Qt::MetaInfo.new(self) + meta = TQt::Meta[self.name] || TQt::MetaInfo.new(self) meta.add_signals(signal_list) meta.changed = true end def self.slots(*slot_list) - meta = Qt::Meta[self.name] || Qt::MetaInfo.new(self) + meta = TQt::Meta[self.name] || TQt::MetaInfo.new(self) meta.add_slots(slot_list) meta.changed = true end def **(a) - return Qt::**(self, a) + return TQt::**(self, a) end def +(a) - return Qt::+(self, a) + return TQt::+(self, a) end def ~(a) - return Qt::~(self, a) + return TQt::~(self, a) end def -@() - return Qt::-(self) + return TQt::-(self) end def -(a) - return Qt::-(self, a) + return TQt::-(self, a) end def *(a) - return Qt::*(self, a) + return TQt::*(self, a) end def /(a) - return Qt::/(self, a) + return TQt::/(self, a) end def %(a) - return Qt::%(self, a) + return TQt::%(self, a) end def >>(a) - return Qt::>>(self, a) + return TQt::>>(self, a) end def <<(a) - return Qt::<<(self, a) + return TQt::<<(self, a) end def &(a) - return Qt::&(self, a) + return TQt::&(self, a) end def ^(a) - return Qt::^(self, a) + return TQt::^(self, a) end def |(a) - return Qt::|(self, a) + return TQt::|(self, a) end # Module has '<', '<=', '>' and '>=' operator instance methods, so pretend they # don't exist by calling method_missing() explicitely def <(a) begin - Qt::method_missing(:<, self, a) + TQt::method_missing(:<, self, a) rescue super(a) end @@ -108,7 +108,7 @@ module Qt def <=(a) begin - Qt::method_missing(:<=, self, a) + TQt::method_missing(:<=, self, a) rescue super(a) end @@ -116,7 +116,7 @@ module Qt def >(a) begin - Qt::method_missing(:>, self, a) + TQt::method_missing(:>, self, a) rescue super(a) end @@ -124,7 +124,7 @@ module Qt def >=(a) begin - Qt::method_missing(:>=, self, a) + TQt::method_missing(:>=, self, a) rescue super(a) end @@ -134,7 +134,7 @@ module Qt # don't exist by calling method_missing() explicitely def ==(a) begin - Qt::method_missing(:==, self, a) + TQt::method_missing(:==, self, a) rescue super(a) end @@ -165,25 +165,25 @@ module Qt private def qt_methods(meths, flags) ids = [] - # These methods are all defined in Qt::Base, even if they aren't supported by a particular + # These methods are all defined in TQt::Base, even if they aren't supported by a particular # subclass, so remove them to avoid confusion meths -= ["%", "&", "*", "**", "+", "-", "-@", "/", "<", "<<", "<=", ">", ">=", ">>", "|", "~", "^"] - classid = Qt::Internal::idInstance(self) - Qt::Internal::getAllParents(classid, ids) + classid = TQt::Internal::idInstance(self) + TQt::Internal::getAllParents(classid, ids) ids << classid - ids.each { |c| Qt::Internal::findAllMethodNames(meths, c, flags) } + ids.each { |c| TQt::Internal::findAllMethodNames(meths, c, flags) } return meths.uniq end - end # Qt::Base + end # TQt::Base # Delete the underlying C++ instance after exec returns # Otherwise, rb_gc_call_finalizer_at_exit() can delete - # stuff that Qt::Application still needs for its cleanup. - class Application < Qt::Base + # stuff that TQt::Application still needs for its cleanup. + class Application < TQt::Base def exec method_missing(:exec) self.dispose - Qt::Internal.application_terminated = true + TQt::Internal.application_terminated = true end def exit(*args) @@ -195,7 +195,7 @@ module Qt end end - class BoxLayout < Qt::Base + class BoxLayout < TQt::Base include Enumerable def each @@ -207,19 +207,19 @@ module Qt end end - class Buffer < Qt::Base + class Buffer < TQt::Base def open(*args) method_missing(:open, *args) end end - class ButtonGroup < Qt::Base + class ButtonGroup < TQt::Base def id(*args) method_missing(:id, *args) end end - class ByteArray < Qt::Base + class ByteArray < TQt::Base def to_s return data() end @@ -233,31 +233,31 @@ module Qt end end - class CheckListItem < Qt::Base + class CheckListItem < TQt::Base def type(*args) method_missing(:type, *args) end end - class ChildEvent < Qt::Base + class ChildEvent < TQt::Base def type(*args) method_missing(:type, *args) end end - class ClassInfo < Qt::Base + class ClassInfo < TQt::Base def name(*args) method_missing(:name, *args) end end - class CloseEvent < Qt::Base + class CloseEvent < TQt::Base def type(*args) method_missing(:type, *args) end end - class Color < Qt::Base + class Color < TQt::Base def inspect str = super str.sub(/>$/, " %s>" % name) @@ -273,7 +273,7 @@ module Qt end end - class Connection < Qt::Base + class Connection < TQt::Base def inspect str = super str.sub(/>$/, " memberName=%s, memberType=%s, object=%s>" % @@ -287,13 +287,13 @@ module Qt end end - class ContextMenuEvent < Qt::Base + class ContextMenuEvent < TQt::Base def type(*args) method_missing(:type, *args) end end - class Cursor < Qt::Base + class Cursor < TQt::Base def inspect str = super str.sub(/>$/, " shape=%d>" % shape) @@ -305,13 +305,13 @@ module Qt end end - class CustomEvent < Qt::Base + class CustomEvent < TQt::Base def type(*args) method_missing(:type, *args) end end - class Date < Qt::Base + class Date < TQt::Base def inspect str = super str.sub(/>$/, " %s>" % toString) @@ -323,7 +323,7 @@ module Qt end end - class DateTime < Qt::Base + class DateTime < TQt::Base def inspect str = super str.sub(/>$/, " %s>" % toString) @@ -335,31 +335,31 @@ module Qt end end - class Dialog < Qt::Base + class Dialog < TQt::Base def exec(*args) method_missing(:exec, *args) end end - class DomAttr < Qt::Base + class DomAttr < TQt::Base def name(*args) method_missing(:name, *args) end end - class DomDocumentType < Qt::Base + class DomDocumentType < TQt::Base def name(*args) method_missing(:name, *args) end end - class DragLeaveEvent < Qt::Base + class DragLeaveEvent < TQt::Base def type(*args) method_missing(:type, *args) end end - class DropEvent < Qt::Base + class DropEvent < TQt::Base def format(*args) method_missing(:format, *args) end @@ -369,25 +369,25 @@ module Qt end end - class EucJpCodec < Qt::Base + class EucJpCodec < TQt::Base def name(*args) method_missing(:name, *args) end end - class EucKrCodec < Qt::Base + class EucKrCodec < TQt::Base def name(*args) method_missing(:name, *args) end end - class Event < Qt::Base + class Event < TQt::Base def type(*args) method_missing(:type, *args) end end - class EventLoop < Qt::Base + class EventLoop < TQt::Base def exec(*args) method_missing(:exec, *args) end @@ -397,7 +397,7 @@ module Qt end end - class File < Qt::Base + class File < TQt::Base def name(*args) method_missing(:name, *args) end @@ -407,13 +407,13 @@ module Qt end end - class FocusEvent < Qt::Base + class FocusEvent < TQt::Base def type(*args) method_missing(:type, *args) end end - class Font < Qt::Base + class Font < TQt::Base def inspect str = super str.sub(/>$/, " family=%s, pointSize=%d, weight=%d, italic=%s, bold=%s, underline=%s, strikeOut=%s>" % @@ -427,43 +427,43 @@ module Qt end end - class Ftp < Qt::Base + class Ftp < TQt::Base def abort(*args) method_missing(:abort, *args) end end - class GLContext < Qt::Base + class GLContext < TQt::Base def format(*args) method_missing(:format, *args) end end - class GLWidget < Qt::Base + class GLWidget < TQt::Base def format(*args) method_missing(:format, *args) end end - class Gb18030Codec < Qt::Base + class Gb18030Codec < TQt::Base def name(*args) method_missing(:name, *args) end end - class Gb2312Codec < Qt::Base + class Gb2312Codec < TQt::Base def name(*args) method_missing(:name, *args) end end - class GbkCodec < Qt::Base + class GbkCodec < TQt::Base def name(*args) method_missing(:name, *args) end end - class GridLayout < Qt::Base + class GridLayout < TQt::Base include Enumerable def each @@ -475,7 +475,7 @@ module Qt end end - class HBoxLayout < Qt::Base + class HBoxLayout < TQt::Base include Enumerable def each @@ -487,31 +487,31 @@ module Qt end end - class HebrewCodec < Qt::Base + class HebrewCodec < TQt::Base def name(*args) method_missing(:name, *args) end end - class HideEvent < Qt::Base + class HideEvent < TQt::Base def type(*args) method_missing(:type, *args) end end - class Http < Qt::Base + class Http < TQt::Base def abort(*args) method_missing(:abort, *args) end end - class HttpRequestHeader < Qt::Base + class HttpRequestHeader < TQt::Base def method(*args) method_missing(:method, *args) end end - class IconDrag < Qt::Base + class IconDrag < TQt::Base def format(*args) method_missing(:format, *args) end @@ -521,61 +521,61 @@ module Qt end end - class Image < Qt::Base + class Image < TQt::Base def load(*args) method_missing(:load, *args) end end - class ImageDecoder < Qt::Base + class ImageDecoder < TQt::Base def format(*args) method_missing(:format, *args) end end - class ImageDrag < Qt::Base + class ImageDrag < TQt::Base def format(*args) method_missing(:format, *args) end end - class ImageIO < Qt::Base + class ImageIO < TQt::Base def format(*args) method_missing(:format, *args) end end - class IMEvent < Qt::Base + class IMEvent < TQt::Base def type(*args) method_missing(:type, *args) end end - class JisCodec < Qt::Base + class JisCodec < TQt::Base def name(*args) method_missing(:name, *args) end end - class KeyEvent < Qt::Base + class KeyEvent < TQt::Base def type(*args) method_missing(:type, *args) end end - class LCDNumber < Qt::Base + class LCDNumber < TQt::Base def display(item) method_missing(:display, item) end end - class Layout < Qt::Base + class Layout < TQt::Base def freeze(*args) method_missing(:freeze, *args) end end - class LayoutIterator < Qt::Base + class LayoutIterator < TQt::Base def +(a) for i in 1..a send("operator++".to_sym) @@ -584,17 +584,17 @@ module Qt end end - class Library < Qt::Base + class Library < TQt::Base def load(*args) method_missing(:load, *args) end end - class ListView < Qt::Base + class ListView < TQt::Base include Enumerable def each - it = Qt::ListViewItemIterator.new(self) + it = TQt::ListViewItemIterator.new(self) while it.current yield it.current it += 1 @@ -606,11 +606,11 @@ module Qt end end - class ListViewItem < Qt::Base + class ListViewItem < TQt::Base include Enumerable def each - it = Qt::ListViewItemIterator.new(self) + it = TQt::ListViewItemIterator.new(self) while it.current yield it.current it += 1 @@ -641,7 +641,7 @@ module Qt end end - class Locale < Qt::Base + class Locale < TQt::Base def name(*args) method_missing(:name, *args) end @@ -650,13 +650,13 @@ module Qt end end - class MenuItem < Qt::Base + class MenuItem < TQt::Base def id(*args) method_missing(:id, *args) end end - class MetaData < Qt::Base + class MetaData < TQt::Base def method(*args) method_missing(:method, *args) end @@ -666,13 +666,13 @@ module Qt end end - class MetaEnum < Qt::Base + class MetaEnum < TQt::Base def name(*args) method_missing(:name, *args) end end - class MetaProperty < Qt::Base + class MetaProperty < TQt::Base def id(*args) method_missing(:id, *args) end @@ -686,43 +686,43 @@ module Qt end end - class MouseEvent < Qt::Base + class MouseEvent < TQt::Base def type(*args) method_missing(:type, *args) end end - class MoveEvent < Qt::Base + class MoveEvent < TQt::Base def type(*args) method_missing(:type, *args) end end - class Object < Qt::Base + class Object < TQt::Base def name(*args) method_missing(:name, *args) end end - class PaintEvent < Qt::Base + class PaintEvent < TQt::Base def type(*args) method_missing(:type, *args) end end - class Picture < Qt::Base + class Picture < TQt::Base def load(*args) method_missing(:load, *args) end end - class Pixmap < Qt::Base + class Pixmap < TQt::Base def load(*args) method_missing(:load, *args) end end - class Point < Qt::Base + class Point < TQt::Base def inspect str = super str.sub(/>$/, " x=%d, y=%d>" % [x, y]) @@ -734,25 +734,25 @@ module Qt end end - class PolygonScanner < Qt::Base + class PolygonScanner < TQt::Base def scan(*args) method_missing(:scan, *args) end end - class PopupMenu < Qt::Base + class PopupMenu < TQt::Base def exec(*args) method_missing(:exec, *args) end end - class Printer < Qt::Base + class Printer < TQt::Base def abort(*args) method_missing(:abort, *args) end end - class MetaObject < Qt::Base + class MetaObject < TQt::Base def inspect str = super str.sub!(/>$/, "") @@ -779,7 +779,7 @@ module Qt end end - class Rect < Qt::Base + class Rect < TQt::Base def inspect str = super str.sub(/>$/, " left=%d, right=%d, top=%d, bottom=%d>" % [left, right, top, bottom]) @@ -791,19 +791,19 @@ module Qt end end - class ResizeEvent < Qt::Base + class ResizeEvent < TQt::Base def type(*args) method_missing(:type, *args) end end - class ShowEvent < Qt::Base + class ShowEvent < TQt::Base def type(*args) method_missing(:type, *args) end end - class Size < Qt::Base + class Size < TQt::Base def inspect str = super str.sub(/>$/, " width=%d, height=%d>" % [width, height]) @@ -815,7 +815,7 @@ module Qt end end - class SizePolicy < Qt::Base + class SizePolicy < TQt::Base def inspect str = super str.sub(/>$/, " horData=%d, verData=%d>" % [horData, verData]) @@ -827,19 +827,19 @@ module Qt end end - class SjisCodec < Qt::Base + class SjisCodec < TQt::Base def name(*args) method_missing(:name, *args) end end - class Socket < Qt::Base + class Socket < TQt::Base def open(*args) method_missing(:open, *args) end end - class SocketDevice < Qt::Base + class SocketDevice < TQt::Base def open(*args) method_missing(:open, *args) end @@ -849,13 +849,13 @@ module Qt end end - class SocketNotifier < Qt::Base + class SocketNotifier < TQt::Base def type(*args) method_missing(:type, *args) end end - class SqlCursor < Qt::Base + class SqlCursor < TQt::Base def exec(*args) method_missing(:exec, *args) end @@ -869,7 +869,7 @@ module Qt end end - class SqlDatabase < Qt::Base + class SqlDatabase < TQt::Base def exec(*args) method_missing(:exec, *args) end @@ -878,19 +878,19 @@ module Qt end end - class SqlDriver < Qt::Base + class SqlDriver < TQt::Base def open(*args) method_missing(:open, *args) end end - class SqlError < Qt::Base + class SqlError < TQt::Base def type(*args) method_missing(:type, *args) end end - class SqlField < Qt::Base + class SqlField < TQt::Base def name(*args) method_missing(:name, *args) end @@ -900,7 +900,7 @@ module Qt end end - class SqlFieldInfo < Qt::Base + class SqlFieldInfo < TQt::Base def name(*args) method_missing(:name, *args) end @@ -910,19 +910,19 @@ module Qt end end - class SqlIndex < Qt::Base + class SqlIndex < TQt::Base def name(*args) method_missing(:name, *args) end end - class SqlQuery < Qt::Base + class SqlQuery < TQt::Base def exec(*args) method_missing(:exec, *args) end end - class SqlSelectCursor < Qt::Base + class SqlSelectCursor < TQt::Base def exec(*args) method_missing(:exec, *args) end @@ -936,31 +936,31 @@ module Qt end end - class StoredDrag < Qt::Base + class StoredDrag < TQt::Base def format(*args) method_missing(:format, *args) end end - class StyleSheetItem < Qt::Base + class StyleSheetItem < TQt::Base def name(*args) method_missing(:name, *args) end end - class TextDrag < Qt::Base + class TextDrag < TQt::Base def format(*args) method_missing(:format, *args) end end - class TabletEvent < Qt::Base + class TabletEvent < TQt::Base def type(*args) method_missing(:type, *args) end end - class Time < Qt::Base + class Time < TQt::Base def inspect str = super str.sub(/>$/, " %s>" % toString) @@ -972,55 +972,55 @@ module Qt end end - class TimeEdit < Qt::Base + class TimeEdit < TQt::Base def display method_missing(:display) end end - class TimerEvent < Qt::Base + class TimerEvent < TQt::Base def type(*args) method_missing(:type, *args) end end - class Translator < Qt::Base + class Translator < TQt::Base def load(*args) method_missing(:load, *args) end end - class TranslatorMessage < Qt::Base + class TranslatorMessage < TQt::Base def hash(*args) method_missing(:hash, *args) end end - class TsciiCodec < Qt::Base + class TsciiCodec < TQt::Base def name(*args) method_missing(:name, *args) end end - class UrlInfo < Qt::Base + class UrlInfo < TQt::Base def name(*args) method_missing(:name, *args) end end - class Utf16Codec < Qt::Base + class Utf16Codec < TQt::Base def name(*args) method_missing(:name, *args) end end - class Utf8Codec < Qt::Base + class Utf8Codec < TQt::Base def name(*args) method_missing(:name, *args) end end - class Variant < Qt::Base + class Variant < TQt::Base String = 3 Date = 26 Time = 27 @@ -1054,71 +1054,71 @@ module Qt def to_ruby case type() - when Qt::Variant::Bitmap + when TQt::Variant::Bitmap return toBitmap - when Qt::Variant::Bool + when TQt::Variant::Bool return toBool - when Qt::Variant::Brush + when TQt::Variant::Brush return toBrush - when Qt::Variant::ByteArray + when TQt::Variant::ByteArray return toByteArray - when Qt::Variant::Color + when TQt::Variant::Color return toColor - when Qt::Variant::ColorGroup + when TQt::Variant::ColorGroup return toColorGroup - when Qt::Variant::CString + when TQt::Variant::CString return toCString - when Qt::Variant::Cursor + when TQt::Variant::Cursor return toCursor - when Qt::Variant::Date + when TQt::Variant::Date return toDate - when Qt::Variant::DateTime + when TQt::Variant::DateTime return toDateTime - when Qt::Variant::Double + when TQt::Variant::Double return toDouble - when Qt::Variant::Font + when TQt::Variant::Font return toFont - when Qt::Variant::IconSet + when TQt::Variant::IconSet return toIconSet - when Qt::Variant::Image + when TQt::Variant::Image return toImage - when Qt::Variant::Int + when TQt::Variant::Int return toInt - when Qt::Variant::KeySequence + when TQt::Variant::KeySequence return toKeySequence - when Qt::Variant::List + when TQt::Variant::List return toList - when Qt::Variant::LongLong + when TQt::Variant::LongLong return toLongLong - when Qt::Variant::Map + when TQt::Variant::Map return toMap - when Qt::Variant::Palette + when TQt::Variant::Palette return toPalette - when Qt::Variant::Pen + when TQt::Variant::Pen return toPen - when Qt::Variant::Pixmap + when TQt::Variant::Pixmap return toPixmap - when Qt::Variant::Point + when TQt::Variant::Point return toPoint - when Qt::Variant::PointArray + when TQt::Variant::PointArray return toPointArray - when Qt::Variant::Rect + when TQt::Variant::Rect return toRect - when Qt::Variant::Region + when TQt::Variant::Region return toRegion - when Qt::Variant::Size + when TQt::Variant::Size return toSize - when Qt::Variant::SizePolicy + when TQt::Variant::SizePolicy return toSizePolicy - when Qt::Variant::String + when TQt::Variant::String return toString - when Qt::Variant::StringList + when TQt::Variant::StringList return toStringList - when Qt::Variant::Time + when TQt::Variant::Time return toTime - when Qt::Variant::UInt + when TQt::Variant::UInt return toUint - when Qt::Variant::ULongLong + when TQt::Variant::ULongLong return toULongLong end end @@ -1142,7 +1142,7 @@ module Qt end end - class VBoxLayout < Qt::Base + class VBoxLayout < TQt::Base include Enumerable def each @@ -1154,31 +1154,31 @@ module Qt end end - class WhatsThis < Qt::Base + class WhatsThis < TQt::Base def WhatsThis.display(*k) method_missing(:display, *k) end end - class WheelEvent < Qt::Base + class WheelEvent < TQt::Base def type(*args) method_missing(:type, *args) end end - class Widget < Qt::Base + class Widget < TQt::Base def raise(*args) method_missing(:raise, *args) end end - class WidgetStack < Qt::Base + class WidgetStack < TQt::Base def id(*args) method_missing(:id, *args) end end - class XmlAttributes < Qt::Base + class XmlAttributes < TQt::Base def type(*args) method_missing(:type, *args) end @@ -1260,7 +1260,7 @@ module Qt # If a C++ enum was converted to an ordinary ruby Integer, the # name of the type is lost. The enum type name is needed for overloaded # method resolution when two methods differ only by an enum type. - class Enum < Qt::Integer + class Enum < TQt::Integer attr_accessor :type def initialize(n, type) super(n) @@ -1318,7 +1318,7 @@ module Qt end end - class SignalBlockInvocation < Qt::Object + class SignalBlockInvocation < TQt::Object def initialize(parent, block, args) super(parent) self.class.slots "invoke(#{args})" @@ -1330,7 +1330,7 @@ module Qt end end - class BlockInvocation < Qt::Object + class BlockInvocation < TQt::Object def initialize(target, block, args) super(target) self.class.slots "invoke(#{args})" @@ -1352,7 +1352,7 @@ module Qt if classname =~ /^Qext/ now = classname.sub(/^Qext(?=[A-Z])/,'Qext::') elsif classname =~ /^Q/ - now = classname.sub(/^Q(?=[A-Z])/,'Qt::') + now = classname.sub(/^Q(?=[A-Z])/,'TQt::') elsif classname =~ /^(KConfigSkeleton|KWin)::/ now = classname.sub(/^K?(?=[A-Z])/,'KDE::') elsif classname !~ /::/ @@ -1365,12 +1365,12 @@ module Qt end def Internal.init_class(c) - classname = Qt::Internal::normalize_classname(c) - classId = Qt::Internal.idClass(c) + classname = TQt::Internal::normalize_classname(c) + classId = TQt::Internal.idClass(c) insert_pclassid(classname, classId) @@idclass[classId] = classname @@cpp_names[classname] = c - klass = isQObject(classId) ? create_qobject_class(classname) \ + klass = isTQObject(classId) ? create_qobject_class(classname) \ : create_qt_class(classname) @@classes[classname] = klass unless klass.nil? end @@ -1414,7 +1414,7 @@ module Qt return 0 end elsif argtype == 's' - if typename =~ /^(const )?((QChar)[*&]?)$/ + if typename =~ /^(const )?((TQChar)[*&]?)$/ return 1 elsif typename =~ /^(?:u?char\*|const u?char\*|(?:const )?(Q(C?)String)[*&]?)$/ qstring = !$1.nil? @@ -1424,12 +1424,12 @@ module Qt elsif argtype == 'a' # FIXME: shouldn't be hardcoded. Installed handlers should tell what ruby type they expect. if typename =~ /^(?: - const\ QCOORD\*| + const\ TQCOORD\*| (?:const\ )? (?: - QStringList[\*&]?| - QValueList<int>[\*&]?| - QRgb\*| + TQStringList[\*&]?| + TQValueList<int>[\*&]?| + TQRgb\*| char\*\* ) )$/x @@ -1446,7 +1446,7 @@ module Qt return 0 end elsif argtype == 'U' - if typename =~ /QStringList/ + if typename =~ /TQStringList/ return 1 else return 0 @@ -1610,18 +1610,18 @@ module Qt end def Internal.init_all_classes() - Qt::Internal::getClassList().each do |c| + TQt::Internal::getClassList().each do |c| if c == "Qt" - # Don't change Qt to Qt::t, just leave as is + # Don't change Qt to TQt::t, just leave as is @@cpp_names["Qt"] = c - elsif c != "QInternal" - Qt::Internal::init_class(c) + elsif c != "TQInternal" + TQt::Internal::init_class(c) end end - @@classes['Qt::Integer'] = Qt::Integer - @@classes['Qt::Boolean'] = Qt::Boolean - @@classes['Qt::Enum'] = Qt::Enum + @@classes['TQt::Integer'] = TQt::Integer + @@classes['TQt::Boolean'] = TQt::Boolean + @@classes['TQt::Enum'] = TQt::Enum end def Internal.get_qinteger(num) @@ -1633,7 +1633,7 @@ module Qt end def Internal.create_qenum(num, type) - return Qt::Enum.new(num, type) + return TQt::Enum.new(num, type) end def Internal.get_qenum_type(e) @@ -1699,7 +1699,7 @@ module Qt args.each_with_index do |arg, i| arg = arg.to_s a = arg.sub(/^const\s+/, '') - a = (a =~ /^(bool|int|double|char\*|QString)&?$/) ? $1 : 'ptr' + a = (a =~ /^(bool|int|double|char\*|TQString)&?$/) ? $1 : 'ptr' valid = setMocType(mocargs, i, arg, a) end result = [] @@ -1755,30 +1755,30 @@ module Qt def Internal.connect(src, signal, target, block) signature = (signal =~ /\((.*)\)/) ? $1 : "" - return Qt::Object.connect( src, + return TQt::Object.connect( src, signal, - Qt::BlockInvocation.new(target, block, signature), + TQt::BlockInvocation.new(target, block, signature), SLOT("invoke(#{signature})") ) end def Internal.signal_connect(src, signal, block) signature = (signal =~ /\((.*)\)/) ? $1 : "" - return Qt::Object.connect( src, + return TQt::Object.connect( src, signal, - Qt::SignalBlockInvocation.new(src, block, signature), + TQt::SignalBlockInvocation.new(src, block, signature), SLOT("invoke(#{signature})") ) end - end # Qt::Internal + end # TQt::Internal Meta = {} # An entry for each signal or slot # Example - # foobar(QString,bool) + # foobar(TQString,bool) # :name is 'foobar' - # :full_name is 'foobar(QString,bool)' - # :arg_types is 'QString,bool' - QObjectMember = Struct.new :name, :full_name, :arg_types + # :full_name is 'foobar(TQString,bool)' + # :arg_types is 'TQString,bool' + TQObjectMember = Struct.new :name, :full_name, :arg_types class MetaInfo attr_accessor :signals, :slots, :metaobject, :mocargs, :changed @@ -1797,9 +1797,9 @@ module Qt if signal.kind_of? Symbol signal = signal.to_s + "()" end - signal = Qt::Object.normalizeSignalSlot(signal) + signal = TQt::Object.normalizeSignalSlot(signal) if signal =~ /([^\s]*)\((.*)\)/ - @signals.push QObjectMember.new($1, signal, $2) + @signals.push TQObjectMember.new($1, signal, $2) else qWarning( "#{@klass.name}: Invalid signal format: '#{signal}'" ) end @@ -1810,7 +1810,7 @@ module Qt def get_signals all_signals = [] current = @klass - while current != Qt::Base + while current != TQt::Base meta = Meta[current.name] if !meta.nil? all_signals.concat meta.signals @@ -1825,9 +1825,9 @@ module Qt if slot.kind_of? Symbol slot = slot.to_s + "()" end - slot = Qt::Object.normalizeSignalSlot(slot) + slot = TQt::Object.normalizeSignalSlot(slot) if slot =~ /([^\s]*)\((.*)\)/ - @slots.push QObjectMember.new($1, slot, $2) + @slots.push TQObjectMember.new($1, slot, $2) else qWarning( "#{@klass.name}: Invalid slot format: '#{slot}'" ) end @@ -1838,7 +1838,7 @@ module Qt def get_slots all_slots = [] current = @klass - while current != Qt::Base + while current != TQt::Base meta = Meta[current.name] if !meta.nil? all_slots.concat meta.slots @@ -1847,7 +1847,7 @@ module Qt end return all_slots end - end # Qt::MetaInfo + end # TQt::MetaInfo IO_Direct = 0x0100 IO_Sequential = 0x0200 @@ -1955,7 +1955,7 @@ class Module klass = self classid = 0 loop do - classid = Qt::Internal::find_pclassid(klass.name) + classid = TQt::Internal::find_pclassid(klass.name) break if classid > 0 klass = klass.superclass @@ -1964,15 +1964,15 @@ class Module end end - # These methods are all defined in Qt::Base, even if they aren't supported by a particular + # These methods are all defined in TQt::Base, even if they aren't supported by a particular # subclass, so remove them to avoid confusion meths -= ["%", "&", "*", "**", "+", "-", "-@", "/", "<", "<<", "<=", ">", ">=", ">>", "|", "~", "^"] ids = [] if inc_super - Qt::Internal::getAllParents(classid, ids) + TQt::Internal::getAllParents(classid, ids) end ids << classid - ids.each { |c| Qt::Internal::findAllMethodNames(meths, c, flags) } + ids.each { |c| TQt::Internal::findAllMethodNames(meths, c, flags) } return meths.uniq end end |