[SOLVED] qtcpserver and qmainwindow on the constructor
I have this server project that i am trying to create a form for it. in the mainwindow construction i have Qmainwindow as parent. the problems is that the tcpserver commands do not work now. i set the QTcpServer in the constructor as in the code below. now i am getting a bunch of errors. how to put the QTcpServer and the Qmainwindow on the constructor line without getting any errors. is this possible? do i need to put something into the header?
Kalster , you have already raised a question regarding this. Please check the work around i have posted in your other thread [developer.qt.nokia.com].
That is not the same question, if you ask me.
kalster, what Frankz and octal are trying to tell you, is that you should not do this:
- MainWindow::MainWindow(QWidget *parent) :
but should instead do something like this:
That is: your ChatterBoxServer class is a subclass of just QTcpServer, and your UI for it is a subclass of QMainWindow that in its constructor (or in some other way) takes a pointer to an instance of a ChatterBoxServer instance.
thread [developer.qt.nokia.com].Kalster , you have already raised a question regarding this. Please check the work around i have posted in your other
Rahul Das is correct. i really do not need this topic anymore because he helped me out in the other topic. he basically solved two topics in one post.