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(); }
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()); }