// Qt-CSharp tutorial 3 // Based on the Qt tutorial // Implemented by Marcus Urban using System; using Qt; public class MyApplication: QApplication { public MyApplication( string[] args ): base( args ) {} public void MySlot() { Console.WriteLine("ArgumentException should be thrown now."); throw new ArgumentException("X"); } } public class Example { public static int Main (String[] args) { MyApplication a = new MyApplication (args); QPushButton quit = new QPushButton ("Quit", null); QObject.Connect( quit, QtSupport.SIGNAL ("clicked()"), a, QtSupport.SLOT ("MySlot()") ); a.SetMainWidget (quit); quit.Show(); return a.Exec (); } }