[Kde-bindings] Qyoto - adding QTextEdit as centralWidget does not end app on closing main window

Cvetoslav Ludmiloff ludmiloff at gmail.com
Tue Jan 31 11:34:01 UTC 2012


Hi all,
I'm writing a small example program for Qyoto c# bindings like this
main_window.cs:

using System;
using Qyoto;

namespace ТextЕd
{
public class MainWindow : QMainWindow
{
public QTextEdit editor;
 public MainWindow() : base()
{
SetupEditor();
SetCentralWidget(editor);
}
 private void SetupEditor()
{
editor = new QTextEdit();
}
 protected override void OnCloseEvent(QCloseEvent ev)
{
Console.WriteLine("On close event");
ev.Accept();
}
 }
}


and main.cs like this:

using System;
using Qyoto;

namespace ТextЕd
{
public class TextEdMain
{
public static int Main(String[] args)
{
new QApplication(args);
MainWindow w = new MainWindow();
w.Show();
return QApplication.Exec();
//Console.WriteLine("exiting");
//return 0;
}
}
}


setting QTextEdit as central widget cause the application to not exit on
window close.
I can see OnCloseEvent is executed, but application does not return to
command line.
setting QPushButton works as usual and application exits on window close.

Everything smoke etc. is compiled ok from source according to Dimitar
Dobrev suggestions;
Ubuntu 11.04 32bit, Qt 4.7.2

The same example, written in Python + PyQt4 works like a charm,

Whats wrong, how can I fix this.

Regards
Cvetoslav Ludmiloff
http://archstable.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20120131/73486f31/attachment.html>


More information about the Kde-bindings mailing list