Inheritance: QObject, IDisposable
示例#1
0
文件: main.cs 项目: KDE/qyoto
    public static int Main(string[] args)
    {
        new QApplication(args);

        QGraphicsScene scene = new QGraphicsScene();
        scene.SetSceneRect(-500, -500, 1000, 1000);
        scene.itemIndexMethod = QGraphicsScene.ItemIndexMethod.NoIndex;

        Car car = new Car();
        scene.AddItem(car);

        QGraphicsView view = new QGraphicsView(scene);
        view.SetRenderHint(QPainter.RenderHint.Antialiasing);
        view.BackgroundBrush = Qt.GlobalColor.darkGray;
        view.WindowTitle = QT_TRANSLATE_NOOP("QGraphicsView", "Qt DBus Controlled Car");
        view.Resize(400, 300);
        view.Show();

        CarAdaptor adaptor = new CarAdaptor(car);
        QDBusConnection connection = QDBusConnection.SessionBus();
        connection.RegisterObject("/Car", adaptor, (int) QDBusConnection.RegisterOption.ExportAllSlots);
        connection.RegisterService("com.trolltech.CarExample");

        return QApplication.Exec();
    }
示例#2
0
        public NoAccountsWidget(QWidget parent)
            : base(parent)
        {
            SetupUi();

            m_Scene = new QGraphicsScene(m_Scene);
            m_GraphicsView.SetScene(m_Scene);
            m_Scene.SetSceneRect(0, 0, 200, 200);

            var octy = new QGraphicsPixmapItem(new QPixmap("resource:/octy.png"));
            octy.SetPos(0, 10);
            m_Scene.AddItem(octy);

            // TODO: Add bubbles!

            m_TimeLine = new QTimeLine(2000, m_Scene);
            m_TimeLine.curveShape = QTimeLine.CurveShape.EaseOutCurve;
            QObject.Connect(m_TimeLine, Qt.SIGNAL("finished()"), HandleTimerFinished);

            QGraphicsItemAnimation animation = new QGraphicsItemAnimation(m_Scene);
            animation.SetItem(octy);
            animation.SetTimeLine(m_TimeLine);
            animation.SetPosAt(1, new QPointF(0, 0));

            m_TimeLine.Start();
        }
示例#3
0
文件: main.cs 项目: KDE/qyoto
    public static int Main(string[] args)
    {
        Q_INIT_RESOURCE("mice");
        new QApplication(args);

        scene = new QGraphicsScene();
        scene.SetSceneRect(-300, -300, 600, 600);
        scene.itemIndexMethod = QGraphicsScene.ItemIndexMethod.NoIndex;

        for (int i = 0; i < MouseCount; ++i) {
            Mouse mouse = new Mouse();
            mouse.SetPos(Math.Sin((i * 6.28) / MouseCount) * 200,
                          Math.Cos((i * 6.28) / MouseCount) * 200);
            scene.AddItem(mouse);
        }

        QGraphicsView view = new QGraphicsView(scene);
        view.SetRenderHint(QPainter.RenderHint.Antialiasing);
        view.BackgroundBrush = new QBrush(new QPixmap(":/images/cheese.jpg"));
        view.CacheMode = (int) QGraphicsView.CacheModeFlag.CacheBackground;
        view.dragMode = QGraphicsView.DragMode.ScrollHandDrag;
        view.WindowTitle = QT_TRANSLATE_NOOP("QGraphicsView", "Colliding Mice");
        view.Resize(400, 300);
        view.Show();

        return QApplication.Exec();
    }
示例#4
0
        public AboutDialog(QWidget parentWindow)
            : base(parentWindow)
        {
            SetupUi();

            m_Scene = new QGraphicsScene(m_Scene);
            graphicsView.SetScene(m_Scene);
            m_Scene.SetSceneRect(0, 0, 200, 200);

            textLabel.Pixmap = new QPixmap("resource:/text.png");

            var octy = new QGraphicsPixmapItem(new QPixmap("resource:/octy.png"));
            octy.SetPos(0, 10);
            m_Scene.AddItem(octy);

            m_TimeLine = new QTimeLine(2000, m_Scene);
            m_TimeLine.curveShape = QTimeLine.CurveShape.EaseOutCurve;
            QObject.Connect(m_TimeLine, Qt.SIGNAL("finished()"), TimerFinished);

            QGraphicsItemAnimation animation = new QGraphicsItemAnimation(m_Scene);
            animation.SetItem(octy);
            animation.SetTimeLine(m_TimeLine);
            animation.SetPosAt(1, new QPointF(0, 0));

            m_TimeLine.Start();

            Gui.CenterWidgetOnScreen(this);
        }
示例#5
0
 public QGraphicsLineItem(double x1, double y1, double x2, double y2, IQGraphicsItem parent, QGraphicsScene scene) : this((Type)null)
 {
     CreateProxy();
     interceptor.Invoke("QGraphicsLineItem$$$$##", "QGraphicsLineItem(qreal, qreal, qreal, qreal, QGraphicsItem*, QGraphicsScene*)", typeof(void), typeof(double), x1, typeof(double), y1, typeof(double), x2, typeof(double), y2, typeof(IQGraphicsItem), parent, typeof(QGraphicsScene), scene);
 }
