Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 2

Qt-interest Archive, October 2006
Rant... just a rant... ignore if you want :(

Pages: Prev | 1 | 2 | Next

Message 16 in thread

There is no reason for compiler to detect any error.
SIGNAL and SLOT are just here to define method signature in a string.
To generate the arrays used by Qt signal/slot mechanism in generated cpp 
file by moc tool.
SIGNAL and SLOT are just macros that manipulate a char* value (method 
signature).
if you work with a console application, you'll see a qt debug message,
because it's now possiible to make a verification, but before?...

Maybe someone can work on moc tool to generate an error when method 
signature is bad.
good luck!!!....


/QMetaObject* Inscape::InQAnimationTableWidget::staticMetaObject()
{
    if ( metaObj )
    return metaObj;
    QMetaObject* parentObject = QObject::staticMetaObject();
    static const QUParameter param_slot_0[] = {
    { *"pURL", &static_QUType_QString, 0, QUParameter::In* }
    };
    static const QUMethod slot_0 = {"updateURL", 1, param_slot_0 };
    static const QMetaData slot_tbl[] = {
    { "updateURL(const QString&)", &slot_0, QMetaData::Private }
    };/
etc....




Glen van de Mosselaer a Ãcrit :

> Hi all,
>
> On Windows, I like to link my debug builds with /SUBSYSTEM:CONSOLE and 
> release builds with /SUBSYSTEM:WINDOWS (in MSVC). This way, I always 
> see the debug info like the connect errors in a fairly obvious console 
> window. I almost never look at the Visual Studio debug console without 
> specific reason to (low signal:noise ratio), so I miss this output 
> otherwise.
>
> This is a fairly serious coding mistake. It *looks* right, it 
> compiles, and runs without raising a serious error - trifecta. 
> connect() should either be more forgiving of or more vocal about 
> parameter names.
>
>
> There are some great ideas being bounced around here. I think they 
> deserve some consideration as "best practices".
>
>
> My $0.02,
> Glen.
>
> On 10/6/06, * Scott Aron Bloom* <scott@xxxxxxxxxxxx 
> <mailto:scott@xxxxxxxxxxxx>> wrote:
>
>     I think that is just a plain old ramifaction of signals/slots in
>     QT, and yes, I have been bit by it more then once.
>
>      
>
>     That's why for all my projects, I install a qtmessage handler,
>     that blows assertions on the can not connect warningâ
>
>
>     This way they are VERY hard to forget J
>
>     Scott
>
>      
>
>     ------------------------------------------------------------------------
>
>     *From:* Dutton, Sam [mailto:Sam.Dutton@xxxxxxxxx
>     <mailto:Sam.Dutton@xxxxxxxxx>]
>     *Sent:* Friday, October 06, 2006 9:24 AM
>     *To:* qt-interest@xxxxxxxxxxxxx <mailto:qt-interest@xxxxxxxxxxxxx>
>     *Subject:* RE: Rant... just a rant... ignore if you want :(
>
>      
>
>     For me, the main problem is signal/slot errors that don't get
>     picked up at compile time.
>
>      
>
>     I've been bitten by this by not testing properly: the error shows
>     up when a user complains...
>
>      
>
>     Sam Dutton
>
>      
>
>      
>
>      
>
>      
>
>     **
>
>     **SAM DUTTON***
>     **SENIOR SITE DEVELOPER**
>     *
>     200 GRAY'S INN ROAD
>     LONDON
>     WC1X 8XZ
>     UNITED KINGDOM
>     T +44 (0)20 7430 4496
>     F
>     E SAM.DUTTON@xxxxxxxxx <mailto:SAM.DUTTON@xxxxxxxxx>
>     WWW.ITN.CO.UK <http://WWW.ITN.CO.UK>
>
>      
>
>     ------------------------------------------------------------------------
>
>      
>
>     *From:* Scott Aron Bloom [mailto:scott@xxxxxxxxxxxx
>     <mailto:scott@xxxxxxxxxxxx>]
>     *Sent:* Friday 06 October 2006 15:35
>     *To:* veronique.lefrere@xxxxxx <mailto:veronique.lefrere@xxxxxx>;
>     qt-interest@xxxxxxxxxxxxx <mailto:qt-interest@xxxxxxxxxxxxx>
>     *Subject:* RE: Rant... just a rant... ignore if you want :(
>
>     Excuse meâ but Im not a noobâ. 
>
>     I know the correct way, but if I design a functional interface
>     that's turns into a slot, or just creating the slot itself, I will
>     quite often COPY the interface from the header, and wrap it in the
>     SIGNAL/SLOT calls.
>
>      
>
>     That's how the parameter names get in their by accident.
>
>      
>
>     Scott
>
>      
>
>     ------------------------------------------------------------------------
>
>     *From:* veronique.lefrere@xxxxxx <mailto:veronique.lefrere@xxxxxx>
>     [mailto: veronique.lefrere@xxxxxx <mailto:veronique.lefrere@xxxxxx>]
>     *Sent:* Friday, October 06, 2006 12:17 AM
>     *To:* qt-interest@xxxxxxxxxxxxx <mailto:qt-interest@xxxxxxxxxxxxx>
>     *Subject:* Re: Rant... just a rant... ignore if you want :(
>
>      
>
>     Nobody's perfect....
>     who didn't loose time with this "newbie" coding error?
>     if you read slots doc and particulary connect documentation, this
>     is clear
>     "/Note that the signal and slots parameters must not contain any
>     variable names,
>      only the type. E.g. the following would not work and return false/"
>     Maybe here is the solution, generate a qdebug message when connect
>     return false.
>
>
>     Regards,
>     Veronique.
>
>
>
>
>
>     Scott Aron Bloom a ïcrit :
>
>     Would it be that hard for the SIGNAL/SLOT functions that are used
>     in the connect and disconnect functionality to ignore the
>     parameter names!
>
>      
>
>     Just spent another ï  hour of my life wondering why Im getting the
>     no such signal warning, because I was connecting SIGNAL( foo( int
>     bar ) )  as opposed to SIGNAL( foo( int ) )
>
>      
>
>     Its already doing a bunch of parsingâ would it be that hard?
>
>     Rant offâ Back to your regularly scheduled programmingâ.
>
>      
>
>     Scott
>
>      
>
>Please Note:
>
> 
>
>
> 
>
> 
>
>Any views or opinions are solely those of the author and do not necessarily represent 
>
>those of Independent Television News Limited unless specifically stated. 
>
>
>This email and any files attached are confidential and intended solely for the use of the individual
>
>
>or entity to which they are addressed. 
>
>If you have received this email in error, please notify 
>postmaster@xxxxxxxxx <mailto:postmaster@xxxxxxxxx> 
>
> 
>
>Please note that to ensure regulatory compliance and for the protection of our clients and business,
>
>we may monitor and read messages sent to and from our systems.
>
>
> 
>
>Thank You.
>
> 
>
>
>


Message 17 in thread

Moc doesnât get run on the C++ codeâ so it would be of no useâ

 

And while you are absolutely correct, the compiler does not find the problems because all SIGNAL and SLOT do is create a char * signatureâ

 

That does not mean, thatâs an ideal situation.  Any time you can prevent a bug with compile time errors, you should strive to do so.  It prevents bugs from occurring in the fist place..

 

Just like comparing variable values, with the constant on the left ie if ( 1463 == val )â just makes sure you never have a typoâ

 

EVERYONE has typosâ there is NO way around themâ making typos compiler errors rather then runtime errors is paramount to preventing bugs.

Scott

________________________________

From: veronique.lefrere@xxxxxx [mailto:veronique.lefrere@xxxxxx] 
Sent: Friday, October 06, 2006 10:07 AM
To: qt-interest@xxxxxxxxxxxxx
Subject: Re: Rant... just a rant... ignore if you want :(

 

There is no reason for compiler to detect any error.
SIGNAL and SLOT are just here to define method signature in a string.
To generate the arrays used by Qt signal/slot mechanism in generated cpp file by moc tool.
SIGNAL and SLOT are just macros that manipulate a char* value (method signature).
if you work with a console application, you'll see a qt debug message, 
because it's now possiible to make a verification, but before?...

Maybe someone can work on moc tool to generate an error when method signature is bad.
good luck!!!....


QMetaObject* Inscape::InQAnimationTableWidget::staticMetaObject()
{
    if ( metaObj )
    return metaObj;
    QMetaObject* parentObject = QObject::staticMetaObject();
    static const QUParameter param_slot_0[] = {
    { "pURL", &static_QUType_QString, 0, QUParameter::In }
    };
    static const QUMethod slot_0 = {"updateURL", 1, param_slot_0 };
    static const QMetaData slot_tbl[] = {
    { "updateURL(const QString&)", &slot_0, QMetaData::Private }
    };
etc....




Glen van de Mosselaer a Ãcrit : 

Hi all,

On Windows, I like to link my debug builds with /SUBSYSTEM:CONSOLE and release builds with /SUBSYSTEM:WINDOWS (in MSVC). This way, I always see the debug info like the connect errors in a fairly obvious console window. I almost never look at the Visual Studio debug console without specific reason to (low signal:noise ratio), so I miss this output otherwise. 

This is a fairly serious coding mistake. It *looks* right, it compiles, and runs without raising a serious error - trifecta. connect() should either be more forgiving of or more vocal about parameter names.


There are some great ideas being bounced around here. I think they deserve some consideration as "best practices".


My $0.02,
Glen.

On 10/6/06, Scott Aron Bloom <scott@xxxxxxxxxxxx> wrote: 

I think that is just a plain old ramifaction of signals/slots in QT, and yes, I have been bit by it more then once.

 

That's why for all my projects, I install a qtmessage handler, that blows assertions on the can not connect warningâ


This way they are VERY hard to forget :-) 

Scott

 

________________________________

From: Dutton, Sam [mailto:Sam.Dutton@xxxxxxxxx] 
Sent: Friday, October 06, 2006 9:24 AM
To: qt-interest@xxxxxxxxxxxxx

Subject: RE: Rant... just a rant... ignore if you want :(

 

For me, the main problem is signal/slot errors that don't get picked up at compile time. 

 

I've been bitten by this by not testing properly: the error shows up when a user complains...

 

Sam Dutton 

 

 

 

 



SAM DUTTON 
SENIOR SITE DEVELOPER

200 GRAY'S INN ROAD
LONDON
WC1X 8XZ
UNITED KINGDOM
T +44 (0)20 7430 4496
F 
E SAM.DUTTON@xxxxxxxxx
WWW.ITN.CO.UK 

 

________________________________

 

From: Scott Aron Bloom [mailto:scott@xxxxxxxxxxxx] 
Sent: Friday 06 October 2006 15:35
To: veronique.lefrere@xxxxxx; qt-interest@xxxxxxxxxxxxx
Subject: RE: Rant... just a rant... ignore if you want :(

Excuse meâ but Im not a noobâ.  

I know the correct way, but if I design a functional interface that's turns into a slot, or just creating the slot itself, I will quite often COPY the interface from the header, and wrap it in the SIGNAL/SLOT calls.

 

That's how the parameter names get in their by accident.

 

Scott

 

________________________________

From: veronique.lefrere@xxxxxx [mailto: veronique.lefrere@xxxxxx <mailto:veronique.lefrere@xxxxxx> ] 
Sent: Friday, October 06, 2006 12:17 AM
To: qt-interest@xxxxxxxxxxxxx
Subject: Re: Rant... just a rant... ignore if you want :(

 

Nobody's perfect....
who didn't loose time with this "newbie" coding error?
if you read slots doc and particulary connect documentation, this is clear
"Note that the signal and slots parameters must not contain any variable names, 
 only the type. E.g. the following would not work and return false"
Maybe here is the solution, generate a qdebug message when connect return false.


Regards,
Veronique.





Scott Aron Bloom a ïcrit : 

Would it be that hard for the SIGNAL/SLOT functions that are used in the connect and disconnect functionality to ignore the parameter names!

 

Just spent another ï  hour of my life wondering why Im getting the no such signal warning, because I was connecting SIGNAL( foo( int bar ) )  as opposed to SIGNAL( foo( int ) )

 

Its already doing a bunch of parsingâ would it be that hard?

Rant offâ Back to your regularly scheduled programmingâ.

 

Scott

 

Please Note:
 
 
 
 
Any views or opinions are solely those of the author and do not necessarily represent 
those of Independent Television News Limited unless specifically stated. 
 
This email and any files attached are confidential and intended solely for the use of the individual
 
or entity to which they are addressed. 
If you have received this email in error, please notify  <mailto:postmaster@xxxxxxxxx> 
postmaster@xxxxxxxxx 
 
Please note that to ensure regulatory compliance and for the protection of our clients and business,
we may monitor and read messages sent to and from our systems.
 
 
Thank You.
 




 

 


Message 18 in thread

On Friday 06 October 2006 11:12, Scott Aron Bloom wrote:
>
> EVERYONE has typosâ there is NO way around themâ making typos compiler
> errors rather then runtime errors is paramount to preventing bugs.

It's worth looking at signals/slots in the boost library.  If I remember 
correctly (and I may not, it's been a while since I looked), these are 
implemented using templates and provide compile-time checking.  I'd love to 
see Qt5 use something along these lines.

I'm all for compilers performing as many checks as they can before I even run 
the code.

--
 [ signature omitted ] 

Message 19 in thread

On Oct 6, 2006, at 10:14 AM, Chris Thompson wrote:

> On Friday 06 October 2006 11:12, Scott Aron Bloom wrote:
>>
>> EVERYONE has typos… there is NO way around them… making typos  
>> compiler
>> errors rather then runtime errors is paramount to preventing bugs.
>
> It's worth looking at signals/slots in the boost library.  If I  
> remember
> correctly (and I may not, it's been a while since I looked), these are
> implemented using templates and provide compile-time checking.  I'd  
> love to
> see Qt5 use something along these lines.
>
> I'm all for compilers performing as many checks as they can before  
> I even run
> the code.
>

Yes, I'm surprised that Qt does not use templates for their slots and  
signals as well.  Anyone know why this is?  Type safety is a nice  
part of C++, perhaps the Trolls disagree for some reason.

-- 
 [ signature omitted ] 

Message 20 in thread

On Friday 06 October 2006 11:46, Rich Cook wrote:
>
> Yes, I'm surprised that Qt does not use templates for their slots and
> signals as well.  Anyone know why this is?  Type safety is a nice
> part of C++, perhaps the Trolls disagree for some reason.

Problem is, it's only been in the last few years that C++ compilers really 
supported templates sufficiently.  For example, Visual C++ 6.0 and 7.0 have 
very little or no support for partial template specialisation, though 7.1 and 
higher are good.  And without PTS, you can't do the necessary template 
metaprogramming required.

Trolltech has always taken a fairly conservative approach, supporting very old 
compilers.

That said, a case could have been made during the 4.0 timeframe that it was 
reasonable to require modern compilers.  For the 5.0 timeframe, it's 
_definitely_ reasonable.

--
 [ signature omitted ] 

Message 21 in thread

Support for broken old compilers is actually a decent reason -- I  
agree that in the next release they would do well to rethink it.

On Oct 6, 2006, at 10:50 AM, Chris Thompson wrote:

> On Friday 06 October 2006 11:46, Rich Cook wrote:
>>
>> Yes, I'm surprised that Qt does not use templates for their slots and
>> signals as well.  Anyone know why this is?  Type safety is a nice
>> part of C++, perhaps the Trolls disagree for some reason.
>
> Problem is, it's only been in the last few years that C++ compilers  
> really
> supported templates sufficiently.  For example, Visual C++ 6.0 and  
> 7.0 have
> very little or no support for partial template specialisation,  
> though 7.1 and
> higher are good.  And without PTS, you can't do the necessary template
> metaprogramming required.
>
> Trolltech has always taken a fairly conservative approach,  
> supporting very old
> compilers.
>
> That said, a case could have been made during the 4.0 timeframe  
> that it was
> reasonable to require modern compilers.  For the 5.0 timeframe, it's
> _definitely_ reasonable.
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx  
> with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/

-- 
 [ signature omitted ] 

Message 22 in thread

On 10/6/06, Chris Thompson <cthompson@xxxxxxxxxxxxxxx> wrote:
> That said, a case could have been made during the 4.0 timeframe that it was
> reasonable to require modern compilers.  For the 5.0 timeframe, it's
> _definitely_ reasonable.

I'd suggest you read:

http://doc.trolltech.com/4.1/templates.html

Cheers

Rich.

--
 [ signature omitted ] 

Message 23 in thread

Richard Moore wrote:
> On 10/6/06, Chris Thompson <cthompson@xxxxxxxxxxxxxxx> wrote:
> > That said, a case could have been made during the 4.0 timeframe that it was
> > reasonable to require modern compilers.  For the 5.0 timeframe, it's
> > _definitely_ reasonable.
> 
> I'd suggest you read:
> 
> http://doc.trolltech.com/4.1/templates.html

Yes, but keep in mind that this is biased. It might help to understand
TT's stance, but it is not exactly accurate from a non-marketing POV.

For instance,

  <cite>
  Qt's signals and slots implementation is not as fast as a template-based
  solution. While emitting a signal is approximately the cost of four
  ordinary function calls with common template implementations, Qt 
  requires effort comparable to about ten function calls
  </cite>

This seems to imply that it's ok to use Qt signal/slots if it's ok
to use template based once and you are willing to sacrify a factor
of 2.5. 

It is not. Just try it.

And the OP's actual problem (no compile time check, and even no visible
default runtime check in the optimized version) is not addressed at all.

Having no compile time checks is a black hole for developer time.
Having no default run time checks leads to unhappy customers...

A strong point _for_ the current s/s implementation would be the
ability to dynamically add signals and slots, but that's not
possible (at least not officially supported) right now.

Andre'

--
 [ signature omitted ] 

Message 24 in thread

Probably because QT existed before templates were anywhere near stable
enough to use across platforms...

Scott

> -----Original Message-----
> From: Rich Cook [mailto:wealthychef@xxxxxxxxx]
> Sent: Friday, October 06, 2006 10:46 AM
> To: Chris Thompson
> Cc: qt-interest@xxxxxxxxxxxxx
> Subject: Re: Rant... just a rant... ignore if you want :(
> 
> 
> On Oct 6, 2006, at 10:14 AM, Chris Thompson wrote:
> 
> > On Friday 06 October 2006 11:12, Scott Aron Bloom wrote:
> >>
> >> EVERYONE has typos... there is NO way around them... making typos
> >> compiler
> >> errors rather then runtime errors is paramount to preventing bugs.
> >
> > It's worth looking at signals/slots in the boost library.  If I
> > remember
> > correctly (and I may not, it's been a while since I looked), these
are
> > implemented using templates and provide compile-time checking.  I'd
> > love to
> > see Qt5 use something along these lines.
> >
> > I'm all for compilers performing as many checks as they can before
> > I even run
> > the code.
> >
> 
> Yes, I'm surprised that Qt does not use templates for their slots and
> signals as well.  Anyone know why this is?  Type safety is a nice
> part of C++, perhaps the Trolls disagree for some reason.
> 
> --
> "There's no time to stop for gas, we're already late"-- Karin Donker
> --
> Rich "wealthychef" Cook
> <http://web.mac.com/wealthychef/iWeb/Site/Urinetown.html>
> 925-784-3077
> --
> 
> 
> 
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/

--
 [ signature omitted ] 

Message 25 in thread

Well, they could change that any time, right?  The signal/slot  
mechanism, while integral to their code base semantically and  
technically, is probably well confined to a couple/few modules.   
Changing to a template mechanism is a good idea.  In fact, it might  
add some capability, such as using function pointers or what have  
you, if you don't need to know the name of the function at compile time.

On Oct 6, 2006, at 10:53 AM, Scott Aron Bloom wrote:

> Probably because QT existed before templates were anywhere near stable
> enough to use across platforms...
>
> Scott
>
>> -----Original Message-----
>> From: Rich Cook [mailto:wealthychef@xxxxxxxxx]
>> Sent: Friday, October 06, 2006 10:46 AM
>> To: Chris Thompson
>> Cc: qt-interest@xxxxxxxxxxxxx
>> Subject: Re: Rant... just a rant... ignore if you want :(
>>
>>
>> On Oct 6, 2006, at 10:14 AM, Chris Thompson wrote:
>>
>>> On Friday 06 October 2006 11:12, Scott Aron Bloom wrote:
>>>>
>>>> EVERYONE has typos... there is NO way around them... making typos
>>>> compiler
>>>> errors rather then runtime errors is paramount to preventing bugs.
>>>
>>> It's worth looking at signals/slots in the boost library.  If I
>>> remember
>>> correctly (and I may not, it's been a while since I looked), these
> are
>>> implemented using templates and provide compile-time checking.  I'd
>>> love to
>>> see Qt5 use something along these lines.
>>>
>>> I'm all for compilers performing as many checks as they can before
>>> I even run
>>> the code.
>>>
>>
>> Yes, I'm surprised that Qt does not use templates for their slots and
>> signals as well.  Anyone know why this is?  Type safety is a nice
>> part of C++, perhaps the Trolls disagree for some reason.
>>
>> --
>> "There's no time to stop for gas, we're already late"-- Karin Donker
>> --
>> Rich "wealthychef" Cook
>> <http://web.mac.com/wealthychef/iWeb/Site/Urinetown.html>
>> 925-784-3077
>> --
>>
>>
>>
>> --
>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx  
>> with
>> "unsubscribe" in the subject or the body.
>> List archive and information: http://lists.trolltech.com/qt-interest/

-- 
 [ signature omitted ] 

Message 26 in thread

I agree... but the transition path would be HUGE for all the
pre-existing code...

3->4 was hard enough :(

Scott

> -----Original Message-----
> From: Rich Cook [mailto:wealthychef@xxxxxxxxx]
> Sent: Friday, October 06, 2006 10:57 AM
> To: Scott Aron Bloom
> Cc: qt Interest
> Subject: Re: Rant... just a rant... ignore if you want :(
> 
> Well, they could change that any time, right?  The signal/slot
> mechanism, while integral to their code base semantically and
> technically, is probably well confined to a couple/few modules.
> Changing to a template mechanism is a good idea.  In fact, it might
> add some capability, such as using function pointers or what have
> you, if you don't need to know the name of the function at compile
time.
> 
> On Oct 6, 2006, at 10:53 AM, Scott Aron Bloom wrote:
> 
> > Probably because QT existed before templates were anywhere near
stable
> > enough to use across platforms...
> >
> > Scott
> >
> >> -----Original Message-----
> >> From: Rich Cook [mailto:wealthychef@xxxxxxxxx]
> >> Sent: Friday, October 06, 2006 10:46 AM
> >> To: Chris Thompson
> >> Cc: qt-interest@xxxxxxxxxxxxx
> >> Subject: Re: Rant... just a rant... ignore if you want :(
> >>
> >>
> >> On Oct 6, 2006, at 10:14 AM, Chris Thompson wrote:
> >>
> >>> On Friday 06 October 2006 11:12, Scott Aron Bloom wrote:
> >>>>
> >>>> EVERYONE has typos... there is NO way around them... making typos
> >>>> compiler
> >>>> errors rather then runtime errors is paramount to preventing
bugs.
> >>>
> >>> It's worth looking at signals/slots in the boost library.  If I
> >>> remember
> >>> correctly (and I may not, it's been a while since I looked), these
> > are
> >>> implemented using templates and provide compile-time checking.
I'd
> >>> love to
> >>> see Qt5 use something along these lines.
> >>>
> >>> I'm all for compilers performing as many checks as they can before
> >>> I even run
> >>> the code.
> >>>
> >>
> >> Yes, I'm surprised that Qt does not use templates for their slots
and
> >> signals as well.  Anyone know why this is?  Type safety is a nice
> >> part of C++, perhaps the Trolls disagree for some reason.
> >>
> >> --
> >> "There's no time to stop for gas, we're already late"-- Karin
Donker
> >> --
> >> Rich "wealthychef" Cook
> >> <http://web.mac.com/wealthychef/iWeb/Site/Urinetown.html>
> >> 925-784-3077
> >> --
> >>
> >>
> >>
> >> --
> >> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx
> >> with
> >> "unsubscribe" in the subject or the body.
> >> List archive and information:
http://lists.trolltech.com/qt-interest/
> 
> --
> "There's no time to stop for gas, we're already late"-- Karin Donker
> --
> Rich "wealthychef" Cook
> <http://web.mac.com/wealthychef/iWeb/Site/Urinetown.html>
> 925-784-3077
> --
> 

--
 [ signature omitted ] 

Message 27 in thread

No, I don't think you have to change the API in the slightest to  
switch to templates.  Just make SLOT and SIGNAL be noops, and use  
template magic to do the rest.

On Oct 6, 2006, at 11:03 AM, Scott Aron Bloom wrote:

> I agree... but the transition path would be HUGE for all the
> pre-existing code...
>
> 3->4 was hard enough :(
>
> Scott
>
>> -----Original Message-----
>> From: Rich Cook [mailto:wealthychef@xxxxxxxxx]
>> Sent: Friday, October 06, 2006 10:57 AM
>> To: Scott Aron Bloom
>> Cc: qt Interest
>> Subject: Re: Rant... just a rant... ignore if you want :(
>>
>> Well, they could change that any time, right?  The signal/slot
>> mechanism, while integral to their code base semantically and
>> technically, is probably well confined to a couple/few modules.
>> Changing to a template mechanism is a good idea.  In fact, it might
>> add some capability, such as using function pointers or what have
>> you, if you don't need to know the name of the function at compile
> time.
>>
>> On Oct 6, 2006, at 10:53 AM, Scott Aron Bloom wrote:
>>
>>> Probably because QT existed before templates were anywhere near
> stable
>>> enough to use across platforms...
>>>
>>> Scott
>>>
>>>> -----Original Message-----
>>>> From: Rich Cook [mailto:wealthychef@xxxxxxxxx]
>>>> Sent: Friday, October 06, 2006 10:46 AM
>>>> To: Chris Thompson
>>>> Cc: qt-interest@xxxxxxxxxxxxx
>>>> Subject: Re: Rant... just a rant... ignore if you want :(
>>>>
>>>>
>>>> On Oct 6, 2006, at 10:14 AM, Chris Thompson wrote:
>>>>
>>>>> On Friday 06 October 2006 11:12, Scott Aron Bloom wrote:
>>>>>>
>>>>>> EVERYONE has typos... there is NO way around them... making typos
>>>>>> compiler
>>>>>> errors rather then runtime errors is paramount to preventing
> bugs.
>>>>>
>>>>> It's worth looking at signals/slots in the boost library.  If I
>>>>> remember
>>>>> correctly (and I may not, it's been a while since I looked), these
>>> are
>>>>> implemented using templates and provide compile-time checking.
> I'd
>>>>> love to
>>>>> see Qt5 use something along these lines.
>>>>>
>>>>> I'm all for compilers performing as many checks as they can before
>>>>> I even run
>>>>> the code.
>>>>>
>>>>
>>>> Yes, I'm surprised that Qt does not use templates for their slots
> and
>>>> signals as well.  Anyone know why this is?  Type safety is a nice
>>>> part of C++, perhaps the Trolls disagree for some reason.
>>>>
>>>> --
>>>> "There's no time to stop for gas, we're already late"-- Karin
> Donker
>>>> --
>>>> Rich "wealthychef" Cook
>>>> <http://web.mac.com/wealthychef/iWeb/Site/Urinetown.html>
>>>> 925-784-3077
>>>> --
>>>>
>>>>
>>>>
>>>> --
>>>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx
>>>> with
>>>> "unsubscribe" in the subject or the body.
>>>> List archive and information:
> http://lists.trolltech.com/qt-interest/
>>
>> --
>> "There's no time to stop for gas, we're already late"-- Karin Donker
>> --
>> Rich "wealthychef" Cook
>> <http://web.mac.com/wealthychef/iWeb/Site/Urinetown.html>
>> 925-784-3077
>> --
>>
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx  
> with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/

-- 
 [ signature omitted ] 

Message 28 in thread

>> I install a qtmessage handler <<
 
Me too. For what it's worth -- I set QtWarningMsg and QtFatalMsg to use the app's Error class which logs errors and enables users to report them by email. This at least means that you get a meaningful bug report for signal/slot problems.
 
Sam

________________________________

From: Scott Aron Bloom [mailto:scott@xxxxxxxxxxxx] 
Sent: Friday 06 October 2006 17:30
To: Dutton, Sam; qt-interest@xxxxxxxxxxxxx
Subject: RE: Rant... just a rant... ignore if you want :(



I think that is just a plain old ramifaction of signals/slots in QT, and yes, I have been bit by it more then once.

 

That's why for all my projects, I install a qtmessage handler, that blows assertions on the can not connect warning...


This way they are VERY hard to forget :-)

Scott

 

________________________________

From: Dutton, Sam [mailto:Sam.Dutton@xxxxxxxxx] 
Sent: Friday, October 06, 2006 9:24 AM
To: qt-interest@xxxxxxxxxxxxx
Subject: RE: Rant... just a rant... ignore if you want :(

 

For me, the main problem is signal/slot errors that don't get picked up at compile time. 

 

I've been bitten by this by not testing properly: the error shows up when a user complains...

 

Sam Dutton

 

 

 


 

 

SAM DUTTON
SENIOR SITE DEVELOPER

200 GRAY'S INN ROAD
LONDON
WC1X 8XZ
UNITED KINGDOM
T +44 (0)20 7430 4496
F 
E SAM.DUTTON@xxxxxxxxx
WWW.ITN.CO.UK

 

________________________________


 

From: Scott Aron Bloom [mailto:scott@xxxxxxxxxxxx] 
Sent: Friday 06 October 2006 15:35
To: veronique.lefrere@xxxxxx; qt-interest@xxxxxxxxxxxxx
Subject: RE: Rant... just a rant... ignore if you want :(

Excuse me... but Im not a noob....  

I know the correct way, but if I design a functional interface that's turns into a slot, or just creating the slot itself, I will quite often COPY the interface from the header, and wrap it in the SIGNAL/SLOT calls.

 

That's how the parameter names get in their by accident.

 

Scott

 

________________________________

From: veronique.lefrere@xxxxxx [mailto:veronique.lefrere@xxxxxx] 
Sent: Friday, October 06, 2006 12:17 AM
To: qt-interest@xxxxxxxxxxxxx
Subject: Re: Rant... just a rant... ignore if you want :(

 

Nobody's perfect....
who didn't loose time with this "newbie" coding error?
if you read slots doc and particulary connect documentation, this is clear
"Note that the signal and slots parameters must not contain any variable names, 
 only the type. E.g. the following would not work and return false"
Maybe here is the solution, generate a qdebug message when connect return false.


Regards,
Veronique.





Scott Aron Bloom a écrit : 

Would it be that hard for the SIGNAL/SLOT functions that are used in the connect and disconnect functionality to ignore the parameter names!

 

Just spent another ½  hour of my life wondering why Im getting the no such signal warning, because I was connecting SIGNAL( foo( int bar ) )  as opposed to SIGNAL( foo( int ) )

 

Its already doing a bunch of parsing... would it be that hard?

Rant off... Back to your regularly scheduled programming....

 

Scott

 

Please Note:
 
 
 
Any views or opinions are solely those of the author and do not necessarily represent 
those of Independent Television News Limited unless specifically stated. 
This email and any files attached are confidential and intended solely for the use of the individual
or entity to which they are addressed. 
If you have received this email in error, please notify postmaster@xxxxxxxxx 
 
Please note that to ensure regulatory compliance and for the protection of our clients and business,
we may monitor and read messages sent to and from our systems.
 
Thank You.
 
Please Note:

 

Any views or opinions are solely those of the author and do not necessarily represent 
those of Independent Television News Limited unless specifically stated. 
This email and any files attached are confidential and intended solely for the use of the individual
or entity to which they are addressed. 
If you have received this email in error, please notify postmaster@xxxxxxxxx 

Please note that to ensure regulatory compliance and for the protection of our clients and business,
we may monitor and read messages sent to and from our systems.

Thank You.

GIF image

GIF image


Message 29 in thread

Has ANYBODY... know a QtLint where it does this type of check?

Scott

 

________________________________

From: Dutton, Sam [mailto:Sam.Dutton@xxxxxxxxx] 
Sent: Friday, October 06, 2006 9:34 AM
To: qt-interest@xxxxxxxxxxxxx
Subject: RE: Rant... just a rant... ignore if you want :(

 

>> I install a qtmessage handler <<

 

Me too. For what it's worth -- I set QtWarningMsg and QtFatalMsg to use the app's Error class which logs errors and enables users to report them by email. This at least means that you get a meaningful bug report for signal/slot problems.

 

Sam

 

________________________________

From: Scott Aron Bloom [mailto:scott@xxxxxxxxxxxx] 
Sent: Friday 06 October 2006 17:30
To: Dutton, Sam; qt-interest@xxxxxxxxxxxxx
Subject: RE: Rant... just a rant... ignore if you want :(

I think that is just a plain old ramifaction of signals/slots in QT, and yes, I have been bit by it more then once.

 

That's why for all my projects, I install a qtmessage handler, that blows assertions on the can not connect warning...


This way they are VERY hard to forget :-)

Scott

 

________________________________

From: Dutton, Sam [mailto:Sam.Dutton@xxxxxxxxx] 
Sent: Friday, October 06, 2006 9:24 AM
To: qt-interest@xxxxxxxxxxxxx
Subject: RE: Rant... just a rant... ignore if you want :(

 

For me, the main problem is signal/slot errors that don't get picked up at compile time. 

 

I've been bitten by this by not testing properly: the error shows up when a user complains...

 

Sam Dutton

 

 

 


 

 

SAM DUTTON
SENIOR SITE DEVELOPER

200 GRAY'S INN ROAD
LONDON
WC1X 8XZ
UNITED KINGDOM
T +44 (0)20 7430 4496
F 
E SAM.DUTTON@xxxxxxxxx
WWW.ITN.CO.UK

 

________________________________

 

From: Scott Aron Bloom [mailto:scott@xxxxxxxxxxxx] 
Sent: Friday 06 October 2006 15:35
To: veronique.lefrere@xxxxxx; qt-interest@xxxxxxxxxxxxx
Subject: RE: Rant... just a rant... ignore if you want :(

Excuse me... but Im not a noob....  

I know the correct way, but if I design a functional interface that's turns into a slot, or just creating the slot itself, I will quite often COPY the interface from the header, and wrap it in the SIGNAL/SLOT calls.

 

That's how the parameter names get in their by accident.

 

Scott

 

________________________________

From: veronique.lefrere@xxxxxx [mailto:veronique.lefrere@xxxxxx] 
Sent: Friday, October 06, 2006 12:17 AM
To: qt-interest@xxxxxxxxxxxxx
Subject: Re: Rant... just a rant... ignore if you want :(

 

Nobody's perfect....
who didn't loose time with this "newbie" coding error?
if you read slots doc and particulary connect documentation, this is clear
"Note that the signal and slots parameters must not contain any variable names, 
 only the type. E.g. the following would not work and return false"
Maybe here is the solution, generate a qdebug message when connect return false.


Regards,
Veronique.





Scott Aron Bloom a écrit : 

Would it be that hard for the SIGNAL/SLOT functions that are used in the connect and disconnect functionality to ignore the parameter names!

 

Just spent another ½  hour of my life wondering why Im getting the no such signal warning, because I was connecting SIGNAL( foo( int bar ) )  as opposed to SIGNAL( foo( int ) )

 

Its already doing a bunch of parsing... would it be that hard?

Rant off... Back to your regularly scheduled programming....

 

Scott

 

Please Note:
 
 
 
Any views or opinions are solely those of the author and do not necessarily represent 
those of Independent Television News Limited unless specifically stated. 
This email and any files attached are confidential and intended solely for the use of the individual
or entity to which they are addressed. 
If you have received this email in error, please notify postmaster@xxxxxxxxx 
 
Please note that to ensure regulatory compliance and for the protection of our clients and business,
we may monitor and read messages sent to and from our systems.
 
Thank You.
 
Please Note:
 
 
 
Any views or opinions are solely those of the author and do not necessarily represent 
those of Independent Television News Limited unless specifically stated. 
This email and any files attached are confidential and intended solely for the use of the individual
or entity to which they are addressed. 
If you have received this email in error, please notify postmaster@xxxxxxxxx 
 
Please note that to ensure regulatory compliance and for the protection of our clients and business,
we may monitor and read messages sent to and from our systems.
 
Thank You.
 

GIF image

GIF image