hello
i'm writing a little game: the engine is in nemerle, and the user interface is in qt in c++. the connection between the two is secured by a tcp connection.
i have, say:
- main.cpp
- mainWindow class defined in mainwindow.h and implemented in mainwindow.cpp
- canvasView class defined and implemented in canvasview.h
i need to have:
an instance of QSocket connected to the server
my question is:
where and how to define and implement the QSocket instance so that:
- i can use its socketSend method both from mainwindow.cpp and canvasview.h;
- its socketRead method can modify variables of the mainWindow instance defined in main.cpp, and the canvasView instance defined in mainWindow.cpp?
i've tried lots of ways and none worked could you help me, please?