示例#6
0
 public QGraphicsPathItem(QPainterPath path, IQGraphicsItem parent, QGraphicsScene scene) : this((Type)null)
 {
     CreateProxy();
     interceptor.Invoke("QGraphicsPathItem###", "QGraphicsPathItem(const QPainterPath&, QGraphicsItem*, QGraphicsScene*)", typeof(void), typeof(QPainterPath), path, typeof(IQGraphicsItem), parent, typeof(QGraphicsScene), scene);
 }
示例#7
0
 // QGraphicsItem* QGraphicsItem(QGraphicsItemPrivate& arg1,QGraphicsItem* arg2,QGraphicsScene* arg3); >>>> NOT CONVERTED
 public QGraphicsTextItem(IQGraphicsItem parent, QGraphicsScene scene)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("QGraphicsTextItem##", "QGraphicsTextItem(QGraphicsItem*, QGraphicsScene*)", typeof(void), typeof(IQGraphicsItem), parent, typeof(QGraphicsScene), scene);
 }
示例#8
0
 public QGraphicsLineItem(double x1, double y1, double x2, double y2, IQGraphicsItem parent, QGraphicsScene scene)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("QGraphicsLineItem$$$$##", "QGraphicsLineItem(qreal, qreal, qreal, qreal, QGraphicsItem*, QGraphicsScene*)", typeof(void), typeof(double), x1, typeof(double), y1, typeof(double), x2, typeof(double), y2, typeof(IQGraphicsItem), parent, typeof(QGraphicsScene), scene);
 }
示例#9
0
 public void SetScene(QGraphicsScene scene)
 {
     interceptor.Invoke("setScene#", "setScene(QGraphicsScene*)", typeof(void), typeof(QGraphicsScene), scene);
 }
示例#10
0
 public void SetScene(QGraphicsScene scene)
 {
     interceptor.Invoke("setScene#", "setScene(QGraphicsScene*)", typeof(void), typeof(QGraphicsScene), scene);
 }
示例#11
0
 public QGraphicsView(QGraphicsScene scene) : this((Type)null)
 {
     CreateProxy();
     interceptor.Invoke("QGraphicsView#", "QGraphicsView(QGraphicsScene*)", typeof(void), typeof(QGraphicsScene), scene);
 }
示例#12
0
 public QGraphicsView(QGraphicsScene scene, QWidget parent) : this((Type)null)
 {
     CreateProxy();
     interceptor.Invoke("QGraphicsView##", "QGraphicsView(QGraphicsScene*, QWidget*)", typeof(void), typeof(QGraphicsScene), scene, typeof(QWidget), parent);
 }
示例#13
0
 public QGraphicsRectItem(double x, double y, double w, double h, IQGraphicsItem parent, QGraphicsScene scene)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("QGraphicsRectItem$$$$##", "QGraphicsRectItem(qreal, qreal, qreal, qreal, QGraphicsItem*, QGraphicsScene*)", typeof(void), typeof(double), x, typeof(double), y, typeof(double), w, typeof(double), h, typeof(IQGraphicsItem), parent, typeof(QGraphicsScene), scene);
 }
示例#14
0
 public QGraphicsRectItem(QRectF rect, IQGraphicsItem parent, QGraphicsScene scene)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("QGraphicsRectItem###", "QGraphicsRectItem(const QRectF&, QGraphicsItem*, QGraphicsScene*)", typeof(void), typeof(QRectF), rect, typeof(IQGraphicsItem), parent, typeof(QGraphicsScene), scene);
 }
示例#15
0
 public QGraphicsView(QGraphicsScene scene, QWidget parent)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("QGraphicsView##", "QGraphicsView(QGraphicsScene*, QWidget*)", typeof(void), typeof(QGraphicsScene), scene, typeof(QWidget), parent);
 }
示例#16
0
 public QGraphicsSimpleTextItem(string text, IQGraphicsItem parent, QGraphicsScene scene) : this((Type)null)
 {
     CreateProxy();
     interceptor.Invoke("QGraphicsSimpleTextItem$##", "QGraphicsSimpleTextItem(const QString&, QGraphicsItem*, QGraphicsScene*)", typeof(void), typeof(string), text, typeof(IQGraphicsItem), parent, typeof(QGraphicsScene), scene);
 }
示例#17
0
 public QGraphicsView(QGraphicsScene scene)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("QGraphicsView#", "QGraphicsView(QGraphicsScene*)", typeof(void), typeof(QGraphicsScene), scene);
 }
示例#18
0
 public QGraphicsItemGroup(IQGraphicsItem parent, QGraphicsScene scene) : this((Type)null)
 {
     CreateProxy();
     interceptor.Invoke("QGraphicsItemGroup##", "QGraphicsItemGroup(QGraphicsItem*, QGraphicsScene*)", typeof(void), typeof(IQGraphicsItem), parent, typeof(QGraphicsScene), scene);
 }
