[Qt-interest] Was it a syntax error ?

Aaron Lewis aaron.lewis1989 at gmail.com
Thu Sep 23 16:05:27 CEST 2010


Hi, Andre Somers
>   Op 23-9-2010 15:46, Aaron Lewis schreef:
> > Hi,
> > 
> > 	Playing with qt 4.6.3 with qtcreator 1.3.1 ,
> > 	
> >      connect(ui->rangeRadio,SIGNAL(clicked(bool)),
> >      
> >          this,SLOT(setMode( !bool )));
> >     
> >     Am i making something wrong here ? got red lines below texts ..
> 
> Yes, this is wrong. The !bool is invalid.
> Bool is not a variable, it is a type name.
> 

Very strange it compiles ok , and works fine ? ( Got warnings output )

Was it supposed to be like this:

  connect(ui->rangeRadio,SIGNAL(clicked(bool)),
	 this,SLOT(setMode( bool )));

and another slot just a wrapper for the last one:

  connect(ui->anotherRangeRadio,SIGNAL(clicked(bool)),
	 this,SLOT(setOptMode( !bool )));

setOptMode ( bool mode ) { this->setMode ( !mode ); }

Would be elegant if Qt's slot support simple variable wrappers ;-)

-- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4R0NL3WI5 on freenode
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100923/ba7af4a5/attachment.bin 


More information about the Qt-interest-old mailing list