|
Non Ci Capisco una mazza. aiuto. c++
ciao ho un semplice
programmino hello world in c++.
voglio cambiare la caption di un pulsante
prima che mi appaia il form.
L'interfaccia grafica e' un form creato con le QT.
il suo file si chiama helloworlddlg.ui.
Questo e' il file helloworld.h
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <kapp.h>
#include <qwidget.h>
#include "helloworlddlg.h"
/** HelloWorld is the base class of the project */
class HelloWorld : public HelloWorldDlg
{
Q_OBJECT
public:
/** construtor */
HelloWorld(QWidget* parent=0, const char *name=0);
/** destructor */
~HelloWorld();
};
#endif
Questo e' il file helloworld.cpp
#include "helloworld.h"
HelloWorld::HelloWorld(QWidget *parent, const char *name) : HelloWorldDlg(parent, name)
{
int x;
x=100;
}
HelloWorld::~HelloWorld()
{
}
Questo e' il file main.cpp
#include <kcmdlineargs.h>
#include <kaboutdata.h>
#include <klocale.h>
#include "helloworld.h"
static const char *description =
I18N_NOOP("HelloWorld");
// INSERT A DESCRIPTION FOR YOUR APPLICATION HERE
static KCmdLineOptions options[] =
{
{ 0, 0, 0 }
// INSERT YOUR COMMANDLINE OPTIONS HERE
};
int main(int argc, char *argv[])
{
KAboutData aboutData( "helloworld", I18N_NOOP("HelloWorld"),
VERSION, description, KAboutData::License_GPL,
"(c) 2003, nobody", 0, 0, "nobody.it");
aboutData.addAuthor("nobody",0, "nobody.it");
KCmdLineArgs::init( argc, argv, &aboutData );
KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
KApplication a;
HelloWorld *helloworld = new HelloWorld();
a.setMainWidget(helloworld);
xxxxxxxxxxx e' qui che devo inserire? xxxxxxxxxxxxxx
Cosa diavolo devo inserire?
helloworld->show();
return a.exec();
}
|