[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Qyoto/Kimono Problems for no reason (yet?)
From:       Arno Rehn <kde-devel () arnorehn ! de>
Date:       2009-08-23 15:55:08
Message-ID: 200908231755.08725.kde-devel () arnorehn ! de
[Download RAW message or body]

On Sunday 23 August 2009 16:43:22 Andreas Marschke wrote:
> Hi,
>
> I don't know if this is the right place to ask for thi but I have
> been playing around with the chharp bindings lately and as
> soon as I reach the Widget with the mouse it crashes the
> application.
>
> crash bt:
> http://pastebin.ca/1540306
> main.cs
> http://pastebin.ca/1540314
> qyoto_mainwindow.cs
> http://pastebin.ca/1540321
>
> The only refrence I gave to it additionaly was Qyoto.
There's a kde-bindings mailing list which would be the appropiate place.
Your mistake is, that You create a QWidget (qyoto_mainwindow) and in the 
constructor of that widget you create another QWidget (mainwindow) with local 
scope. When the constructor has finished, 'mainwindow' isn't used anywhere 
anymore and the GC schedules it for deletion. You can't control when the GC 
actually decides to delete it and in your case it seems to do it when you move 
the mouse over the widget.
Instead of creating a new QWidget in a QWidget's constructor, use 
qyoto_mainwindow directly. As you have a reference to that in Main(), it will 
not be deleted until the program exits.

Example:
		public qyoto_mainwindow()
                {
                        QHBoxLayout m_layout = new QHBoxLayout(this);
                        QPushButton pb1 = new QPushButton("My");
                        QPushButton pb2 = new QPushButton("first");
                        QPushButton pb3 = new QPushButton("Qyoto Program");
                        m_layout.AddWidget(pb1);
                        m_layout.AddWidget(pb2);
                        m_layout.AddWidget(pb3);
                        
                        SetLayout(m_layout);
                        Show();
                }

-- 
Arno Rehn
arno@arnorehn.de
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic