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

List:       kde-devel
Subject:    Re: [kde-devel] Re: KFileDialog
From:       Chris Howells <howells () kde ! org>
Date:       2004-11-01 19:00:39
Message-ID: 200411011900.47989.howells () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Monday 01 November 2004 18:23, Grégoire Alexandre wrote:
> My sourcefile is attached and here is the output of gdb :
> [blackeagle@blackeagle beirc]$ gdb ./beirc
> [...]
> (gdb) run
> Starting program: /home/blackeagle/Documents/programmation/Qt/beirc/beirc
> [Thread debugging using libthread_db enabled]
> [New Thread -1230772864 (LWP 22448)]
> Xlib:  extension "GLX" missing on display ":0.0".
> Xlib:  extension "GLX" missing on display ":0.0".

Idon't know how you made it crashed. But I clicked on one of the menu items 
and got:

and got:

bash-2.05b$ ./beirc
Fatal error: you need to have a KInstance object before
you do anything that requires it! Examples of this are config
objects, standard directories or translations.
Abort trap (core dumped)

If you didn't see this, then I guess you must be using a distribution release 
of KDE with all debugging turned off, which will be very hard to use for 
development. Best compile your own KDE with --enable-debug.

So the basic problem. You have a Qt application (QApplication) and you've 
tried to use KDE stuff in there. This won't work. Change it to KApplication 
(which will give you the KInstance you need -- you could also create it 
manually I guess but that seems to be asking for more trouble than it's 
worth).

Make main.cpp look like this and it will work:

#include <kapplication.h>
#include <kaboutdata.h>
#include "mainwindow.h"
#include <kcmdlineargs.h>

int main( int argc, char ** argv )
{

        KAboutData aboutData( "foo", "foo", "2" ,"foo" , 
KAboutData::License_GPL, "a");
        KCmdLineArgs::init( argc, argv, &aboutData );
        KApplication a( argc, argv );

        beIRC w;
        w.show();
        a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
        return a.exec();
}

-- 
Cheers, Chris Howells -- chris@chrishowells.co.uk, howells@kde.org
Web: http://chrishowells.co.uk, PGP ID: 0x33795A2C
KDE/Qt/C++/PHP Developer: http://www.kde.org

[Attachment #5 (application/pgp-signature)]

>> 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