Guest User

Untitled

a guest
Apr 20th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. using System;
  2. using Qyoto;
  3.  
  4. namespace QyotoTest
  5. {
  6. class Program : QObject
  7. {
  8. private QMainWindow window;
  9.  
  10. /// <summary>
  11. /// The main entry point for the application.
  12. /// </summary>
  13. [STAThread]
  14. static int Main(string[] args)
  15. {
  16. return new Program().Exec(args);
  17. }
  18.  
  19. private int Exec(string[] args)
  20. {
  21. new QApplication(args);
  22.  
  23. window = new QMainWindow();
  24. QWidget centralWidget = new QWidget(window);
  25. QVBoxLayout layout = new QVBoxLayout(centralWidget);
  26. QPushButton b = new QPushButton("Test");
  27. layout.AddWidget(b);
  28.  
  29. Connect(b, SIGNAL("clicked()"), this, SLOT("on_about1_activate()"));
  30.  
  31. window.SetCentralWidget(layout);
  32. window.Show();
  33.  
  34. return QApplication.Exec();
  35. }
  36.  
  37. [Q_SLOT]
  38. private void on_about1_activate()
  39. {
  40. QObject qObject = Sender();
  41. QDialog dialog = new QDialog(window);
  42. dialog.Exec();
  43. }
  44. }
  45. }
Add Comment
Please, Sign In to add comment