New in MailingList & Qsocket - Thx For Help

Carlos Morales moramenez at yahoo.com
Fri Jun 28 01:29:54 BST 2002


Thank you two to help me with that, i am really loss
with all of this, i think i must read all the tutorial
before continue, becouse i have too much to lean. If
there is a tutorial or whatever .txt file to help to
understand more with all kdevelop, please send me. I
am dispose to learn this and go on. Bye

--- Jeff Weeks <jweeks at mailandnews.com> wrote:
> > Sorry, but the QSocket::State property is an enum
> and not a QString...
> >
> > > How can i do ??
> >
> > Assuming You have
> >
> > QSocket *sock;
> > QLabel *label;
> >
> > Try something like
> >
> > switch( sock()->state() )
> > {
> >  case QSocket::Idle:
> >   label->setText("Idle");
> >   break;
> >  .
> >  .
> >  .
> > }
> 
> Or (perhaps a little more efficient?):
> 
> struct {
>   long stateNum;
>   char *stateText;
> } StateInfo;
> 
> struct StateInfo stateInfo[5] = {
>   { QSocket::Idle, "Idle" },
>   { QSocket::Other, "Other },
>   { etc .... }
> }
> 
> and...
> 
> long currentState = sock()->state();
> long i = 0;
> 
> while(stateInfo[i].stateNum != currentState) { i++;
> }
> label->setText(stateInfo[i].stateText);
> 
> Cheers,
> Jeff
> 
> PS: That's off the top of my head... there might be
> errors, but you probably 
> see what I'm getting at (I just don't trust the
> efficiency of switch 
> statements ;)
> 
> -
> to unsubscribe from this list send an email to
> kdevelop-request at kdevelop.org with the following
> body:
> unsubscribe »your-email-address«

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list