Problem running a qt app.
Serge Lussier
lusse at videotron.ca
Wed Jun 14 12:35:50 BST 2000
David BOURIAUD wrote:
>
> The source code of my file :
> ----------------------- begin of source code
> ------------------------------
> #include <qapplication.h>
> #include <qpushbutton.h>
> #include <qfont.h>
> #include <stdlib.h>
>
> class MyApplication : public QApplication
> {
// You just need this macro:
QOBJECT // Don't put the ';' at the end .
>
> public:
> MyApplication (int a, char *t[]);
> private:
> QPushButton *go;
> protected slots:
> void slotConnect();
>
> };
>
> MyApplication::MyApplication (int a, char *t[]) : QApplication (a, t)
> {
> go = new QPushButton ("Go !");
> go->setFont ( QFont ( "Times", 18, QFont::Bold ) );
> setMainWidget (go);
> go->show();
> connect (go, SIGNAL(clicked()),SLOT(slotConnect()));
> }
>
> void MyApplication::slotConnect()
> {
> system ("kvt &");
> }
>
> int main( int argc, char **argv )
> {
> MyApplication a( argc, argv );
> return a.exec();
> }
> ----------------------- end of source code
> --------------------------------
>
> The Makefile provided with the t2 tutorial hasn't been modified at all.
If the Makefile does all what is needed ( calling < moc > and compile and
links ok )
then your button should works now.
regards,
Serge Lussier
More information about the KDevelop
mailing list