#include <qt/qapplication.h>
#include <qt/qpushbutton.h>
#include <qt/qtextedit.h>
#include <qt/qwidget.h>
#include <qt/qtextcodec.h>
#include <qt/QOBJECT.h>
int a,b;
int toplama(int,int){return (a+b);}
{
Q_OBJECT
public slots:
toplama(int,int);
signals:
void clicked();
};
toplama::toplama(int c,int d){
a=c;
b=d;
emit clicked();
}
using namespace std;
int main(int argc, char *argv[])
Window.resize(250,200);
button.setGeometry(75,130,70,30);
button2.setGeometry(150,130,70,30);
textfield1.setGeometry(75,40,120,25);
textfield2.setGeometry(75,70,120,25);
textfield3.setGeometry(75,100,120,25);
QObject::connect(&button,
SIGNAL(clicked
()),
&textfield3,
SLOT(toplama
(textfield1.
text().
ToInt32(),textfield2.
text().
ToInt32())));
QObject::connect(&button2,
SIGNAL(clicked
()),
&app,
SLOT(quit
()));
Window.show();
return app.exec();
}
#include <qt/qapplication.h>
#include <qt/qpushbutton.h>
#include <qt/qtextedit.h>
#include <qt/qwidget.h>
#include <qt/qtextcodec.h>
#include <qt/QOBJECT.h>
int a,b;
int toplama(int,int){return (a+b);}
class toplama : public QObject
{
Q_OBJECT
public slots:
toplama(int,int);
signals:
void clicked();
};
toplama::toplama(int c,int d){
a=c;
b=d;
emit clicked();
}
using namespace std;
int main(int argc, char *argv[])
{QTextCodec::setCodecForTr( QTextCodec::codecForName("ISO-8859-9") );
QTextCodec::setCodecForCStrings
( QTextCodec::codecForName("ISO-8859-9") );
QApplication app(argc,argv);
QWidget Window;
Window.resize(250,200);
QPushButton button("Topla",&Window);
QPushButton button2("Çık",&Window);
button.setGeometry(75,130,70,30);
button2.setGeometry(150,130,70,30);
QTextEdit textfield1(&Window);
QTextEdit textfield2(&Window);
QTextEdit textfield3(&Window);
textfield1.setGeometry(75,40,120,25);
textfield2.setGeometry(75,70,120,25);
textfield3.setGeometry(75,100,120,25);
QObject::connect(&button,SIGNAL(clicked()),&textfield3,SLOT(toplama(textfield1.text().ToInt32(),textfield2.text().ToInt32())));
QObject::connect(&button2,SIGNAL(clicked()),&app,SLOT(quit()));
Window.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
[Linker error] undefined reference to `vtable for toplama'
[Linker error] undefined reference to `toplama::clicked()'
[Linker error] undefined reference to `vtable for toplama'
[Linker error] undefined reference to `toplama::clicked()'
ld returned 1 exit status
F:\QT\Makefile.win [Build Error] [QPlus.exe] Error 1
[Linker error] undefined reference to `vtable for toplama'
[Linker error] undefined reference to `toplama::clicked()'
[Linker error] undefined reference to `vtable for toplama'
[Linker error] undefined reference to `toplama::clicked()'
ld returned 1 exit status
F:\QT\Makefile.win [Build Error] [QPlus.exe] Error 1
To copy to clipboard, switch view to plain text mode
Bookmarks