示例#19
0
 public QGraphicsLineItem(QLineF line, IQGraphicsItem parent, QGraphicsScene scene)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("QGraphicsLineItem###", "QGraphicsLineItem(const QLineF&, QGraphicsItem*, QGraphicsScene*)", typeof(void), typeof(QLineF), line, typeof(IQGraphicsItem), parent, typeof(QGraphicsScene), scene);
 }
示例#20
0
 public QGraphicsEllipseItem(QRectF rect, IQGraphicsItem parent, QGraphicsScene scene) : this((Type)null)
 {
     CreateProxy();
     interceptor.Invoke("QGraphicsEllipseItem###", "QGraphicsEllipseItem(const QRectF&, QGraphicsItem*, QGraphicsScene*)", typeof(void), typeof(QRectF), rect, typeof(IQGraphicsItem), parent, typeof(QGraphicsScene), scene);
 }
示例#21
0
 public QGraphicsPolygonItem(QPolygonF polygon, IQGraphicsItem parent, QGraphicsScene scene)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("QGraphicsPolygonItem###", "QGraphicsPolygonItem(const QPolygonF&, QGraphicsItem*, QGraphicsScene*)", typeof(void), typeof(QPolygonF), polygon, typeof(IQGraphicsItem), parent, typeof(QGraphicsScene), scene);
 }
示例#22
0
 public QGraphicsEllipseItem(double x, double y, double w, double h, IQGraphicsItem parent, QGraphicsScene scene) : this((Type)null)
 {
     CreateProxy();
     interceptor.Invoke("QGraphicsEllipseItem$$$$##", "QGraphicsEllipseItem(qreal, qreal, qreal, qreal, QGraphicsItem*, QGraphicsScene*)", typeof(void), typeof(double), x, typeof(double), y, typeof(double), w, typeof(double), h, typeof(IQGraphicsItem), parent, typeof(QGraphicsScene), scene);
 }
示例#23
0
 public QGraphicsPathItem(QPainterPath path, IQGraphicsItem parent, QGraphicsScene scene)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("QGraphicsPathItem###", "QGraphicsPathItem(const QPainterPath&, QGraphicsItem*, QGraphicsScene*)", typeof(void), typeof(QPainterPath), path, typeof(IQGraphicsItem), parent, typeof(QGraphicsScene), scene);
 }
示例#24
0
 public QGraphicsPolygonItem(QPolygonF polygon, IQGraphicsItem parent, QGraphicsScene scene) : this((Type)null)
 {
     CreateProxy();
     interceptor.Invoke("QGraphicsPolygonItem###", "QGraphicsPolygonItem(const QPolygonF&, QGraphicsItem*, QGraphicsScene*)", typeof(void), typeof(QPolygonF), polygon, typeof(IQGraphicsItem), parent, typeof(QGraphicsScene), scene);
 }
 // QAbstractGraphicsShapeItem* QAbstractGraphicsShapeItem(QAbstractGraphicsShapeItemPrivate& arg1,QGraphicsItem* arg2,QGraphicsScene* arg3); >>>> NOT CONVERTED
 public QAbstractGraphicsShapeItem(IQGraphicsItem parent, QGraphicsScene scene) : this((Type)null)
 {
     CreateProxy();
     interceptor.Invoke("QAbstractGraphicsShapeItem##", "QAbstractGraphicsShapeItem(QGraphicsItem*, QGraphicsScene*)", typeof(void), typeof(IQGraphicsItem), parent, typeof(QGraphicsScene), scene);
 }
示例#26
0
 public QGraphicsLineItem(QLineF line, IQGraphicsItem parent, QGraphicsScene scene) : this((Type)null)
 {
     CreateProxy();
     interceptor.Invoke("QGraphicsLineItem###", "QGraphicsLineItem(const QLineF&, QGraphicsItem*, QGraphicsScene*)", typeof(void), typeof(QLineF), line, typeof(IQGraphicsItem), parent, typeof(QGraphicsScene), scene);
 }
示例#27
0
 public QGraphicsTextItem(string text, IQGraphicsItem parent, QGraphicsScene scene)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("QGraphicsTextItem$##", "QGraphicsTextItem(const QString&, QGraphicsItem*, QGraphicsScene*)", typeof(void), typeof(string), text, typeof(IQGraphicsItem), parent, typeof(QGraphicsScene), scene);
 }
示例#28
0
 public QGraphicsPixmapItem(QPixmap pixmap, IQGraphicsItem parent, QGraphicsScene scene) : this((Type)null)
 {
     CreateProxy();
     interceptor.Invoke("QGraphicsPixmapItem###", "QGraphicsPixmapItem(const QPixmap&, QGraphicsItem*, QGraphicsScene*)", typeof(void), typeof(QPixmap), pixmap, typeof(IQGraphicsItem), parent, typeof(QGraphicsScene), scene);
 }