[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Qt-question
From:       Jeroen Jacobs <jeroen.jacobs () advalvas ! be>
Date:       2001-08-08 21:06:07
[Download RAW message or body]

Hi,

I'm trying to write an irc chat-application, but I've stumbled across a few 
problems.

the problem is : IRC protocol demands that all lines are terminated with 
CR/LF and that all characters are 8bit ASCII.

this is the constructor code :

---
QchatView::QchatView(QWidget *parent, QchatDoc *doc) : QWidget(parent)
{
  /** connect doc with the view*/
  connect(doc, SIGNAL(documentChanged()), this, SLOT(slotDocumentChanged()));
  workarea = new QWidget(this);
  workarea->setGeometry(0,0,500,500);
  layout = new QVBoxLayout(workarea);
  chatin = new QLineEdit(workarea);
  chatout = new QMultiLineEdit(workarea);
  layout->addWidget(chatin);
  layout->addWidget(chatout);
  ircsocket = new QSocket(this);

...

  connect(chatin,SIGNAL(returnPressed()), this, SLOT(slotEnter()) );
  ircsocket->connectToHost("brussels.be.eu.undernet.org",6660);
  textsocket = new QTextStream(ircsocket);
}
--

now here is the code of the slot that sends the string to the server. (when 
the user presses enter)

---
void QchatView::slotEnter()
{
	datasend=chatin->text();
    chatout->insertLine(datasend);
    datasend.append("\r\n");
    *textsocket << (&datasend);
	 ircsocket->flush();
}
---

but the server never replies to the things I type. So I think it's the 
QString class that causes my problem (because It's unicode,right?).


what can I do , to make QString work with IRC-messages ??


thnx in advance,

Jeroen
 
>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic