Class: Qt::Base
- Inherits:
-
Object
show all
- Defined in:
- lib/Qt/qtruby4.rb,
lib/qttest/qttest.rb
Direct Known Subclasses
AbstractSlider, AbstractSocket, AbstractTextDocumentLayout, AccessibleEvent, Action, ActionEvent, Application, Buffer, ButtonGroup, ByteArray, CheckBox, ChildEvent, CloseEvent, Color, Connection, ContextMenuEvent, CoreApplication, Cursor, CustomEvent, DBusArgument, DBusConnection, DBusConnectionInterface, DBusError, DBusInterface, DBusMessage, Date, DateTime, Dial, Dialog, Dir, DomAttr, DomDocumentType, DoubleSpinBox, DoubleValidator, DragEnterEvent, DragLeaveEvent, DropEvent, Event, EventLoop, File, FileIconProvider, FileOpenEvent, FocusEvent, Font, FontDatabase, Ftp, GLContext, GLPixelBuffer, GLWidget, GenericArgument, Gradient, GraphicsEllipseItem, GraphicsItem, GraphicsItemGroup, GraphicsLineItem, GraphicsPathItem, GraphicsPixmapItem, GraphicsPolygonItem, GraphicsProxyWidget, GraphicsRectItem, GraphicsSceneContextMenuEvent, GraphicsSceneHelpEvent, GraphicsSceneHoverEvent, GraphicsSceneMouseEvent, GraphicsSceneWheelEvent, GraphicsSimpleTextItem, GraphicsSvgItem, GraphicsTextItem, GraphicsWidget, HelpEvent, HideEvent, HoverEvent, Http, HttpRequestHeader, IODevice, IconDragEvent, Image, ImageIOHandler, ImageReader, ImageWriter, InputEvent, InputMethodEvent, IntValidator, ItemSelection, ItemSelectionModel, KeyEvent, KeySequence, LCDNumber, Library, Line, LineF, ListWidgetItem, Locale, Menu, MetaClassInfo, MetaEnum, MetaMethod, MetaObject, MetaProperty, MetaType, ModelIndex, MouseEvent, MoveEvent, Movie, NetworkProxy, Object, PageSetupDialog, PaintEvent, Picture, PictureIO, Pixmap, PluginLoader, Point, PointF, Polygon, PolygonF, PrintDialog, Printer, Process, ProgressBar, ProgressDialog, PushButton, RadioButton, Rect, RectF, ResizeEvent, ScrollBar, Shortcut, ShortcutEvent, ShowEvent, Size, SizeF, SizePolicy, Slider, SocketNotifier, SpinBox, SqlDatabase, SqlError, SqlField, SqlIndex, SqlQuery, SqlResult, SqlTableModel, StandardItem, StandardItemModel, StatusTipEvent, StyleHintReturn, StyleOption, SyntaxHighlighter, TableWidgetItem, TemporaryFile, Test, TextCursor, TextDocument, TextFormat, TextImageFormat, TextInlineObject, TextLength, TextList, TextObject, TextTable, TextTableCell, Time, TimeLine, TimerEvent, ToolButton, Translator, TreeWidget, TreeWidgetItem, TreeWidgetItemIterator, Url, UrlInfo, Uuid, Variant, WhatsThisClickedEvent, Widget, WindowStateChangeEvent, XmlAttributes
Class Method Summary
collapse
Instance Method Summary
collapse
-
#%(a) ⇒ Object
-
#&(a) ⇒ Object
-
#*(a) ⇒ Object
-
#**(a) ⇒ Object
-
#+(a) ⇒ Object
-
#-(a) ⇒ Object
-
#-@ ⇒ Object
-
#/(a) ⇒ Object
-
#<(a) ⇒ Object
Module has ‘<’, ‘<=’, ‘>’ and ‘>=’ operator instance methods, so pretend they don’t exist by calling method_missing() explicitely.
-
#<<(a) ⇒ Object
-
#<=(a) ⇒ Object
-
#==(a) ⇒ Object
Object has a ‘==’ operator instance method, so pretend it don’t exist by calling method_missing() explicitely.
-
#>(a) ⇒ Object
-
#>=(a) ⇒ Object
-
#>>(a) ⇒ Object
-
#^(a) ⇒ Object
-
#is_a?(mod) ⇒ Boolean
(also: #kind_of?)
Change the behaviors of is_a? and kind_of? (alias of is_a?) to use above self.ancestors method Note: this definition also affects Object#===.
-
#methods(regular = true) ⇒ Object
-
#protected_methods ⇒ Object
-
#public_methods ⇒ Object
-
#QCOMPARE(actual, expected) ⇒ Object
-
#QEXPECT_FAIL(dataIndex, comment, mode) ⇒ Object
-
#QFAIL(message) ⇒ Object
-
#QSKIP(statement, mode) ⇒ Object
-
#QTEST(actual, testElement) ⇒ Object
-
#QVERIFY(statement) ⇒ Object
-
#QVERIFY2(statement, description) ⇒ Object
-
#QWARN(msg) ⇒ Object
-
#singleton_methods ⇒ Object
-
#|(a) ⇒ Object
-
#~(a) ⇒ Object
Class Method Details
.ancestors ⇒ Object
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
|
# File 'lib/Qt/qtruby4.rb', line 183
def self.ancestors
klass = self
classid = nil
loop do
classid = Qt::Internal::find_pclassid(klass.name)
break if classid.index
klass = klass.superclass
if klass.nil?
return super
end
end
klasses = super
klasses.delete(Qt::Base)
klasses.delete(self)
ids = []
Qt::Internal::getAllParents(classid, ids)
return [self] + ids.map {|id| Qt::Internal.find_class(Qt::Internal.classid2name(id))} + klasses
end
|
.private_slots(*slot_list) ⇒ Object
.q_classinfo(key, value) ⇒ Object
92
93
94
95
96
|
# File 'lib/Qt/qtruby4.rb', line 92
def self.q_classinfo(key, value)
meta = Qt::Meta[self.name] || Qt::MetaInfo.new(self)
meta.add_classinfo(key, value)
meta.changed = true
end
|
.signals(*signal_list) ⇒ Object
Instance Method Details
119
120
121
|
# File 'lib/Qt/qtruby4.rb', line 119
def %(a)
return Qt::%(self, a)
end
|
128
129
130
|
# File 'lib/Qt/qtruby4.rb', line 128
def &(a)
return Qt::&(self, a)
end
|
113
114
115
|
# File 'lib/Qt/qtruby4.rb', line 113
def *(a)
return Qt::*(self, a)
end
|
98
99
100
|
# File 'lib/Qt/qtruby4.rb', line 98
def **(a)
return Qt::**(self, a)
end
|
101
102
103
|
# File 'lib/Qt/qtruby4.rb', line 101
def +(a)
return Qt::+(self, a)
end
|
110
111
112
|
# File 'lib/Qt/qtruby4.rb', line 110
def -(a)
return Qt::-(self, a)
end
|
107
108
109
|
# File 'lib/Qt/qtruby4.rb', line 107
def -@()
return Qt::-(self)
end
|
116
117
118
|
# File 'lib/Qt/qtruby4.rb', line 116
def /(a)
return Qt::/(self, a)
end
|
Module has ‘<’, ‘<=’, ‘>’ and ‘>=’ operator instance methods, so pretend they don’t exist by calling method_missing() explicitely
140
141
142
143
144
145
146
|
# File 'lib/Qt/qtruby4.rb', line 140
def <(a)
begin
Qt::method_missing(:<, self, a)
rescue
super(a)
end
end
|
125
126
127
|
# File 'lib/Qt/qtruby4.rb', line 125
def <<(a)
return Qt::<<(self, a)
end
|
148
149
150
151
152
153
154
|
# File 'lib/Qt/qtruby4.rb', line 148
def <=(a)
begin
Qt::method_missing(:<=, self, a)
rescue
super(a)
end
end
|
Object has a ‘==’ operator instance method, so pretend it don’t exist by calling method_missing() explicitely
174
175
176
177
178
179
180
181
|
# File 'lib/Qt/qtruby4.rb', line 174
def ==(a)
return false if a.nil?
begin
Qt::method_missing(:==, self, a)
rescue
super(a)
end
end
|
156
157
158
159
160
161
162
|
# File 'lib/Qt/qtruby4.rb', line 156
def >(a)
begin
Qt::method_missing(:>, self, a)
rescue
super(a)
end
end
|
164
165
166
167
168
169
170
|
# File 'lib/Qt/qtruby4.rb', line 164
def >=(a)
begin
Qt::method_missing(:>=, self, a)
rescue
super(a)
end
end
|
122
123
124
|
# File 'lib/Qt/qtruby4.rb', line 122
def >>(a)
return Qt::>>(self, a)
end
|
131
132
133
|
# File 'lib/Qt/qtruby4.rb', line 131
def ^(a)
return Qt::^(self, a)
end
|
#is_a?(mod) ⇒ Boolean
Also known as:
kind_of?
Change the behaviors of is_a? and kind_of? (alias of is_a?) to use above self.ancestors method Note: this definition also affects Object#===
206
207
208
|
# File 'lib/Qt/qtruby4.rb', line 206
def is_a?(mod)
super || self.class.ancestors.include?(mod)
end
|
#methods(regular = true) ⇒ Object
211
212
213
214
215
216
217
|
# File 'lib/Qt/qtruby4.rb', line 211
def methods(regular=true)
if !regular
return singleton_methods
end
qt_methods(super, 0x0)
end
|
#protected_methods ⇒ Object
219
220
221
222
|
# File 'lib/Qt/qtruby4.rb', line 219
def protected_methods
qt_methods(super, 0x80)
end
|
#public_methods ⇒ Object
224
225
226
|
# File 'lib/Qt/qtruby4.rb', line 224
def public_methods
methods
end
|
#QCOMPARE(actual, expected) ⇒ Object
134
135
136
137
138
139
|
# File 'lib/qttest/qttest.rb', line 134
def QCOMPARE(actual, expected)
file, line = caller(1)[0].split(':')
if !Qt::Test.qCompare(eval(actual, Qt::Test.current_binding), eval(expected, Qt::Test.current_binding), actual, expected, file, line.to_i)
return eval('return', Qt::Test.current_binding)
end
end
|
#QEXPECT_FAIL(dataIndex, comment, mode) ⇒ Object
147
148
149
150
151
152
|
# File 'lib/qttest/qttest.rb', line 147
def QEXPECT_FAIL(dataIndex, , mode)
file, line = caller(1)[0].split(':')
if !Qt::Test.qExpectFail(dataIndex, , mode, file, line.to_i)
return eval('return', Qt::Test.current_binding)
end
end
|
#QFAIL(message) ⇒ Object
115
116
117
118
119
|
# File 'lib/qttest/qttest.rb', line 115
def QFAIL(message)
file, line = caller(1)[0].split(':')
Qt::Test.qFail(message, file, line.to_i)
return eval('return', Qt::Test.current_binding)
end
|
#QSKIP(statement, mode) ⇒ Object
141
142
143
144
145
|
# File 'lib/qttest/qttest.rb', line 141
def QSKIP(statement, mode)
file, line = caller(1)[0].split(':')
Qt::Test.qSkip(statement, mode, file, line.to_i)
return eval('return', Qt::Test.current_binding)
end
|
#QTEST(actual, testElement) ⇒ Object
154
155
156
157
158
159
|
# File 'lib/qttest/qttest.rb', line 154
def QTEST(actual, testElement)
file, line = caller(1)[0].split(':')
if !Qt::Test.qTest(eval(actual, Qt::Test.current_binding), eval(testElement, Qt::Test.current_binding), actual, testElement, file, line.to_i)
return eval('return', Qt::Test.current_binding)
end
end
|
#QVERIFY(statement) ⇒ Object
108
109
110
111
112
113
|
# File 'lib/qttest/qttest.rb', line 108
def QVERIFY(statement)
file, line = caller(1)[0].split(':')
if !Qt::Test.qVerify(eval(statement, Qt::Test.current_binding), statement, "", file, line.to_i)
return eval('return', Qt::Test.current_binding)
end
end
|
#QVERIFY2(statement, description) ⇒ Object
121
122
123
124
125
126
127
128
129
130
131
132
|
# File 'lib/qttest/qttest.rb', line 121
def QVERIFY2(statement, description)
file, line = caller(1)[0].split(':')
if eval(statement, Qt::Test.current_binding)
if !Qt::Test.qVerify(true, statement, description, file, line.to_i)
return eval('return', Qt::Test.current_binding)
end
else
if !Qt::Test.qVerify(false, statement, description, file, line.to_i)
return eval('return', Qt::Test.current_binding)
end
end
end
|
#QWARN(msg) ⇒ Object
161
162
163
|
# File 'lib/qttest/qttest.rb', line 161
def QWARN(msg)
Qt::Test.qWarn(msg)
end
|
#singleton_methods ⇒ Object
228
229
230
231
|
# File 'lib/Qt/qtruby4.rb', line 228
def singleton_methods
qt_methods(super, 0x01)
end
|
134
135
136
|
# File 'lib/Qt/qtruby4.rb', line 134
def |(a)
return Qt::|(self, a)
end
|
104
105
106
|
# File 'lib/Qt/qtruby4.rb', line 104
def ~(a)
return Qt::~(self, a)
end
|