Module: Qt::Internal
- Extended by:
- Internal
- Included in:
- Internal
- Defined in:
- lib/qt_connect/qt_compat.rb,
lib/qt_connect/qt_sugar.rb,
lib/qt_connect/qt_compat.rb,
lib/qt_connect/qt_jbindings.rb,
lib/qt_connect/qt_jbindings.rb
Overview
namespace Qt::Internal
Constant Summary collapse
- EmbeddedClasses =
{ ‘Qt::WebPage’ => [‘Qt::WebFrame’]}
{}
- Signature2Signal =
this table overrides the default signature to method name mapping signals mapped to an empty string are ignored
{ 'Qt::AbstractButton' => { 'clicked()' => '', 'activated(int)' => ''}, 'Qt::AbstractItemDelegate' => { 'closeEditor(QWidget*)' => ''}, 'Qt::Action' => { 'triggered()' => '', 'activated()' => '', 'activated(int)' => ''}, 'Qt::ButtonGroup' => { 'buttonClicked(int)' => 'buttonIdClicked', 'buttonPressed(int)' => 'buttonIdPressed', 'buttonReleased(int)' => 'buttonIdReleased'}, 'Qt::ComboBox' => { 'activated(int)' => 'activatedIndex', 'highlighted(int)' => 'highlightedIndex', 'currentIndexChanged(QString)' => 'currentStringChanged'}, 'Qt::Completer' => { 'activated(QModelIndex)' => 'activatedIndex', 'highlighted(QModelIndex)' => 'highlightedIndex'}, 'Qt::DoubleSpinBox' => { 'valueChanged(QString)' => 'valueStringChanged'}, 'Qt::GroupBox' => { 'clicked()' => ''}, 'Qt::Process' => { 'finished(int,QProcess::ExitStatus)' => 'finishedWithStatusCode'}, 'Qt::SignalMapper' => { 'mapped(int)' => 'mappedInteger', 'mapped(QString)' => 'mappedString', 'mapped(QObject*)' => 'mappedQObject'}, 'Qt::SpinBox' => { 'valueChanged(QString)' => 'valueStringChanged'}, 'Qt::TabWidget' => { 'currentChanged(QWidget*)' => ''}, 'Qt::TextBrowser' => { 'highlighted(QString)' => 'highlightedString'}}
- DONT_ABBREVIATE =
for all constants which inherit from the Enum class or are “public static final int” fields define a shorthand notation to be compatible with the Ruby version of qtbindings e.g. Qt::PenStyle::SolidLine can be abbreviated to Qt::SolidLine suppress clashing or otherwise undesirable shorthands with an entry in the DONT_ABBREVIATE hash.
{ 'Qt::WindowType::Widget' => true, 'Qt::WindowType::Dialog' => true, 'Qt::WindowType::ToolTip' => true, 'Qt::WindowType::SplashScreen' => true, 'Qt::Style::PixelMetric::CustomEnum' => true, 'Qt::Style::PrimitiveElement::CustomEnum' => true, 'Qt::Style::ContentsType::CustomEnum' => true, 'Qt::Style::ComplexControl::CustomEnum' => true, 'Qt::Style::SubElement::CustomEnum' => true, 'Qt::Style::ControlElement::CustomEnum' => true, 'Qt::Style::StandardPixmap::CustomEnum' => true, }
- AbstractSlider =
Proc.new do def range=(arg) if arg.kind_of? Range return setRange(arg.begin, arg.exclude_end? ? arg.end - 1 : arg.end) else return setRange(arg) end end end
- AbstractTextDocumentLayout =
QtRuby uses: Qt::AbstractTextDocumentLayout::PaintContext.new QtJambi : Qt::AbstractTextDocumentLayout_PaintContext
Proc.new do self.const_set('PaintContext',Qt::AbstractTextDocumentLayout_PaintContext) end
- ByteArray =
Proc.new do def +(o) self.clone.append(o) end end
- DataStream =
Proc.new do class << self alias :orig_new :new def new(*a,&block) args=a.dup args[1]=Qt::IODevice::OpenMode.new(args[1]) if (args.size>1) && args[1].kind_of?(Fixnum) return orig_new(*args,&block) end end alias orig_setVersion setVersion def setVersion(a) orig_setVersion(a.respond_to?(:value) ? a.value : a) end alias set_version setVersion alias version= setVersion def <<(arg) case arg when String ; writeString(arg) when Float,Java::Float ; writeFloat(arg) when Fixnum,Java::Int ; writeInt(arg) when Java::Double ; writeDouble(arg) when Java::ComTrolltechQtGui::QPixmap, Java::ComTrolltechQtGui::QImage, Java::ComTrolltechQtCore::QPointF, Java::ComTrolltechQtCore::QPoint, Java::ComTrolltechQtCore::QRect, Java::ComTrolltechQtCore::QRectF, Java::ComTrolltechQtGui::QRegion, Java::ComTrolltechQtCore::QSize, Java::ComTrolltechQtCore::QSizeF arg.writeTo(self) else raise "Qt::Datastream: no '<<' for #{arg.class}" end self # allows concatenation end def >>(arg) case arg when String ; arg=readString when Float ; arg=readFloat when Fixnum ; arg=readInt when Java::ComTrolltechQtGui::QPixmap, Java::ComTrolltechQtGui::QImage, Java::ComTrolltechQtCore::QPointF, Java::ComTrolltechQtCore::QPoint, Java::ComTrolltechQtCore::QRect, Java::ComTrolltechQtCore::QRectF, Java::ComTrolltechQtGui::QRegion, Java::ComTrolltechQtCore::QSize, Java::ComTrolltechQtCore::QSizeF arg.readFrom(self) else raise "Qt::Datastream: no '>>' for #{arg.class}" end self end end
- DoubleSpinBox =
Proc.new do def range=(arg) if arg.kind_of? Range return setRange(arg.begin, arg.exclude_end? ? arg.end - 1 : arg.end) else return setRange(arg) end end end
- Drag =
Proc.new do alias orig_exec exec def exec(*a) args=a.dup args[0]=Qt::DropActions.new(args[0]) if args[0].kind_of? Fixnum orig_exec(*args) end alias :start :exec end
- File =
Proc.new do alias orig_open open def open(a) arg=(a.kind_of?(Fixnum)) ? Qt::IODevice::OpenMode.new(a) : a orig_open(arg) end end
- FileDialog =
Proc.new do class << self #getSaveFileName alias orig_getSaveFileName getSaveFileName def getSaveFileName(*a) args=a.dup args[3]=self::Filter.new(args[3]) if args.size==4 && (args[3].kind_of?(String)) orig_getSaveFileName(*args) end alias get_save_file_name getSaveFileName #getOpenFilename alias orig_getOpenFileName getOpenFileName def getOpenFileName(*a) args=a.dup args[3]=self::Filter.new(args[3]) if args.size==4 && (args[3].kind_of?(String)) orig_getOpenFileName(*args) end alias get_open_file_name getOpenFileName #getOpenFilenames alias orig_getOpenFileNames getOpenFileNames def getOpenFileNames(*a) args=a.dup args[3]=self::Filter.new(args[3]) if args.size==4 && (args[3].kind_of?(String)) orig_getOpenFileNames(*args) end alias get_open_file_names getOpenFileNames end end
- FontDialog =
Proc.new do class << self alias orig_getFont getFont def getFont(*a) args=a.dup if args[0].kind_of? Qt::Boolean ok=args.shift result=orig_getFont(*args) ok.value=result.ok result.font else orig_getFont(*args) end end alias get_font getFont end end
- FontMetrics =
Proc.new do alias :orig_size :size def size(*a) args=a.dup args[0]=args[0].value if args[0].respond_to?(:value) orig_size(*args) end end
- InputDialog =
Proc.new do class << self #getInt #getInteger alias orig_getInt getInt def getInt(*a) args=a.dup if args[-1].kind_of? Qt::Boolean ok=args.pop result=orig_getInt(*args) ok.value=(result.nil?) ? false : true result else orig_getInt(*args) end end alias get_int getInt alias getInteger getInt alias get_integer getInt #getDouble alias orig_getDouble getDouble def getDouble(*a) args=a.dup if args[-1].kind_of? Qt::Boolean ok=args.pop result=orig_getDouble(*args) ok.value=(result.nil?) ? false : true result else orig_getDouble(*args) end end alias get_double getDouble #getItem alias :orig_getItem :getItem def getItem(*a) args=a.dup if args[-1].kind_of? Qt::Boolean ok=args.pop result=orig_getItem(*args) ok.value=(result.nil?) ? false : true result else orig_getItem(*args) end end alias get_item getItem #getText alias :orig_getText :getText def getText(*a) args=a.dup if args[-1].kind_of? Qt::Boolean ok=args.pop result=orig_getText(*args) ok.value=(result.nil?) ? false : true result else orig_getText(*args) end end alias :get_text :getText end end
- Label =
Proc.new do alias :orig_setAlignment :setAlignment def setAlignment(a) a=Qt::Alignment.new(a) if a.kind_of?(Fixnum) orig_setAlignment(a) end alias :'alignment=' :setAlignment end
- Layout =
Proc.new do alias :spacing :widgetSpacing alias :setSpacing :setWidgetSpacing alias :set_spacing :setWidgetSpacing end
- ListWidgetItem =
Proc.new do alias :orig_setTextAlignment :setTextAlignment def setTextAlignment(a) arg=(a.respond_to?(:value)) ? a.value : a orig_setTextAlignment(arg) end alias textAlignment= setTextAlignment #examples\draganddrop\puzzle alias :orig_setFlags :setFlags def setFlags(a) arg=(a.kind_of? Fixnum) ? Qt::ItemFlags.new(a) : a orig_setFlags(arg) end alias :set_flags :setFlags end
- MessageBox =
Proc.new do class<<self alias orig_critical critical def critical(*a) args=a.dup (a.size-4).times{ x=args.pop ; args[-1] |= x} orig_critical(*args) end alias orig_question question def question(*a) args=a.dup (a.size-4).times{ x=args.pop ; args[-1] |= x} orig_question(*args) end end end
- Painter =
Proc.new do alias orig_drawText drawText def drawText(*a) args=a.dup args[1]=args[1].value if (args[1].respond_to?(:value)) orig_drawText(*args) end alias draw_text drawText end
- Palette =
examplesdraganddropdragabletext
Proc.new do #Background=ColorRole::Window (Background is Obsolete) const_set('Background',const_get(:ColorRole).const_get(:Window)) end
- ProgressDialog =
Proc.new do def range=(arg) if arg.kind_of? Range return setRange(arg.begin, arg.exclude_end? ? arg.end - 1 : arg.end) else return setRange(arg) end end end
- SignalMapper =
Proc.new do def mapped return mappedQObject end end
- SizePolicy =
Proc.new do class << self alias :orig_new :new def new(*args,&block) args=args.map{ |arg| arg.kind_of?(Fixnum) ? Qt::SizePolicy::Policy.resolve(arg) : arg} return orig_new(*args,&block) end end end
- SpinBox =
Proc.new do def range=(arg) if arg.kind_of? Range return setRange(arg.begin, arg.exclude_end? ? arg.end - 1 : arg.end) else return setRange(arg) end end end
- TableWidgetItem =
Proc.new do alias orig_setTextAlignment setTextAlignment def setTextAlignment(a) arg=(a.respond_to?(:value)) ? a.value : a orig_setTextAlignment(arg) end alias textAlignment= setTextAlignment alias set_text_alignment setTextAlignment alias orig_setFlags setFlags def setFlags(*a) args=a.dup args[0]=Qt::ItemFlags.new(args[0]) if args[0].kind_of? Fixnum orig_setFlags(*args) end alias set_flags setFlags alias flags= setFlags end
- TextCharFormat =
Proc.new do alias :orig_fw :setFontWeight def setFontWeight(val) orig_fw( (val.respond_to? :value) ? val.value : val) end alias :set_font_weight :setFontWeight alias :'fontWeight=' :setFontWeight end
- TextStream =
Proc.new do def <<(a) self.writeString(a) end def >>(a) a.replace(readString) end end
- Variant =
Proc.new do class << self def new(obj=nil) return obj end alias fromValue new alias from_value new end end
- Packages =
define here which packages to include
%w{ com.trolltech.qt com.trolltech.qt.core com.trolltech.qt.gui com.trolltech.qt.network com.trolltech.qt.opengl com.trolltech.qt.phonon com.trolltech.qt.sql com.trolltech.qt.svg com.trolltech.qt.webkit com.trolltech.qt.xml com.trolltech.qt.xmlpatterns }
- RUBY_extensions =
keep track of RUBY extensions for classexplorer
[]
- Application =
Proc.new do class << self #QAppplication has only a single instance, which needs to be initialized #in an uninitialized object unexpected things don't work #e.g. it can't process plug-ins like jpeg #java_send used to avoid confusion with Ruby initialize constructor def new(args,&block) java_send(:initialize,[java.lang.String[]],args.to_java(:string)) $qApp=self if block_given? if block.arity == -1 || block.arity == 0 instance_eval(&block) elsif block.arity == 1 block.call(self) else raise ArgumentError, "Wrong number of arguments to block(#{block.arity} ; should be 1 or 0)" end end return self end alias :orig_translate :translate def translate(context,sourcetext,comment=nil,encoding=nil) if encoding int=(encoding.respond_to? :value) ? encoding.value : encoding orig_translate(context,sourcetext,comment,int) else orig_translate(context,sourcetext) end end end end
Instance Method Summary collapse
- #signature(*args) ⇒ Object (also: #signatures)
Instance Method Details
#signature(*args) ⇒ Object Also known as: signatures
53 54 55 |
# File 'lib/qt_connect/qt_jbindings.rb', line 53 def signature(*args) RUBY_extensions.concat(args) end |