caminoix
26th March 2006, 01:07
hello :)
i have a qt interface driven by a tcp connection with an engine in nemerle.
for the connection, i use an instance (called socket) of my guiClient class derived from QSocket. it is created in main.cpp, where i also create mainWin, ie. an instance of my mainWindow class derived from QMainWindow. a pointer to socket is passed to mainWin.
in mainWin, i try to use guiClient's method called socketSend.
everything works fine until i use the Q_OBJECT macro in mainwindow.cpp.
this is the error i keep getting:
In file included from moc_mainwindow.cpp:11:
mainwindow.h: In constructor `mainWindow::mainWindow(QWidget*, char*, guiClient*)':
mainwindow.h:26: error: `socketSend' undeclared (first use this function)
mainwindow.h:26: error: (Each undeclared identifier is reported only once for each function it appears in.)
make: *** [moc_mainwindow.o] Błąd 1
i've tried creating the socket in mainwindow instead of main but the whole thing repeats itself whenever i try to pass it to some widget created from mainWin.
maybe the whole idea of defining a seperate class for socket is wrong? but how else can i manage it? or maybe should i pass a reference to socket in some other way than a pointer?
please, help me...
i have a qt interface driven by a tcp connection with an engine in nemerle.
for the connection, i use an instance (called socket) of my guiClient class derived from QSocket. it is created in main.cpp, where i also create mainWin, ie. an instance of my mainWindow class derived from QMainWindow. a pointer to socket is passed to mainWin.
in mainWin, i try to use guiClient's method called socketSend.
everything works fine until i use the Q_OBJECT macro in mainwindow.cpp.
this is the error i keep getting:
In file included from moc_mainwindow.cpp:11:
mainwindow.h: In constructor `mainWindow::mainWindow(QWidget*, char*, guiClient*)':
mainwindow.h:26: error: `socketSend' undeclared (first use this function)
mainwindow.h:26: error: (Each undeclared identifier is reported only once for each function it appears in.)
make: *** [moc_mainwindow.o] Błąd 1
i've tried creating the socket in mainwindow instead of main but the whole thing repeats itself whenever i try to pass it to some widget created from mainWin.
maybe the whole idea of defining a seperate class for socket is wrong? but how else can i manage it? or maybe should i pass a reference to socket in some other way than a pointer?
please, help me...