the read->append(tmp in post #37 is for the MainWindow the problem is the read->append in Channel, it doesnt work ;/////
the read->append(tmp in post #37 is for the MainWindow the problem is the read->append in Channel, it doesnt work ;/////
What is "read" from post #37 and what is "read" from post (the one that doesn't work)? They point to different objects, yes?
Naming your variables in such a vague way is probably not the best programming practice...
#37 works, #25 doesnt :-((((
#37 point to MainWindow, #25 points to Channel.
Is English your primary language? Do you have problems understanding what I write? If I'm not clear enough, please say what needs clarification as so far you have misunderstood what I said a couple of times. I'm asking you what your "read" variables contain in both cases (MainWindow and Channel classes).
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:
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.Qt Code:
To copy to clipboard, switch view to plain text mode
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:
channel.h:Qt Code:
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QDialog> #include "channel.h" class QTabWidget; class QTcpSocket; class QLineEdit; class QLabel; class QPushButton; class QTextEdit; { Q_OBJECT public: public slots: void Connect(); void appendToWindow(); void sendMessage(); private: QLineEdit *write; QTcpSocket *socket; QTextEdit *read; QTabWidget* tabs; bool connected; }; #endifTo copy to clipboard, switch view to plain text mode
i hope u understand me now.Qt Code:To copy to clipboard, switch view to plain text mode
I'm not asking weird questions. I just have to practically extract each piece of answer out of you because you are not eagar to surrender any information willingly.
Let's go back to the beginning...
Please modify your methods so that they contain the following pieces of code:
Qt Code:
Channel::printText(const QString& text) { qDebug() << Q_FUNC_INFO << text; read->append(text); }To copy to clipboard, switch view to plain text mode
Qt Code:
void MainWindow::appendToWindow() { // ... read->append(tmp); // ... }To copy to clipboard, switch view to plain text mode
Please show us the output and the relevant pieces of sourcecode after the changes.
Also, if you are using Qt Creator, please right click on your "read" variable from the "Channel" class, choose "Rename symbol under cursor" (or something like that) and enter "channelText". Do the same for MainWindow::read and rename it to "serverText". Then we won't be confusing the two variables anymore...
this is the outputQt Code:
void MainWindow::appendToWindow()8‘|ÿÿÿÿ8?|???? 8‘|ÿÿÿÿ :wineasy1.se.quakenet.org 376 Fallen_ :End of /MOTD command. void MainWindow::appendToWindow()8‘|ÿÿÿÿ8?|???? 8‘|ÿÿÿÿ void MainWindow::appendToWindow()[03:07:13] Notice from: Message: on 2 ca 1(4) ft 20(20) tr [03:07:13] Notice from: Message: on 2 ca 1(4) ft 20(20) tr [03:07:13] Notice from: Message: on 2 ca 1(4) ft 20(20) tr :wineasy1.se.quakenet.org 221 Fallen_ +i void MainWindow::appendToWindow()[03:07:13] Notice from: Message: on 2 ca 1(4) ft 20(20) tr [03:07:13] Notice from: Message: on 2 ca 1(4) ft 20(20) tr [03:07:13] Notice from: Message: on 2 ca 1(4) ft 20(20) tr :Fallen_!~Fallen_@41.199.113.40 MODE Fallen_ +i void MainWindow::appendToWindow()[03:07:13] Notice from: Message: on 2 ca 1(4) ft 20(20) tr [03:07:13] Notice from: Message: on 2 ca 1(4) ft 20(20) tr [03:07:13] Notice from: Message: on 2 ca 1(4) ft 20(20) trTo copy to clipboard, switch view to plain text mode
So there is no output from Channel::printText?
By the way, is this:
8‘|ÿÿÿÿ8?|????
8‘|ÿÿÿÿ
what you expected to print in the text edit (apart from the readable text, of course)?
By the way, your "method" of recognizing the command is extremly error prone. Try passing it a "/JOIN #NOTICE" command and see for yourself. Your client will react on "NOTICE" and not on "JOIN". Also this method is prone to buffer overflows. I don't know why you insist on using this C-style API, you are just asking yourself for trouble there (i.e. try sending a really long (like, over 1000 characters long) notice).
this text wont appear in the channel tab since u join after it has finished sending MOTD. wheres tbscope when u need him the most =_=
If by showing things irrelevant to the problem you wanted to discourage me from helping you then you have achieved your goal. 50 posts without progress is probably a record of this forum...
tbscope is probably sleeping. Only I'm crazy enough to be sitting here at this hour.
Bookmarks