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

List:       kde-devel
Subject:    Re: (no subject)
From:       Patrick Julien <freakmtl () videotron ! ca>
Date:       2001-03-25 1:37:34
[Download RAW message or body]

On Saturday 24 March 2001 06:02, Alain wrote:
> Hi all,
>
> I don't understand why this bit of code is refused at _compile_ time:
>
> QLineEdit* pLEdit ; // defined in a UI file with QTDesigner
> [...]
>
> QDoubleValidator*
> pVal=dynamic_cast<QDoubleValidator*>(pLEdit->validator());
>
> can't cast "const class qvalidator*" to "class QDoubleValidator*"

	cuz it's a constant, you could do something like

		const QDoubleValidator *p = dynamic_cast<const QDoubleValidator*>
(pLEdit->validator());

	or this very bad code

	QDoubleValidator *p = 
dynamic_cast<QDoubleValidator*>(const_cast<QValidator*>(pLEdit->validator()));

>
>
> TIA
>
>
> Alain
>
> >> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to
> >> unsubscribe <<
 
>> 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