[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdebindings/kjsembed
From: Ian Reinhart Geiser <geiseri () kde ! org>
Date: 2005-02-22 20:59:30
Message-ID: 20050222205930.4ED50ED8A () office ! kde ! org
[Download RAW message or body]
CVS commit by geiseri:
Fixed showstopper where Qt enums where silently being dropped when
being set. It seems that Qt will not try to convert a variant to
an enum unless its a uint. Oddly enough it is more than happy to
convert a number to a string or a string to a color.
M +6 -6 jsobjectproxy.cpp 1.71
--- kdebindings/kjsembed/jsobjectproxy.cpp #1.70:1.71
@@ -151,12 +151,12 @@ namespace KJSEmbed {
// Properties
QMetaObject *meta = obj->metaObject();
-
- if ( meta->findProperty( p.ascii(), true ) != -1 ) {
+ int propIndex = meta->findProperty( p.ascii(), true );
+ if ( propIndex != -1 ) {
QVariant val = convertToVariant( exec, v );
- kdDebug( 80001 ) << "JS setting '" << p.ascii() << "' ( " << \
val.typeName() << " ) " << endl;
-
- if ( val.isValid() )
+ if ( meta->property(propIndex, true)->isEnumType() ) {
+ obj->setProperty( p.ascii(), val.toUInt() );
+ } else if ( val.isValid() ) {
obj->setProperty( p.ascii(), val );
- else {
+ } else {
kdWarning(80001) << "Error setting value." << endl;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic