Hello again,
 
this post is related to my previous post. As I tried to setup a 
parent-hierarchy among my widgets at one point the JVM crashed. I was able to 
reproduce and to narrow the problem. Below is my short example program. Even 
though I do admit that it makes little sense to make a widget parent of two 
different layouts I didn't come across a good explanation for the crash of the 
program.
Is this a known issue? Does anyone know more about this?
 
Cheers, Curt
 
 
public class ErrorExample extends QWidget{

    public static void main(String[] args) {
        QApplication.initialize(args);

        ErrorExample testErrorExample = new ErrorExample(null);
        testErrorExample.show();

        QApplication.exec();
    }

    public ErrorExample(QWidget parent){
        super(parent);
        
        QLayout layout = new QHBoxLayout(this);
        QLabel label = new QLabel("Hello World", this);
        layout.addWidget(label);
        
        QLayout crashLayout = new QVBoxLayout();
        crashLayout.setParent(this);
        QLabel labelCrash = new QLabel("Bam!", this);
        crashLayout.addWidget(labelCrash);                     // this line 
causes the crash
    }
}


_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest

Reply via email to