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

List:       kde-devel
Subject:    problem compiling moc file
From:       Jason Harris <kstars () 30doradus ! org>
Date:       2004-04-16 2:34:21
Message-ID: 200404152231.20770.kstars () 30doradus ! org
[Download RAW message or body]

Hello,

I am making some experimental modifications to the KDateTable class.  My 
version is called ExtDateTable, and will allow the user to specify any 
arbitrary date, not just those years in the range 1752-8000 (we also 
have ExtDate/ExtDateTime classes to replace QDate/QDateTime, but that's 
not important for the present question).

The problem is, I am getting a compiler error in  extdatetbl.moc:

extdatetbl.moc: In member function `virtual bool 
ExtDateTable::qt_property(int,
   int, QVariant*)':
extdatetbl.moc:559: error: `const class ExtDate' used where a `int' was
   expected


The relevant code in extdatetbl.moc is:
bool ExtDateTable::qt_property( int id, int f, QVariant* v)
{
    switch ( id - staticMetaObject()->propertyOffset() ) {
    case 0: switch( f ) {
	case 0: setDate((ExtDate&)v->asInt()); break;
	case 1: *v = QVariant( (int)this->getDate() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;

And the corresponding code from the original kdatetbl.moc is:
bool KDateTable::qt_property( int id, int f, QVariant* v)
{
    switch ( id - staticMetaObject()->propertyOffset() ) {
    case 0: switch( f ) {
	case 0: setDate(v->asDate()); break;
	case 1: *v = QVariant( this->getDate() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;


Can anyone tell from this what the problem might be?  Specifically, why 
is it using "setDate((ExtDate&)v->asInt());" instead of 
"setDate(v->asDate());" ?

I've never had an uncompilable moc file before, so any help would be 
much appreciated!

TIA,
Jason
-- 
KStars: A KDE Planetarium
http://edu.kde.org/kstars
 
>> Visit http://mail.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