[Kde-bindings] KDE/kdebindings/qtruby
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Sun Jul 16 22:28:18 UTC 2006
SVN commit 563195 by rdale:
* Added a QVariantList marshaller
* The correct QGraphicsScene event class instance is instantianted from
the event.type()'s
* The Qt::GraphicsItems in a Qt::GraphicsScene are marked so they won't
won't get garbage collected prematurely
* Added QT_TR_NOOP() and QT_TRANSLATE_NOOP() methods for completeness
* Added Qt::Graphics examples: graphicsview/collidingmice and dragdroprobot
CCMAIL: kde-bindings at kde.org
M +10 -0 ChangeLog
A rubylib/examples/graphicsview (directory)
A rubylib/examples/graphicsview/collidingmice (directory)
A rubylib/examples/graphicsview/collidingmice/images (directory)
AM rubylib/examples/graphicsview/collidingmice/images/cheese.jpg
A rubylib/examples/graphicsview/collidingmice/main.rb
A rubylib/examples/graphicsview/collidingmice/makefile
A rubylib/examples/graphicsview/collidingmice/mice.qrc
A rubylib/examples/graphicsview/collidingmice/mouse.rb
A rubylib/examples/graphicsview/dragdroprobot (directory)
A rubylib/examples/graphicsview/dragdroprobot/coloritem.rb
A rubylib/examples/graphicsview/dragdroprobot/images (directory)
AM rubylib/examples/graphicsview/dragdroprobot/images/head.png
A rubylib/examples/graphicsview/dragdroprobot/main.rb
A rubylib/examples/graphicsview/dragdroprobot/makefile
A rubylib/examples/graphicsview/dragdroprobot/robot.qrc
A rubylib/examples/graphicsview/dragdroprobot/robot.rb
M +44 -1 rubylib/qtruby/handlers.cpp
M +39 -0 rubylib/qtruby/lib/Qt/qtruby.rb
--- trunk/KDE/kdebindings/qtruby/ChangeLog #563194:563195
@@ -1,3 +1,13 @@
+2006-07-16 Richard Dale <rdale at foton.es>
+
+ * Added a QVariantList marshaller
+ * The correct QGraphicsScene event class instance is instantianted from
+ the event.type()'s
+ * The Qt::GraphicsItems in a Qt::GraphicsScene are marked so they won't
+ won't get garbage collected prematurely
+ * Added QT_TR_NOOP() and QT_TRANSLATE_NOOP() methods for completeness
+ * Added Qt::Graphics examples: graphicsview/collidingmice and dragdroprobot
+
2006-07-05 Richard Dale <rdale at foton.es>
* Added some marshallers for Qt 4.2, for QList<QGraphicsItem*>,
** trunk/KDE/kdebindings/qtruby/rubylib/examples/graphicsview/collidingmice/images/cheese.jpg #property svn:mime-type
+ application/octet-stream
** trunk/KDE/kdebindings/qtruby/rubylib/examples/graphicsview/dragdroprobot/images/head.png #property svn:mime-type
+ application/octet-stream
--- trunk/KDE/kdebindings/qtruby/rubylib/qtruby/handlers.cpp #563194:563195
@@ -43,6 +43,7 @@
#include <QtCore/qhash.h>
#if QT_VERSION >= 0x40200
+#include <QtGui/qgraphicsscene.h>
#include <QtGui/qgraphicsitem.h>
#include <QtGui/qstandarditemmodel.h>
#include <QtGui/qundostack.h>
@@ -205,6 +206,24 @@
return;
}
+#if QT_VERSION >= 0x40200
+ if (isDerivedFromByName(o->smoke, className, "QGraphicsScene")) {
+ QGraphicsScene * scene = (QGraphicsScene *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("QGraphicsScene"));
+ QList<QGraphicsItem *> list = scene->items();
+ for (int i = 0; i < list.size(); i++) {
+ QGraphicsItem * item = list.at(i);
+ if (item != 0) {
+ obj = getPointerObject(item);
+ if (obj != Qnil) {
+ if (do_debug & qtdb_gc) qWarning("Marking (%s*)%p -> %p\n", "QGraphicsItem", item, (void*)obj);
+ rb_gc_mark(obj);
+ }
+ }
+ }
+ return;
+ }
+#endif
+
if (isDerivedFromByName(o->smoke, className, "QObject")) {
QObject * qobject = (QObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("QObject"));
// Only mark the QObject tree if the current item doesn't have a parent.
@@ -466,6 +485,30 @@
case QEvent::AccessibilityHelp:
case QEvent::AccessibilityDescription:
return "Qt::Event";
+#if QT_VERSION >= 0x40200
+ case QEvent::GraphicsSceneMouseMove:
+ case QEvent::GraphicsSceneMousePress:
+ case QEvent::GraphicsSceneMouseRelease:
+ case QEvent::GraphicsSceneMouseDoubleClick:
+ return "Qt::GraphicsSceneMouseEvent";
+ case QEvent::GraphicsSceneContextMenu:
+ return "Qt::GraphicsSceneContextMenuEvent";
+ case QEvent::GraphicsSceneHoverEnter:
+ case QEvent::GraphicsSceneHoverMove:
+ case QEvent::GraphicsSceneHoverLeave:
+ return "Qt::GraphicsSceneHoverEvent";
+ case QEvent::GraphicsSceneHelp:
+ return "Qt::GraphicsSceneHelpEvent";
+ case QEvent::GraphicsSceneDragEnter:
+ case QEvent::GraphicsSceneDragMove:
+ case QEvent::GraphicsSceneDragLeave:
+ case QEvent::GraphicsSceneDrop:
+ return "Qt::GraphicsSceneDragDropEvent";
+ case QEvent::GraphicsSceneWheel:
+ return "Qt::GraphicsSceneWheelEvent";
+ case QEvent::KeyboardLayoutChange:
+ return "Qt::Event";
+#endif
default:
break;
}
@@ -1839,7 +1882,6 @@
{ "QList<qreal>", marshall_QListqreal },
{ "QList<int>", marshall_QListInt },
{ "QList<int>&", marshall_QListInt },
- { "QList<QVariant>", marshall_QVariantList },
{ "QList<QTableWidgetSelectionRange>", marshall_QTableWidgetSelectionRangeList },
{ "QList<QTextLayout::FormatRange>", marshall_QTextLayoutFormatRangeList },
{ "QList<QTextLayout::FormatRange>&", marshall_QTextLayoutFormatRangeList },
@@ -1849,6 +1891,7 @@
{ "QList<QHostAddress>&", marshall_QHostAddressList },
{ "QList<QVariant>", marshall_QVariantList },
{ "QList<QVariant>&", marshall_QVariantList },
+ { "QVariantList&", marshall_QVariantList },
{ "QList<QPixmap>", marshall_QPixmapList },
{ "QList<QModelIndex>", marshall_QModelIndexList },
{ "QList<QModelIndex>&", marshall_QModelIndexList },
--- trunk/KDE/kdebindings/qtruby/rubylib/qtruby/lib/Qt/qtruby.rb #563194:563195
@@ -388,6 +388,12 @@
end
end
+ class DragEnterEvent < Qt::Base
+ def type(*args)
+ method_missing(:type, *args)
+ end
+ end
+
class DragLeaveEvent < Qt::Base
def type(*args)
method_missing(:type, *args)
@@ -487,6 +493,36 @@
end
end
+ class GraphicsSceneMouseEvent < Qt::Base
+ def type(*args)
+ method_missing(:type, *args)
+ end
+ end
+
+ class GraphicsSceneContextMenuEvent < Qt::Base
+ def type(*args)
+ method_missing(:type, *args)
+ end
+ end
+
+ class GraphicsSceneHoverEvent < Qt::Base
+ def type(*args)
+ method_missing(:type, *args)
+ end
+ end
+
+ class GraphicsSceneHelpEvent < Qt::Base
+ def type(*args)
+ method_missing(:type, *args)
+ end
+ end
+
+ class GraphicsSceneWheelEvent < Qt::Base
+ def type(*args)
+ method_missing(:type, *args)
+ end
+ end
+
class Gradient < Qt::Base
def type(*args)
method_missing(:type, *args)
@@ -2097,6 +2133,9 @@
def emit(signal)
return signal
end
+
+ def QT_TR_NOOP(x) x end
+ def QT_TRANSLATE_NOOP(scope, x) x end
end
class Module
More information about the Kde-bindings
mailing list