the issue are Kdevelop 3.0.4 and Qt Designer 3.3.3 (in MDK 10.1 official)
hi_kde.cpp
#include "hi_kde.h"
#include <qlabel.h>
#include <kmainwindow.h>
#include <klocale.h>
hi_kde::hi_kde()
: KMainWindow( 0, "hi_kde" )
{
// set the shell's ui resource file
setXMLFile("hi_kdeui.rc");
new QLabel( "Hello World", this, "hello label" );
}
hi_kde::~hi_kde()
{
}
#include "hi_kde.moc"
hi_kde.h
#ifndef _HI_KDE_H_
#define _HI_KDE_H_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <kmainwindow.h>
/**
* @short Application Main Window
* @author a <a@Mdk>
* @version 0.1
*/
class hi_kde : public KMainWindow
{
Q_OBJECT
public:
/**
* Default Constructor
*/
hi_kde();
/**
* Default Destructor
*/
virtual ~hi_kde();
};
#endif // _HI_KDE_H_
main.cpp
#include "hi_kde.h"
#include <kapplication.h>
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <klocale.h>
static const char description[] =
I18N_NOOP("A KDE KPart Application");
static const char version[] = "0.1";
static KCmdLineOptions options[] =
{
// { "+[URL]", I18N_NOOP( "Document to open." ), 0 },
KCmdLineLastOption
};
int main(int argc, char **argv)
{
KAboutData about("hi_kde", I18N_NOOP("hi_kde"), version, description,
KAboutData::License_GPL, "(C) 2004 a", 0, 0, "a@Mdk");
about.addAuthor( "a", 0, "a@Mdk" );
KCmdLineArgs::init(argc, argv, &about);
KCmdLineArgs::addCmdLineOptions( options );
KApplication app;
hi_kde *mainWin = 0;
if (app.isRestored())
{
RESTORE(hi_kde);
}
else
{
// no session.. just start up normally
KCmdLineArgs *args = KCmdLineArgs:
arsedArgs();
/// @todo do something with the command line args here
mainWin = new hi_kde();
app.setMainWidget( mainWin );
mainWin->show();
args->clear();
}
// mainWin has WDestructiveClose flag by default, so it will delete itself.
return app.exec();
}