Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using Qyoto;
- namespace testqyotoproject
- {
- public static class Program
- {
- [STAThread]
- public static int Main(String[] args)
- {
- new QApplication(args);
- new QyotoApp();
- return QApplication.Exec();
- }
- }
- public class QyotoApp: QWidget
- {
- /// <summary>
- /// Constructor
- /// </summary>
- public QyotoApp()
- {
- WindowTitle = "Qyoto Test Application";
- InitUI();
- Resize(300, 80);
- Move(300, 300);
- Show();
- }
- void InitUI()
- {
- QVBoxLayout vbox = new QVBoxLayout(this);
- QPushButton ok = new QPushButton("Click here to open file dialog", this);
- Connect( ok, SIGNAL("clicked()"), this, SLOT("ShowDialog()"));
- vbox.AddWidget(ok, 0, (uint)AlignmentFlag.AlignCenter);
- this.SetLayout(vbox);
- }
- [Q_SLOT]
- void ShowDialog()
- {
- string selectedFile = QFileDialog.GetOpenFileName(this, "File Open Dialog");
- if (string.IsNullOrEmpty(selectedFile))
- {
- return;
- }
- Console.WriteLine("selected file: " + selectedFile);
- }
- }
- }
- // end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement