[Kde-java] Re: KDatePicker

David Goodenough david.goodenough at btconnect.com
Thu Oct 21 21:36:03 CEST 2004


My fault.  I was starting it with a QApplication not a KApplication.  Silly
me!

David

PS.  I have noticed that with the Java API it is very difficult sometimes to
get meaningful exception handling when a C(++) level problem occurs.
In particular it is difficult to get a Java Stack Trace sometimes.  Is there
any way to get this a little more sane?

On Thursday 21 October 2004 20:10, Richard Dale wrote:
> Can you post the whole program to make it easier to reproduce the crash? If
> I try:
>
>       KApplication app = new KApplication();
>       KCmdLineArgs args = KCmdLineArgs.parsedArgs();
>       QWidget myWidget = new QWidget();
>       KDatePicker kDatePicker1 = new KDatePicker( myWidget, "kDatePicker1"
> ); kDatePicker1.setGeometry(40, 10 + 20, 300, 170);
>       myWidget.show();
>       app.setMainWidget(myWidget);
>       app.exec();
>
> It works fine..
>
> -- Richard
>
> On Thursday 21 October 2004 17:11, David Goodenough wrote:
> > Richard,
> >
> > I have moved ever onwards, and into another slight problem.
> >
> > I have a QDialog which contains a KDatePicker, and when the
> > juic generated code comes to create the KDatePicker, kdejava
> > goes bang.
> >
> > The juic code looks like:-
> >
> >     public dateChooser(QWidget parent, String name, boolean modal, int
> > flags) {
> >         super(parent, name, false, flags);
> >         if (name == null) setName("dateChooser");
> >         this.setGeometry( new QRect( 0, 0, 299, 234 ) );
> >         this.setCaption( tr( "Choose a Date" ) );
> >         dateChooserVbox = new QVBoxLayout( this, 11, 6, "dateChooserVbox"
> > ); kDatePicker1 = new KDatePicker( this, "kDatePicker1" );
> >         layout1Hbox = new QHBoxLayout( (QWidget)null, 0, 6, "layout1Hbox"
> > ); okButton = new QPushButton( this, "okButton" );
> >         okButton.setText( tr( "OK" ) );
> >         cancelButton = new QPushButton( this, "cancelButton" );
> >         cancelButton.setText( tr( "Cancel" ) );
> >         layout1Hbox.addWidget( okButton );
> >         layout1Hbox.addWidget( cancelButton );
> >         dateChooserVbox.addWidget( kDatePicker1 );
> >         dateChooserVbox.addLayout( layout1Hbox );
> >         resize(size().expandedTo(minimumSizeHint()));
> >         connect( okButton, SIGNAL( "clicked()" ), this, SLOT( "accept()"
> > )); connect( cancelButton, SIGNAL( "clicked()" ), this,
> > SLOT( "reject()" ));
> >     }
> >
> > and it dies on the kDatePicker1 = new KDatePicker line.  The stack
> > trace looks like (line 78 is the constructor):-
> >
> > An unexpected exception has been detected in native code outside the VM.
> > Unexpected Signal : 11 occurred at PC=0x4EC464B7
> > Function=_ZNK9KInstance6configEv+0x17
> > Library=/usr/lib/libkdecore.so.4
> >
> > Current Java thread:
> >         at org.kde.koala.KDatePicker.newKDatePicker(Native Method)
> >         at org.kde.koala.KDatePicker.<init>(KDatePicker.java:78)
> >         at
> > uk.co.dga.linkchoose.qtUi.dateChooser.<init>(dateChooser.java:98) at
> > uk.co.dga.linkchoose.qtUi.dateChooser.<init>(dateChooser.java:57) at
> > uk.co.dga.linkchoose.qtUi.DateChooser.<init>(DateChooser.java:26) at
> > uk.co.dga.linkchoose.qtUi.Main.initialCharge(Main.java:236) at
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
> >:3 9) at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI
> >mp l.java:25) at java.lang.reflect.Method.invoke(Method.java:324)
> >         at org.kde.qt.Invocation.invoke(Invocation.java:185)
> >         at org.kde.qt.QApplication.exec(Native Method)
> >         at uk.co.dga.linkchoose.qtUi.Main.main(Main.java:44)
> >
> > Unfortunately java (and come to that gij-3.4) is not more helpful in
> > telling is where in the method it died.
> >
> > Any ideas.
> >
> > David


More information about the Kde-java mailing list