[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Help KDE noob !!
From: supa () hyperdryve ! com
Date: 2005-08-30 1:59:52
Message-ID: 1125367192.4313bd980c6bb () webmail ! hyperdryve ! com
[Download RAW message or body]
Hi All,
Help Plz !!,Am a KDE noob trying to get a small tutorial app written by Larossa
working, so far been pulling my hair out... Can anyone let me know what I am
doing wrong ?
My system Details :
Kde libs - 3.4.2
kernel - 2.6.9-1.667smp
Distro - FC3
I have 3 files (see text below)
main.cpp
p3.cpp
p3.h
I compile them as follows
$g++ -c -I/usr/include/kde -I/usr/lib/qt-3.3/include -fno-rtti main.cpp
moc p3.h -o p3.moc
$g++ -c -I/usr/include/kde -I/usr/lib/qt-3.3/include -fno-rtti p3.cpp
$g++ -L/usr/include/kde -L/usr/lib/qt-3.3/lib -lkdeui -lkdecore -lqt-mt -ldl -o
p3 main.o p3.o
The binary gets generated but crashes everytime it opens , i can see the window
pop up but then immediately crashes , following is the text from the backtrace
log
/////////////////////////// CRash Text
Using host libthread_db library "/lib/tls/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread 2483232 (LWP 12691)]
[KCrash handler]
#4 0x001b23f4 in __dynamic_cast () from /usr/lib/libstdc++.so.6
#5 0x051bbd59 in KAcceleratorManager::setNoAccel ()
from /usr/lib/libkdecore.so.4
#6 0x051bbed0 in KAcceleratorManager::manage () from /usr/lib/libkdecore.so.4
#7 0x051bbefd in KAcceleratorManager::manage () from /usr/lib/libkdecore.so.4
#8 0x052025ac in KCheckAccelerators::checkAccelerators ()
from /usr/lib/libkdecore.so.4
#9 0x05202cc2 in KCheckAccelerators::autoCheckSlot ()
from /usr/lib/libkdecore.so.4
#10 0x05202d53 in KCheckAccelerators::qt_invoke ()
from /usr/lib/libkdecore.so.4
#11 0x04beb10e in QObject::activate_signal ()
from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#12 0x04beb7e4 in QObject::activate_signal ()
from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#13 0x04f1f8dd in QTimer::timeout () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#14 0x04c0aebc in QTimer::event () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#15 0x04b8c539 in QApplication::internalNotify ()
from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#16 0x04b8c6ca in QApplication::notify ()
from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#17 0x051041e8 in KApplication::notify () from /usr/lib/libkdecore.so.4
#18 0x04b808ab in QEventLoop::activateTimers ()
from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#19 0x04b3c6fe in QEventLoop::processEvents ()
from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#20 0x04ba1b85 in QEventLoop::enterLoop ()
from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#21 0x04ba1ade in QEventLoop::exec () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#22 0x04b8b73b in QApplication::exec () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#23 0x0804d352 in main ()
////////////////////////////main.cpp/////////////////////////////
#include <kapp.h>
#include "p3.h"
int main( int argc, char **argv )
{
KApplication a( argc, argv, "p3");
MainWindow *window=new MainWindow( "Tutorial - p3" );
window->resize( 400, 300 );
a.setMainWidget( window );
window->show();
return a.exec();
}
//////////////////////////////////p3.cpp///////////////////
//#include "p3.h"
#include "p3.moc"
#include <kfiledialog.h>
#include <kapp.h>
#include <kmenubar.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <kpopupmenu.h>
#include <qtextview.h>
#include <iostream.h>
MainWindow::MainWindow (const char * name) : KMainWindow ( 0L, name )
{
setCaption("KDE Tutorial - p3");
QPopupMenu *filemenu = new QPopupMenu;
//filemenu->insertItem( i18n( "&Open" ), this, SLOT(fileOpen()) );
// filemenu->insertItem( i18n( "&Save" ), this, SLOT(fileSave()) );
filemenu->insertItem( i18n( "&Quit" ), kapp, SLOT(quit()) );
QString about =
i18n("p3 1.0\n\n"
"(C) 1999-2002 Antonio Larrosa Jimenez\n"
"larrosa@kde.org\t\tantlarr@supercable.es\n"
"Malaga (Spain)\n\n"
"Simple KDE Tutorial\n"
"This tutorial comes with ABSOLUTELY NO WARRANTY\n"
"This is free software, and you are welcome to redistribute
it\n"
"under certain conditions\n");
QPopupMenu *helpmenu = helpMenu( about );
KMenuBar *menu = menuBar();
menu->insertItem( i18n( "&File" ), filemenu );
menu->insertSeparator();
menu->insertItem( i18n( "&Help" ), helpmenu );
QTextView *hello=new QTextView(
i18n("<H2>Hello World !</H2><BR>This is a simple"
" window with <I><font size=5><B>R<font color=red"
" size=5>ich </font><font color=blue size=5>Text"
"</font></B></I> capabilities<BR>Try to resize"
" this window, all this is automatic !"), "", this );
setCentralWidget( hello );
}
/*void MainWindow::fileOpen()
{
KURL filename = KFileDialog::getOpenURL( QString::null, "*", this );
QString msg = QString( i18n("Now this app should open the url %1 .")
).arg(filename.url());
KMessageBox::information( 0, msg, i18n( "Information" ),
"fileOpenInformationDialog" );
std::cout << "In File Open\n";
}
void MainWindow::fileSave()
{
std::cout << "In File Save\n";
KURL filename=KFileDialog::getSaveURL( QString::null, "*", this );
}*/
/////////////////////////////////p3.h///////////////
#include <kmainwindow.h>
class MainWindow : public KMainWindow
{
Q_OBJECT
public:
MainWindow ( const char * name );
// public slots:
// void fileOpen();
// void fileSave();
};
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
>> 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