because ur asking too many weird questions... whats it all about is:
1. i made the channel class which inherits QWidget
2. i open up a tab when basically the user requests to join a channel basically like this:
Qt Code:
  1. tabs->addTab(new Channel(this, QString::fromLatin1(buffer), socket), QString::fromLatin1(buffer));
To copy to clipboard, switch view to plain text mode 
3. the "read QTextEdit is in both MainWindow and Channel, the one in the MainWindow is for reading server messages not reading channel messages, the one in Channel for reading the channel messages.
4. theres no "4", i think ive explained it all.
its all about a simple irc client, if u can help that would be appreciated.
heres the headers of "Channel" & "MainWindow":
mainwindow.h:
Qt Code:
  1. #ifndef MAINWINDOW_H
  2. #define MAINWINDOW_H
  3.  
  4. #include <QDialog>
  5.  
  6. #include "channel.h"
  7.  
  8. class QTabWidget;
  9. class QTcpSocket;
  10. class QLineEdit;
  11. class QLabel;
  12. class QTextEdit;
  13.  
  14. class MainWindow : public QDialog
  15. {
  16. Q_OBJECT
  17. public:
  18. explicit MainWindow(QWidget* parent = 0);
  19.  
  20. public slots:
  21. void Connect();
  22. void appendToWindow();
  23. void sendMessage();
  24. void displayError(QAbstractSocket::SocketError socketError);
  25.  
  26. private:
  27. QPushButton *done, *quit, *send;
  28. QLineEdit *write;
  29. QTcpSocket *socket;
  30. QTextEdit *read;
  31. QTabWidget* tabs;
  32. bool connected;
  33. };
  34. #endif
To copy to clipboard, switch view to plain text mode 
channel.h:
Qt Code:
  1. #ifndef CHANNELS_H
  2. #define CHANNELS_H
  3.  
  4. #include <QWidget>
  5. #include <QTcpSocket>
  6.  
  7. class QLineEdit;
  8. class QTextEdit;
  9.  
  10. class Channel : public QWidget
  11. {
  12. Q_OBJECT
  13. public:
  14. Channel(QWidget* parent, const QString& name, QTcpSocket* socket);
  15. void printText(const QString& text);
  16.  
  17. public slots:
  18. void sendMessage();
  19.  
  20. private:
  21. QString chan;
  22. QLineEdit* write;
  23. QTextEdit* read;
  24. QTcpSocket* m_socket;
  25. };
  26. #endif
To copy to clipboard, switch view to plain text mode 
i hope u understand me now.