diff options
Diffstat (limited to 'kdevdesigner/designer/resource.cpp')
-rw-r--r-- | kdevdesigner/designer/resource.cpp | 572 |
1 files changed, 301 insertions, 271 deletions
diff --git a/kdevdesigner/designer/resource.cpp b/kdevdesigner/designer/resource.cpp index f86490c4..18b00d30 100644 --- a/kdevdesigner/designer/resource.cpp +++ b/kdevdesigner/designer/resource.cpp @@ -112,87 +112,87 @@ static struct { int key; const char* name; } keyname[] = { - { TQt::Key_Space, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Space" ) }, - { TQt::Key_Escape, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Esc" ) }, - { TQt::Key_Tab, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Tab" ) }, - { TQt::Key_Backtab, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Backtab" ) }, - { TQt::Key_Backspace, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Backspace" ) }, - { TQt::Key_Return, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Return" ) }, - { TQt::Key_Enter, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Enter" ) }, - { TQt::Key_Insert, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Ins" ) }, - { TQt::Key_Delete, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Del" ) }, - { TQt::Key_Pause, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Pause" ) }, - { TQt::Key_Print, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Print" ) }, - { TQt::Key_SysReq, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "SysReq" ) }, - { TQt::Key_Home, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Home" ) }, - { TQt::Key_End, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "End" ) }, - { TQt::Key_Left, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Left" ) }, - { TQt::Key_Up, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Up" ) }, - { TQt::Key_Right, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Right" ) }, - { TQt::Key_Down, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Down" ) }, - { TQt::Key_Prior, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "PgUp" ) }, - { TQt::Key_Next, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "PgDown" ) }, - { TQt::Key_CapsLock, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "CapsLock" ) }, - { TQt::Key_NumLock, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "NumLock" ) }, - { TQt::Key_ScrollLock, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "ScrollLock" ) }, - { TQt::Key_Menu, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Menu" ) }, - { TQt::Key_Help, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Help" ) }, + { TQt::Key_Space, TQT_TRANSLATE_NOOP( "TQAccel", "Space" ) }, + { TQt::Key_Escape, TQT_TRANSLATE_NOOP( "TQAccel", "Esc" ) }, + { TQt::Key_Tab, TQT_TRANSLATE_NOOP( "TQAccel", "Tab" ) }, + { TQt::Key_Backtab, TQT_TRANSLATE_NOOP( "TQAccel", "Backtab" ) }, + { TQt::Key_Backspace, TQT_TRANSLATE_NOOP( "TQAccel", "Backspace" ) }, + { TQt::Key_Return, TQT_TRANSLATE_NOOP( "TQAccel", "Return" ) }, + { TQt::Key_Enter, TQT_TRANSLATE_NOOP( "TQAccel", "Enter" ) }, + { TQt::Key_Insert, TQT_TRANSLATE_NOOP( "TQAccel", "Ins" ) }, + { TQt::Key_Delete, TQT_TRANSLATE_NOOP( "TQAccel", "Del" ) }, + { TQt::Key_Pause, TQT_TRANSLATE_NOOP( "TQAccel", "Pause" ) }, + { TQt::Key_Print, TQT_TRANSLATE_NOOP( "TQAccel", "Print" ) }, + { TQt::Key_SysReq, TQT_TRANSLATE_NOOP( "TQAccel", "SysReq" ) }, + { TQt::Key_Home, TQT_TRANSLATE_NOOP( "TQAccel", "Home" ) }, + { TQt::Key_End, TQT_TRANSLATE_NOOP( "TQAccel", "End" ) }, + { TQt::Key_Left, TQT_TRANSLATE_NOOP( "TQAccel", "Left" ) }, + { TQt::Key_Up, TQT_TRANSLATE_NOOP( "TQAccel", "Up" ) }, + { TQt::Key_Right, TQT_TRANSLATE_NOOP( "TQAccel", "Right" ) }, + { TQt::Key_Down, TQT_TRANSLATE_NOOP( "TQAccel", "Down" ) }, + { TQt::Key_Prior, TQT_TRANSLATE_NOOP( "TQAccel", "PgUp" ) }, + { TQt::Key_Next, TQT_TRANSLATE_NOOP( "TQAccel", "PgDown" ) }, + { TQt::Key_CapsLock, TQT_TRANSLATE_NOOP( "TQAccel", "CapsLock" ) }, + { TQt::Key_NumLock, TQT_TRANSLATE_NOOP( "TQAccel", "NumLock" ) }, + { TQt::Key_ScrollLock, TQT_TRANSLATE_NOOP( "TQAccel", "ScrollLock" ) }, + { TQt::Key_Menu, TQT_TRANSLATE_NOOP( "TQAccel", "Menu" ) }, + { TQt::Key_Help, TQT_TRANSLATE_NOOP( "TQAccel", "Help" ) }, // Multimedia keys - { TQt::Key_Back, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Back" ) }, - { TQt::Key_Forward, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Forward" ) }, - { TQt::Key_Stop, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Stop" ) }, - { TQt::Key_Refresh, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Refresh" ) }, - { TQt::Key_VolumeDown, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Volume Down" ) }, - { TQt::Key_VolumeMute, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Volume Mute" ) }, - { TQt::Key_VolumeUp, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Volume Up" ) }, - { TQt::Key_BassBoost, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Bass Boost" ) }, - { TQt::Key_BassUp, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Bass Up" ) }, - { TQt::Key_BassDown, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Bass Down" ) }, - { TQt::Key_TrebleUp, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Treble Up" ) }, - { TQt::Key_TrebleDown, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Treble Down" ) }, - { TQt::Key_MediaPlay, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Media Play" ) }, - { TQt::Key_MediaStop, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Media Stop" ) }, - { TQt::Key_MediaPrev, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Media Previous" ) }, - { TQt::Key_MediaNext, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Media Next" ) }, - { TQt::Key_MediaRecord, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Media Record" ) }, - { TQt::Key_HomePage, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Home" ) }, - { TQt::Key_Favorites, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Favorites" ) }, - { TQt::Key_Search, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Search" ) }, - { TQt::Key_Standby, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Standby" ) }, - { TQt::Key_OpenUrl, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Open URL" ) }, - { TQt::Key_LaunchMail, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Launch Mail" ) }, - { TQt::Key_LaunchMedia, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Launch Media" ) }, - { TQt::Key_Launch0, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Launch (0)" ) }, - { TQt::Key_Launch1, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Launch (1)" ) }, - { TQt::Key_Launch2, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Launch (2)" ) }, - { TQt::Key_Launch3, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Launch (3)" ) }, - { TQt::Key_Launch4, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Launch (4)" ) }, - { TQt::Key_Launch5, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Launch (5)" ) }, - { TQt::Key_Launch6, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Launch (6)" ) }, - { TQt::Key_Launch7, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Launch (7)" ) }, - { TQt::Key_Launch8, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Launch (8)" ) }, - { TQt::Key_Launch9, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Launch (9)" ) }, - { TQt::Key_LaunchA, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Launch (A)" ) }, - { TQt::Key_LaunchB, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Launch (B)" ) }, - { TQt::Key_LaunchC, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Launch (C)" ) }, - { TQt::Key_LaunchD, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Launch (D)" ) }, - { TQt::Key_LaunchE, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Launch (E)" ) }, - { TQt::Key_LaunchF, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Launch (F)" ) }, + { TQt::Key_Back, TQT_TRANSLATE_NOOP( "TQAccel", "Back" ) }, + { TQt::Key_Forward, TQT_TRANSLATE_NOOP( "TQAccel", "Forward" ) }, + { TQt::Key_Stop, TQT_TRANSLATE_NOOP( "TQAccel", "Stop" ) }, + { TQt::Key_Refresh, TQT_TRANSLATE_NOOP( "TQAccel", "Refresh" ) }, + { TQt::Key_VolumeDown, TQT_TRANSLATE_NOOP( "TQAccel", "Volume Down" ) }, + { TQt::Key_VolumeMute, TQT_TRANSLATE_NOOP( "TQAccel", "Volume Mute" ) }, + { TQt::Key_VolumeUp, TQT_TRANSLATE_NOOP( "TQAccel", "Volume Up" ) }, + { TQt::Key_BassBoost, TQT_TRANSLATE_NOOP( "TQAccel", "Bass Boost" ) }, + { TQt::Key_BassUp, TQT_TRANSLATE_NOOP( "TQAccel", "Bass Up" ) }, + { TQt::Key_BassDown, TQT_TRANSLATE_NOOP( "TQAccel", "Bass Down" ) }, + { TQt::Key_TrebleUp, TQT_TRANSLATE_NOOP( "TQAccel", "Treble Up" ) }, + { TQt::Key_TrebleDown, TQT_TRANSLATE_NOOP( "TQAccel", "Treble Down" ) }, + { TQt::Key_MediaPlay, TQT_TRANSLATE_NOOP( "TQAccel", "Media Play" ) }, + { TQt::Key_MediaStop, TQT_TRANSLATE_NOOP( "TQAccel", "Media Stop" ) }, + { TQt::Key_MediaPrev, TQT_TRANSLATE_NOOP( "TQAccel", "Media Previous" ) }, + { TQt::Key_MediaNext, TQT_TRANSLATE_NOOP( "TQAccel", "Media Next" ) }, + { TQt::Key_MediaRecord, TQT_TRANSLATE_NOOP( "TQAccel", "Media Record" ) }, + { TQt::Key_HomePage, TQT_TRANSLATE_NOOP( "TQAccel", "Home" ) }, + { TQt::Key_Favorites, TQT_TRANSLATE_NOOP( "TQAccel", "Favorites" ) }, + { TQt::Key_Search, TQT_TRANSLATE_NOOP( "TQAccel", "Search" ) }, + { TQt::Key_Standby, TQT_TRANSLATE_NOOP( "TQAccel", "Standby" ) }, + { TQt::Key_OpenUrl, TQT_TRANSLATE_NOOP( "TQAccel", "Open URL" ) }, + { TQt::Key_LaunchMail, TQT_TRANSLATE_NOOP( "TQAccel", "Launch Mail" ) }, + { TQt::Key_LaunchMedia, TQT_TRANSLATE_NOOP( "TQAccel", "Launch Media" ) }, + { TQt::Key_Launch0, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (0)" ) }, + { TQt::Key_Launch1, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (1)" ) }, + { TQt::Key_Launch2, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (2)" ) }, + { TQt::Key_Launch3, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (3)" ) }, + { TQt::Key_Launch4, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (4)" ) }, + { TQt::Key_Launch5, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (5)" ) }, + { TQt::Key_Launch6, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (6)" ) }, + { TQt::Key_Launch7, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (7)" ) }, + { TQt::Key_Launch8, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (8)" ) }, + { TQt::Key_Launch9, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (9)" ) }, + { TQt::Key_LaunchA, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (A)" ) }, + { TQt::Key_LaunchB, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (B)" ) }, + { TQt::Key_LaunchC, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (C)" ) }, + { TQt::Key_LaunchD, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (D)" ) }, + { TQt::Key_LaunchE, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (E)" ) }, + { TQt::Key_LaunchF, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (F)" ) }, // -------------------------------------------------------------- // More consistent namings - { TQt::Key_Print, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Print Screen" ) }, - { TQt::Key_Prior, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Page Up" ) }, - { TQt::Key_Next, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Page Down" ) }, - { TQt::Key_CapsLock, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Caps Lock" ) }, - { TQt::Key_NumLock, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Num Lock" ) }, - { TQt::Key_NumLock, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Number Lock" ) }, - { TQt::Key_ScrollLock, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Scroll Lock" ) }, - { TQt::Key_Insert, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Insert" ) }, - { TQt::Key_Delete, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Delete" ) }, - { TQt::Key_Escape, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "Escape" ) }, - { TQt::Key_SysReq, TQT_TRANSLATE_NOOP( TQACCEL_OBJECT_NAME_STRING, "System Request" ) }, + { TQt::Key_Print, TQT_TRANSLATE_NOOP( "TQAccel", "Print Screen" ) }, + { TQt::Key_Prior, TQT_TRANSLATE_NOOP( "TQAccel", "Page Up" ) }, + { TQt::Key_Next, TQT_TRANSLATE_NOOP( "TQAccel", "Page Down" ) }, + { TQt::Key_CapsLock, TQT_TRANSLATE_NOOP( "TQAccel", "Caps Lock" ) }, + { TQt::Key_NumLock, TQT_TRANSLATE_NOOP( "TQAccel", "Num Lock" ) }, + { TQt::Key_NumLock, TQT_TRANSLATE_NOOP( "TQAccel", "Number Lock" ) }, + { TQt::Key_ScrollLock, TQT_TRANSLATE_NOOP( "TQAccel", "Scroll Lock" ) }, + { TQt::Key_Insert, TQT_TRANSLATE_NOOP( "TQAccel", "Insert" ) }, + { TQt::Key_Delete, TQT_TRANSLATE_NOOP( "TQAccel", "Delete" ) }, + { TQt::Key_Escape, TQT_TRANSLATE_NOOP( "TQAccel", "Escape" ) }, + { TQt::Key_SysReq, TQT_TRANSLATE_NOOP( "TQAccel", "System Request" ) }, { 0, 0 } }; @@ -319,7 +319,7 @@ bool Resource::load( FormFile *ff, Project *defProject ) TQFile f( ff->absFileName() ); f.open( IO_ReadOnly | IO_Translate ); - bool b = load( ff, TQT_TQIODEVICE(&f), defProject ); + bool b = load( ff, &f, defProject ); f.close(); return b; @@ -347,7 +347,7 @@ bool Resource::load( FormFile *ff, TQIODevice* dev, Project *defProject ) formwindow->setProject( MainWindow::self->currProject() ); if ( mainwindow ) formwindow->setMainWindow( mainwindow ); - MetaDataBase::addEntry( TQT_TQOBJECT(formwindow) ); + MetaDataBase::addEntry( formwindow ); if ( !langIface ) { TQString lang = "TQt Script"; @@ -429,7 +429,20 @@ bool Resource::load( FormFile *ff, TQIODevice* dev, Project *defProject ) inc.implDecl = "in implementation"; inc.header = e.firstChild().toText().data(); if ( inc.header.right( 5 ) != ".ui.h" ) { - metaIncludes.append( inc ); + bool found = false; + TQValueList<MetaDataBase::Include>::Iterator it; + for ( it = metaIncludes.begin(); it != metaIncludes.end(); ++it ) { + MetaDataBase::Include currInc = *it; + if ( currInc.location == inc.location && currInc.implDecl == inc.implDecl && + currInc.header == inc.header) { + found = true; + break; + } + } + if ( !found ) + { + metaIncludes.append( inc ); + } } else { if ( formwindow->formFile() ) formwindow->formFile()->setCodeFileState( FormFile::Ok ); @@ -478,17 +491,8 @@ bool Resource::load( FormFile *ff, TQIODevice* dev, Project *defProject ) if ( !customWidgets.isNull() ) loadCustomWidgets( customWidgets, this ); -#if defined (TQT_NON_COMMERCIAL) - bool previewMode = MainWindow::self ? MainWindow::self->isPreviewing() : FALSE; - TQWidget *w = (TQWidget*)createObject( widget, !previewMode ? (TQWidget*)formwindow : MainWindow::self ); - if ( !w ) - return FALSE; - if ( previewMode ) - w->reparent( MainWindow::self, TQt::WType_TopLevel, w->pos(), TRUE ); -#else if ( !createObject( widget, formwindow) ) return FALSE; -#endif if ( !forwards.isNull() ) { for ( TQDomElement n = forwards.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) @@ -509,7 +513,20 @@ bool Resource::load( FormFile *ff, TQIODevice* dev, Project *defProject ) inc.implDecl = "in implementation"; inc.header = n.firstChild().toText().data(); if ( inc.header.right( 5 ) != ".ui.h" ) { - metaIncludes.append( inc ); + bool found = false; + TQValueList<MetaDataBase::Include>::Iterator it; + for ( it = metaIncludes.begin(); it != metaIncludes.end(); ++it ) { + MetaDataBase::Include currInc = *it; + if ( currInc.location == inc.location && currInc.implDecl == inc.implDecl && + currInc.header == inc.header) { + found = true; + break; + } + } + if ( !found ) + { + metaIncludes.append( inc ); + } } else { if ( formwindow->formFile() ) formwindow->formFile()->setCodeFileState( FormFile::Ok ); @@ -552,11 +569,11 @@ bool Resource::load( FormFile *ff, TQIODevice* dev, Project *defProject ) function.returnType = "void"; function.type = "slot"; function.function = n.firstChild().toText().data(); - if ( !MetaDataBase::hasFunction( TQT_TQOBJECT(formwindow), function.function, TRUE ) ) - MetaDataBase::addFunction( TQT_TQOBJECT(formwindow), function.function, function.specifier, + if ( !MetaDataBase::hasFunction( formwindow, function.function, TRUE ) ) + MetaDataBase::addFunction( formwindow, function.function, function.specifier, function.access, "slot", function.language, function.returnType ); else - MetaDataBase::changeFunctionAttributes( TQT_TQOBJECT(formwindow), function.function, function.function, + MetaDataBase::changeFunctionAttributes( formwindow, function.function, function.function, function.specifier, function.access, "slot", function.language, function.returnType ); @@ -580,12 +597,12 @@ bool Resource::load( FormFile *ff, TQIODevice* dev, Project *defProject ) if ( function.returnType.isEmpty() ) function.returnType = "void"; function.function = n.firstChild().toText().data(); - if ( !MetaDataBase::hasFunction( TQT_TQOBJECT(formwindow), function.function, TRUE ) ) - MetaDataBase::addFunction( TQT_TQOBJECT(formwindow), function.function, function.specifier, + if ( !MetaDataBase::hasFunction( formwindow, function.function, TRUE ) ) + MetaDataBase::addFunction( formwindow, function.function, function.specifier, function.access, function.type, function.language, function.returnType ); else - MetaDataBase::changeFunctionAttributes( TQT_TQOBJECT(formwindow), function.function, function.function, + MetaDataBase::changeFunctionAttributes( formwindow, function.function, function.function, function.specifier, function.access, function.type, function.language, function.returnType ); } @@ -606,13 +623,13 @@ bool Resource::load( FormFile *ff, TQIODevice* dev, Project *defProject ) loadTabOrder( tabOrder ); if ( formwindow ) { - MetaDataBase::setIncludes( TQT_TQOBJECT(formwindow), metaIncludes ); - MetaDataBase::setForwards( TQT_TQOBJECT(formwindow), metaForwards ); - MetaDataBase::setVariables( TQT_TQOBJECT(formwindow), metaVariables ); - MetaDataBase::setSignalList( TQT_TQOBJECT(formwindow), metaSignals ); + MetaDataBase::setIncludes( formwindow, metaIncludes ); + MetaDataBase::setForwards( formwindow, metaForwards ); + MetaDataBase::setVariables( formwindow, metaVariables ); + MetaDataBase::setSignalList( formwindow, metaSignals ); metaInfo.classNameChanged = metaInfo.className != TQString( formwindow->name() ); - MetaDataBase::setMetaInfo( TQT_TQOBJECT(formwindow), metaInfo ); - MetaDataBase::setExportMacro( TQT_TQOBJECT(formwindow->mainContainer()), exportMacro ); + MetaDataBase::setMetaInfo( formwindow, metaInfo ); + MetaDataBase::setExportMacro( formwindow->mainContainer(), exportMacro ); } loadExtraSource( formwindow->formFile(), currFileName, langIface, hasFunctions ); @@ -621,7 +638,7 @@ bool Resource::load( FormFile *ff, TQIODevice* dev, Project *defProject ) mainwindow->insertFormWindow( formwindow ); if ( formwindow ) { - formwindow->killAccels( TQT_TQOBJECT(formwindow) ); + formwindow->killAccels( formwindow ); if ( formwindow->layout() ) formwindow->layout()->activate(); if ( hadGeometry ) @@ -678,7 +695,7 @@ bool Resource::save( const TQString& filename, bool formCodeOnly ) TQFile f( filename ); if ( !f.open( IO_WriteOnly | IO_Translate ) ) return FALSE; - bool b = save( TQT_TQIODEVICE(&f) ); + bool b = save( &f ); f.close(); return b; } @@ -702,23 +719,22 @@ bool Resource::save( TQIODevice* dev ) ts << "<!DOCTYPE UI><UI version=\"3.3\" stdsetdef=\"1\">" << endl; saveMetaInfoBefore( ts, 0 ); - saveObject( TQT_TQOBJECT(formwindow->mainContainer()), 0, ts, 0 ); - if ( ::tqqt_cast<TQMainWindow*>(formwindow->mainContainer()) ) { + saveObject( formwindow->mainContainer(), 0, ts, 0 ); + if ( ::tqt_cast<TQMainWindow*>(formwindow->mainContainer()) ) { saveMenuBar( (TQMainWindow*)formwindow->mainContainer(), ts, 0 ); saveToolBars( (TQMainWindow*)formwindow->mainContainer(), ts, 0 ); } if ( !MetaDataBase::customWidgets()->isEmpty() && !usedCustomWidgets.isEmpty() ) saveCustomWidgets( ts, 0 ); - if ( ::tqqt_cast<TQMainWindow*>(formwindow->mainContainer()) ) + if ( ::tqt_cast<TQMainWindow*>(formwindow->mainContainer()) ) saveActions( formwindow->actionList(), ts, 0 ); if ( !images.isEmpty() ) saveImageCollection( ts, 0 ); - if ( !MetaDataBase::connections( TQT_TQOBJECT(formwindow) ).isEmpty() || - !MetaDataBase::slotList( TQT_TQOBJECT(formwindow) ).isEmpty() ) + if ( !MetaDataBase::connections( formwindow ).isEmpty() || + !MetaDataBase::slotList( formwindow ).isEmpty() ) saveConnections( ts, 0 ); saveTabOrder( ts, 0 ); saveMetaInfoAfter( ts, 0 ); - saveIncludeHints( ts, 0 ); ts << "</UI>" << endl; bool ok = saveFormCode( formwindow->formFile(), langIface ); images.clear(); @@ -749,7 +765,7 @@ TQString Resource::copy() p = p->parentWidget(); } if ( save ) - saveObject( TQT_TQOBJECT(w), 0, ts, 0 ); + saveObject( w, 0, ts, 0 ); } if ( !MetaDataBase::customWidgets()->isEmpty() && !usedCustomWidgets.isEmpty() ) saveCustomWidgets( ts, 0 ); @@ -807,9 +823,9 @@ void Resource::paste( const TQString &cb, TQWidget *parent ) y = TQMAX( 0, parent->height() - w->height() ); if ( x != w->x() || y != w->y() ) w->move( x, y ); - formwindow->selectWidget( TQT_TQOBJECT(w) ); + formwindow->selectWidget( w ); } else if ( firstWidget.tagName() == "spacer" ) { - TQWidget *w = createSpacer( firstWidget, parent, 0, firstWidget.tagName() == "vspacer" ? Qt::Vertical : Qt::Horizontal ); + TQWidget *w = createSpacer( firstWidget, parent, 0, firstWidget.tagName() == "vspacer" ? TQt::Vertical : TQt::Horizontal ); if ( !w ) continue; widgets.append( w ); @@ -821,7 +837,7 @@ void Resource::paste( const TQString &cb, TQWidget *parent ) y = TQMAX( 0, parent->height() - w->height() ); if ( x != w->x() || y != w->y() ) w->move( x, y ); - formwindow->selectWidget( TQT_TQOBJECT(w) ); + formwindow->selectWidget( w ); } firstWidget = firstWidget.nextSibling().toElement(); } @@ -843,10 +859,29 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea if ( obj->isWidgetType() ) { if ( obj->isA("CustomWidget") || isPlugin ) { usedCustomWidgets << TQString( className ); - includeHints << WidgetDatabase::includeFile( classID ); + MetaDataBase::Include inc; + inc.location = "global"; + inc.implDecl = "in implementation"; + inc.header = WidgetDatabase::includeFile( classID ); + bool found = false; + TQValueList<MetaDataBase::Include> includes = MetaDataBase::includes( formwindow ); + TQValueList<MetaDataBase::Include>::Iterator it; + for ( it = includes.begin(); it != includes.end(); ++it ) { + MetaDataBase::Include currInc = *it; + if ( currInc.location == inc.location && currInc.implDecl == inc.implDecl && + currInc.header == inc.header) { + found = true; + break; + } + } + if ( !found ) + { + includes << inc; + } + MetaDataBase::setIncludes( formwindow, includes ); } - if ( TQT_BASE_OBJECT(obj) != TQT_BASE_OBJECT(formwindow) && !formwindow->widgets()->find( (TQWidget*)obj ) ) + if ( obj != formwindow && !formwindow->widgets()->find( (TQWidget*)obj ) ) return; // we don't know anything about this thing TQString attributes; @@ -879,9 +914,9 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea QDesignerWidgetStack* ws = 0; - if ( ::tqqt_cast<TQTabWidget*>(obj) ) { + if ( ::tqt_cast<TQTabWidget*>(obj) ) { TQTabWidget* tw = (TQTabWidget*) obj; - TQObjectList* tmpl = tw->queryList( TQWIDGETSTACK_OBJECT_NAME_STRING ); + TQObjectList* tmpl = tw->queryList( "TQWidgetStack" ); TQWidgetStack *ws = (TQWidgetStack*)tmpl->first(); TQTabBar *tb = ( (QDesignerTabWidget*)obj )->tabBar(); for ( int i = 0; i < tb->count(); ++i ) { @@ -891,7 +926,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea TQWidget *w = ws->widget( t->identifier() ); if ( !w ) continue; - if ( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(TQT_TQOBJECT(w)) ) == -1 ) + if ( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(w) ) == -1 ) continue; // we don't know this widget ts << makeIndent( indent ) << "<widget class=\"TQWidget\">" << endl; ++indent; @@ -906,17 +941,17 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea ts << makeIndent( indent ) << "<string>" << entitize( t->text() ) << "</string>" << endl; indent--; ts << makeIndent( indent ) << "</attribute>" << endl; - saveChildrenOf( TQT_TQOBJECT(w), ts, indent ); + saveChildrenOf( w, ts, indent ); --indent; ts << makeIndent( indent ) << "</widget>" << endl; } delete tmpl; - } else if ( (ws = ::tqqt_cast<QDesignerWidgetStack*>(obj)) != 0 ) { + } else if ( (ws = ::tqt_cast<QDesignerWidgetStack*>(obj)) != 0 ) { for ( int i = 0; i < ws->count(); ++i ) { TQWidget *w = ws->page( i ); if ( !w ) continue; - if ( WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(TQT_TQOBJECT(w))) == -1 ) + if ( WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(w)) == -1 ) continue; // we don't know this widget ts << makeIndent( indent ) << "<widget class=\"TQWidget\">" << endl; ++indent; @@ -930,17 +965,17 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea ts << makeIndent( indent ) << "<number>" << TQString::number(i) << "</number>" << endl; indent--; ts << makeIndent( indent ) << "</attribute>" << endl; - saveChildrenOf( TQT_TQOBJECT(w), ts, indent ); + saveChildrenOf( w, ts, indent ); --indent; ts << makeIndent( indent ) << "</widget>" << endl; } - } else if ( ::tqqt_cast<TQToolBox*>(obj) ) { + } else if ( ::tqt_cast<TQToolBox*>(obj) ) { TQToolBox* tb = (TQToolBox*)obj; for ( int i = 0; i < tb->count(); ++i ) { TQWidget *w = tb->item( i ); if ( !w ) continue; - if ( WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(TQT_TQOBJECT(w))) == -1 ) + if ( WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(w)) == -1 ) continue; // we don't know this widget ts << makeIndent( indent ) << "<widget class=\"TQWidget\">" << endl; ++indent; @@ -951,7 +986,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea ts << makeIndent( indent ) << "</property>" << endl; ts << makeIndent( indent ) << "<property name=\"backgroundMode\">" << endl; indent++; - saveEnumProperty( TQT_TQOBJECT(w), "backgroundMode", TQVariant::Invalid, ts, indent ); + saveEnumProperty( w, "backgroundMode", TQVariant::Invalid, ts, indent ); indent--; ts << makeIndent( indent ) << "</property>" << endl; ts << makeIndent( indent ) << "<attribute name=\"label\">" << endl; @@ -959,17 +994,17 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea ts << makeIndent( indent ) << "<string>" << entitize( tb->itemLabel( tb->indexOf(w) ) ) << "</string>" << endl; indent--; ts << makeIndent( indent ) << "</attribute>" << endl; - saveChildrenOf( TQT_TQOBJECT(w), ts, indent ); + saveChildrenOf( w, ts, indent ); --indent; ts << makeIndent( indent ) << "</widget>" << endl; } - } else if ( ::tqqt_cast<TQWizard*>(obj) ) { + } else if ( ::tqt_cast<TQWizard*>(obj) ) { TQWizard* wiz = (TQWizard*)obj; for ( int i = 0; i < wiz->pageCount(); ++i ) { TQWidget *w = wiz->page( i ); if ( !w ) continue; - if ( WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(TQT_TQOBJECT(w))) == -1 ) + if ( WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(w)) == -1 ) continue; // we don't know this widget ts << makeIndent( indent ) << "<widget class=\"TQWidget\">" << endl; ++indent; @@ -984,12 +1019,12 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea ts << makeIndent( indent ) << "<string>" << entitize( wiz->title( w ) ) << "</string>" << endl; indent--; ts << makeIndent( indent ) << "</attribute>" << endl; - saveChildrenOf( TQT_TQOBJECT(w), ts, indent ); + saveChildrenOf( w, ts, indent ); --indent; ts << makeIndent( indent ) << "</widget>" << endl; } - } else if ( ::tqqt_cast<TQMainWindow*>(obj) ) { - saveChildrenOf( TQT_TQOBJECT(( (TQMainWindow*)obj )->centralWidget()), ts, indent ); + } else if ( ::tqt_cast<TQMainWindow*>(obj) ) { + saveChildrenOf( ( (TQMainWindow*)obj )->centralWidget(), ts, indent ); } else { bool saved = FALSE; #ifdef TQT_CONTAINER_CUSTOM_WIDGETS @@ -1007,10 +1042,10 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea int i = 0; for ( TQWidget *w = containers.first(); w; w = containers.next(), ++i ) { if ( WidgetDatabase:: - idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) ) == -1 ) + idFromClassName( WidgetFactory::classNameOf( w ) ) == -1 ) continue; // we don't know this widget ts << makeIndent( indent ) << "<widget class=\"" - << WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) + << WidgetFactory::classNameOf( w ) << "\">" << endl; ++indent; ts << makeIndent( indent ) << "<property name=\"name\">" << endl; @@ -1036,7 +1071,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea TQWidget *w = iface2->containerOfWidget( className, (TQWidget*)obj ); if ( obj != w ) { ts << makeIndent( indent ) << "<widget class=\"" - << WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) + << WidgetFactory::classNameOf( w ) << "\">" << endl; ++indent; ts << makeIndent( indent ) << "<property name=\"name\">" << endl; @@ -1123,9 +1158,9 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent ) { - if ( ::tqqt_cast<TQListBox*>(obj) || ::tqqt_cast<TQComboBox*>(obj) ) { + if ( ::tqt_cast<TQListBox*>(obj) || ::tqt_cast<TQComboBox*>(obj) ) { TQListBox *lb = 0; - if ( ::tqqt_cast<TQListBox*>(obj) ) + if ( ::tqt_cast<TQListBox*>(obj) ) lb = (TQListBox*)obj; else lb = ( (TQComboBox*)obj )->listBox(); @@ -1143,7 +1178,7 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent ) indent--; ts << makeIndent( indent ) << "</item>" << endl; } - } else if ( ::tqqt_cast<TQIconView*>(obj) ) { + } else if ( ::tqt_cast<TQIconView*>(obj) ) { TQIconView *iv = (TQIconView*)obj; TQIconViewItem *i = iv->firstItem(); @@ -1159,7 +1194,7 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent ) indent--; ts << makeIndent( indent ) << "</item>" << endl; } - } else if ( ::tqqt_cast<TQListView*>(obj) ) { + } else if ( ::tqt_cast<TQListView*>(obj) ) { TQListView *lv = (TQListView*)obj; int i; for ( i = 0; i < lv->header()->count(); ++i ) { @@ -1185,15 +1220,18 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent ) indent--; ts << makeIndent( indent ) << "</column>" << endl; } - saveItem( lv->firstChild(), ts, indent - 1 ); + if (lv->firstChild()) + { + saveItem( lv->firstChild(), ts, indent - 1 ); + } } #if !defined (TQT_NO_TABLE) - else if ( ::tqqt_cast<TQTable*>(obj) ) { + else if ( ::tqt_cast<TQTable*>(obj) ) { TQTable *table = (TQTable*)obj; int i; - TQMap<TQString, TQString> columnFields = MetaDataBase::columnFields( TQT_TQOBJECT(table) ); + TQMap<TQString, TQString> columnFields = MetaDataBase::columnFields( table ); # ifndef TQT_NO_SQL - bool isDataTable = ::tqqt_cast<TQDataTable*>(table); + bool isDataTable = ::tqt_cast<TQDataTable*>(table); # else bool isDataTable = false; # endif @@ -1245,6 +1283,10 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent ) void Resource::saveItem( TQListViewItem *i, TQTextStream &ts, int indent ) { + if (!i) + { + return; + } TQListView *lv = i->listView(); while ( i ) { ts << makeIndent( indent ) << "<item>" << endl; @@ -1277,10 +1319,10 @@ void Resource::savePixmap( const TQPixmap &p, TQTextStream &ts, int indent, cons if ( formwindow && formwindow->savePixmapInline() ) ts << makeIndent( indent ) << "<" << tagname << ">" << saveInCollection( p ) << "</" << tagname << ">" << endl; else if ( formwindow && formwindow->savePixmapInProject() ) - ts << makeIndent( indent ) << "<" << tagname << ">" << MetaDataBase::pixmapKey( TQT_TQOBJECT(formwindow), p.serialNumber() ) + ts << makeIndent( indent ) << "<" << tagname << ">" << MetaDataBase::pixmapKey( formwindow, p.serialNumber() ) << "</" << tagname << ">" << endl; else - ts << makeIndent( indent ) << "<" << tagname << ">" << MetaDataBase::pixmapArgument( TQT_TQOBJECT(formwindow), p.serialNumber() ) + ts << makeIndent( indent ) << "<" << tagname << ">" << MetaDataBase::pixmapArgument( formwindow, p.serialNumber() ) << "</" << tagname << ">" << endl; } @@ -1292,7 +1334,7 @@ TQPixmap Resource::loadPixmap( const TQDomElement &e, const TQString &/*tagname* TQImage img = loadFromCollection( arg ); TQPixmap pix; pix.convertFromImage( img ); - MetaDataBase::setPixmapArgument( TQT_TQOBJECT(formwindow), pix.serialNumber(), arg ); + MetaDataBase::setPixmapArgument( formwindow, pix.serialNumber(), arg ); return pix; } else if ( formwindow && formwindow->savePixmapInProject() ) { TQPixmap pix; @@ -1304,13 +1346,13 @@ TQPixmap Resource::loadPixmap( const TQDomElement &e, const TQString &/*tagname* pix.convertFromImage( pix.convertToImage() ); } - MetaDataBase::setPixmapKey( TQT_TQOBJECT(formwindow), pix.serialNumber(), arg ); + MetaDataBase::setPixmapKey( formwindow, pix.serialNumber(), arg ); return pix; } TQPixmap pix = BarIcon( "designer_image.png", KDevDesignerPartFactory::instance() ); // we have to force the pixmap to get a new and unique serial number. Unfortunately detatch() doesn't do that pix.convertFromImage( pix.convertToImage() ); - MetaDataBase::setPixmapArgument( TQT_TQOBJECT(formwindow), pix.serialNumber(), arg ); + MetaDataBase::setPixmapArgument( formwindow, pix.serialNumber(), arg ); return pix; } @@ -1350,7 +1392,7 @@ void Resource::saveChildrenOf( TQObject* obj, TQTextStream &ts, int indent ) // if the widget has a layout we pretend that all widget's childs are childs of the layout - makes the structure nicer TQLayout *layout = 0; QDesignerGridLayout* grid = 0; - if ( !::tqqt_cast<TQSplitter*>(obj) && + if ( !::tqt_cast<TQSplitter*>(obj) && WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( obj ) ) ) && obj->isWidgetType() && WidgetFactory::layoutType( (TQWidget*)obj, layout ) != WidgetFactory::NoLayout ) { @@ -1378,7 +1420,7 @@ void Resource::saveChildrenOf( TQObject* obj, TQTextStream &ts, int indent ) // save properties of layout if ( lay != WidgetFactory::NoLayout ) - saveObjectProperties( TQT_TQOBJECT(layout), ts, indent ); + saveObjectProperties( layout, ts, indent ); } @@ -1398,28 +1440,28 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent ) TQStringList changed; changed = MetaDataBase::changedProperties( w ); if ( w->isWidgetType() ) { - if ( ::tqqt_cast<Spacer*>(w) ) { + if ( ::tqt_cast<Spacer*>(w) ) { if ( !changed.contains( "sizeHint" ) ) changed << "sizeHint"; if ( !changed.contains( "geometry" ) ) changed << "geometry"; } else { - TQToolButton *tb = ::tqqt_cast<TQToolButton*>(w); + TQToolButton *tb = ::tqt_cast<TQToolButton*>(w); if ( tb && !tb->iconSet().isNull() ) { changed << "iconSet"; } } - } else if ( ::tqqt_cast<TQLayout*>(w) ) { - if ( MetaDataBase::spacing( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) ) > -1 ) + } else if ( ::tqt_cast<TQLayout*>(w) ) { + if ( MetaDataBase::spacing( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) > -1 ) changed << "spacing"; - if ( MetaDataBase::margin( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) ) > -1 ) + if ( MetaDataBase::margin( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) > -1 ) changed << "margin"; - if ( MetaDataBase::resizeMode( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) ) != "Auto" - && !MetaDataBase::resizeMode( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) ).isEmpty() ) + if ( MetaDataBase::resizeMode( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) != "Auto" + && !MetaDataBase::resizeMode( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ).isEmpty() ) changed << "resizeMode"; } - if ( TQT_BASE_OBJECT(w) == TQT_BASE_OBJECT(formwindow->mainContainer()) ) { + if ( w == formwindow->mainContainer() ) { if ( changed.findIndex( "geometry" ) == -1 ) changed << "geometry"; if ( changed.findIndex( "caption" ) == -1 ) @@ -1429,10 +1471,10 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent ) if ( changed.isEmpty() ) return; - bool inLayout = TQT_BASE_OBJECT(w) != TQT_BASE_OBJECT(formwindow->mainContainer()) && !copying && w->isWidgetType() && ( (TQWidget*)w )->parentWidget() && + bool inLayout = w != formwindow->mainContainer() && !copying && w->isWidgetType() && ( (TQWidget*)w )->parentWidget() && WidgetFactory::layoutType( ( (TQWidget*)w )->parentWidget() ) != WidgetFactory::NoLayout; - TQStrList lst = w->metaObject()->propertyNames( !::tqqt_cast<Spacer*>(w) ); + TQStrList lst = w->metaObject()->propertyNames( !::tqt_cast<Spacer*>(w) ); for ( TQPtrListIterator<char> it( lst ); it.current(); ++it ) { if ( changed.find( TQString::fromLatin1( it.current() ) ) == changed.end() ) continue; @@ -1443,10 +1485,10 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent ) property( w->metaObject()->findProperty( it.current(), TRUE ), TRUE ); if ( !p || !p->stored( w ) || ( inLayout && qstrcmp( p->name(), "geometry" ) == 0 ) ) continue; - if ( ::tqqt_cast<TQLabel*>(w) && qstrcmp( p->name(), "pixmap" ) == 0 && + if ( ::tqt_cast<TQLabel*>(w) && qstrcmp( p->name(), "pixmap" ) == 0 && ( !( (TQLabel*)w )->pixmap() || ( (TQLabel*)w )->pixmap()->isNull() ) ) continue; - if ( ::tqqt_cast<MenuBarEditor*>(w) && + if ( ::tqt_cast<MenuBarEditor*>(w) && ( qstrcmp( p->name(), "itemName" ) == 0 || qstrcmp( p->name(), "itemNumber" ) == 0 || qstrcmp( p->name(), "itemText" ) == 0 ) ) continue; @@ -1460,7 +1502,7 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent ) ts << " stdset=\"0\""; ts << ">" << endl; indent++; - if ( strcmp( it.current(), "resizeMode" ) == 0 && ::tqqt_cast<TQLayout*>(w) ) { + if ( strcmp( it.current(), "resizeMode" ) == 0 && ::tqt_cast<TQLayout*>(w) ) { saveProperty( w, it.current(), "", TQVariant::String, ts, indent ); } else if ( p->isSetType() ) { saveSetProperty( w, it.current(), TQVariant::nameToType( p->type() ), ts, indent ); @@ -1527,7 +1569,7 @@ void Resource::saveProperty( TQObject *w, const TQString &name, const TQVariant switch ( t ) { case TQVariant::String: if ( name == "resizeMode" ) { - TQString resmod = MetaDataBase::resizeMode( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) ); + TQString resmod = MetaDataBase::resizeMode( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ); if ( !resmod.isNull() && resmod != "Auto" ) { ts << makeIndent( indent ) << "<enum>"; ts << resmod; @@ -1547,12 +1589,12 @@ void Resource::saveProperty( TQObject *w, const TQString &name, const TQVariant ts << makeIndent( indent ) << "<bool>" << mkBool( value.toBool() ) << "</bool>" << endl; break; case TQVariant::Int: - if ( ::tqqt_cast<TQLayout*>(w) ) { + if ( ::tqt_cast<TQLayout*>(w) ) { num = -1; if ( name == "spacing" ) - num = MetaDataBase::spacing( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) ); + num = MetaDataBase::spacing( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ); else if ( name == "margin" ) - num = MetaDataBase::margin( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) ); + num = MetaDataBase::margin( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ); if ( num != -1 ) ts << makeIndent( indent ) << "<number>" << TQString::number( num ) << "</number>" << endl; } else { @@ -1772,7 +1814,7 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay if ( colspan < 1 ) colspan = 1; - TQString className = e.attribute( "class", TQWIDGET_OBJECT_NAME_STRING ); + TQString className = e.attribute( "class", "TQWidget" ); #ifdef TQT_CONTAINER_CUSTOM_WIDGETS TQString parentClassName = WidgetFactory::classNameOf( parent ); bool isPlugin = @@ -1782,7 +1824,7 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay // ### TODO loading for custom container widgets without pages #endif if ( !className.isNull() ) { - obj = TQT_TQOBJECT(WidgetFactory::create( WidgetDatabase::idFromClassName( className ), parent, 0, FALSE )); + obj = WidgetFactory::create( WidgetDatabase::idFromClassName( className ), parent, 0, FALSE ); if ( !obj ) { TQMessageBox::critical( MainWindow::self, i18n( "Loading File" ), i18n( "Error loading %1.\n" @@ -1796,7 +1838,7 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay mainContainerSet = TRUE; } w = (TQWidget*)obj; - if ( ::tqqt_cast<TQMainWindow*>(w) ) + if ( ::tqt_cast<TQMainWindow*>(w) ) w = ( (TQMainWindow*)w )->centralWidget(); if ( layout ) { switch ( WidgetFactory::layoutType( layout ) ) { @@ -1821,25 +1863,25 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay if ( w && formwindow ) { if ( !parent || - ( !::tqqt_cast<TQTabWidget*>(parent) && - !::tqqt_cast<TQWidgetStack*>(parent) && - !::tqqt_cast<TQToolBox*>(parent) && - !::tqqt_cast<TQWizard*>(parent) + ( !::tqt_cast<TQTabWidget*>(parent) && + !::tqt_cast<TQWidgetStack*>(parent) && + !::tqt_cast<TQToolBox*>(parent) && + !::tqt_cast<TQWizard*>(parent) #ifdef TQT_CONTAINER_CUSTOM_WIDGETS && !isPlugin #endif ) ) formwindow->insertWidget( w, pasting ); else if ( parent && - ( ::tqqt_cast<TQTabWidget*>(parent) || - ::tqqt_cast<TQWidgetStack*>(parent) || - ::tqqt_cast<TQToolBox*>(parent) || - ::tqqt_cast<TQWizard*>(parent) + ( ::tqt_cast<TQTabWidget*>(parent) || + ::tqt_cast<TQWidgetStack*>(parent) || + ::tqt_cast<TQToolBox*>(parent) || + ::tqt_cast<TQWizard*>(parent) #ifdef TQT_CONTAINER_CUSTOM_WIDGETS || isPlugin #endif ) ) - MetaDataBase::addEntry( TQT_TQOBJECT(w) ); + MetaDataBase::addEntry( w ); } } @@ -1848,22 +1890,22 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay while ( !n.isNull() ) { if ( n.tagName() == "spacer" ) { - createSpacer( n, w, layout, Qt::Horizontal ); + createSpacer( n, w, layout, TQt::Horizontal ); } else if ( n.tagName() == "widget" ) { createObject( n, w, layout ); } else if ( n.tagName() == "hbox" ) { layout = WidgetFactory::createLayout( w, layout, WidgetFactory::HBox ); - obj = TQT_TQOBJECT(layout); + obj = layout; n = n.firstChild().toElement(); continue; } else if ( n.tagName() == "grid" ) { layout = WidgetFactory::createLayout( w, layout, WidgetFactory::Grid ); - obj = TQT_TQOBJECT(layout); + obj = layout; n = n.firstChild().toElement(); continue; } else if ( n.tagName() == "vbox" ) { layout = WidgetFactory::createLayout( w, layout, WidgetFactory::VBox ); - obj = TQT_TQOBJECT(layout); + obj = layout; n = n.firstChild().toElement(); continue; } else if ( n.tagName() == "property" && obj ) { @@ -1877,16 +1919,16 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay } else if ( n.tagName() == "attribute" && w ) { TQString attrib = n.attribute( "name" ); TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); - if ( ::tqqt_cast<TQTabWidget*>(parent) ) { + if ( ::tqt_cast<TQTabWidget*>(parent) ) { if ( attrib == "title" ) ( (TQTabWidget*)parent )->insertTab( w, v.toString() ); - } else if ( ::tqqt_cast<TQWidgetStack*>(parent) ) { + } else if ( ::tqt_cast<TQWidgetStack*>(parent) ) { if ( attrib == "id" ) ( (QDesignerWidgetStack*)parent )->insertPage( w, v.toInt() ); - } else if ( ::tqqt_cast<TQToolBox*>(parent) ) { + } else if ( ::tqt_cast<TQToolBox*>(parent) ) { if ( attrib == "label" ) ( (TQToolBox*)parent )->addItem( w, v.toString() ); - } else if ( ::tqqt_cast<TQWizard*>(parent) ) { + } else if ( ::tqt_cast<TQWizard*>(parent) ) { if ( attrib == "title" ) ( (TQWizard*)parent )->addPage( w, v.toString() ); #ifdef TQT_CONTAINER_CUSTOM_WIDGETS @@ -1926,7 +1968,7 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay if ( w->isWidgetType() ) widgets.insert( w->name(), w ); - return TQT_TQOBJECT(w); + return w; } void Resource::createColumn( const TQDomElement &e, TQWidget *widget ) @@ -1934,7 +1976,7 @@ void Resource::createColumn( const TQDomElement &e, TQWidget *widget ) if ( !widget ) return; - if ( ::tqqt_cast<TQListView*>(widget) && e.tagName() == "column" ) { + if ( ::tqt_cast<TQListView*>(widget) && e.tagName() == "column" ) { TQListView *lv = (TQListView*)widget; TQDomElement n = e.firstChild().toElement(); TQPixmap pix; @@ -1968,7 +2010,7 @@ void Resource::createColumn( const TQDomElement &e, TQWidget *widget ) lv->header()->setResizeEnabled( resizable, i ); } #ifndef TQT_NO_TABLE - else if ( ::tqqt_cast<TQTable*>(widget) ) { + else if ( ::tqt_cast<TQTable*>(widget) ) { TQTable *table = (TQTable*)widget; bool isRow; if ( ( isRow = e.tagName() == "row" ) ) @@ -1981,7 +2023,7 @@ void Resource::createColumn( const TQDomElement &e, TQWidget *widget ) bool hasPixmap = FALSE; TQString txt; TQString field; - TQMap<TQString, TQString> fieldMap = MetaDataBase::columnFields( TQT_TQOBJECT(table) ); + TQMap<TQString, TQString> fieldMap = MetaDataBase::columnFields( table ); while ( !n.isNull() ) { if ( n.tagName() == "property" ) { TQString attrib = n.attribute( "name" ); @@ -2006,7 +2048,7 @@ void Resource::createColumn( const TQDomElement &e, TQWidget *widget ) h->setLabel( i, txt ); if ( !isRow && !field.isEmpty() ) fieldMap.insert( txt, field ); - MetaDataBase::setColumnFields( TQT_TQOBJECT(table), fieldMap ); + MetaDataBase::setColumnFields( table, fieldMap ); } #endif } @@ -2032,17 +2074,17 @@ void Resource::loadItem( const TQDomElement &e, TQPixmap &pix, TQString &txt, bo void Resource::createItem( const TQDomElement &e, TQWidget *widget, TQListViewItem *i ) { - if ( !widget || !WidgetFactory::hasItems( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(widget) ) ), TQT_TQOBJECT(widget) ) ) + if ( !widget || !WidgetFactory::hasItems( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( widget ) ), widget ) ) return; - if ( ::tqqt_cast<TQListBox*>(widget) || ::tqqt_cast<TQComboBox*>(widget) ) { + if ( ::tqt_cast<TQListBox*>(widget) || ::tqt_cast<TQComboBox*>(widget) ) { TQDomElement n = e.firstChild().toElement(); TQPixmap pix; bool hasPixmap = FALSE; TQString txt; loadItem( n, pix, txt, hasPixmap ); TQListBox *lb = 0; - if ( ::tqqt_cast<TQListBox*>(widget) ) + if ( ::tqt_cast<TQListBox*>(widget) ) lb = (TQListBox*)widget; else lb = ( (TQComboBox*)widget)->listBox(); @@ -2051,7 +2093,7 @@ void Resource::createItem( const TQDomElement &e, TQWidget *widget, TQListViewIt } else { new TQListBoxText( lb, txt ); } - } else if ( ::tqqt_cast<TQIconView*>(widget) ) { + } else if ( ::tqt_cast<TQIconView*>(widget) ) { TQDomElement n = e.firstChild().toElement(); TQPixmap pix; bool hasPixmap = FALSE; @@ -2062,7 +2104,7 @@ void Resource::createItem( const TQDomElement &e, TQWidget *widget, TQListViewIt new TQIconViewItem( iv, txt, pix ); else new TQIconViewItem( iv, txt ); - } else if ( ::tqqt_cast<TQListView*>(widget) ) { + } else if ( ::tqt_cast<TQListView*>(widget) ) { TQDomElement n = e.firstChild().toElement(); TQPixmap pix; TQValueList<TQPixmap> pixmaps; @@ -2104,7 +2146,7 @@ void Resource::createItem( const TQDomElement &e, TQWidget *widget, TQListViewIt } } -TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *parent, TQLayout *layout, Qt::Orientation o ) +TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *parent, TQLayout *layout, TQt::Orientation o ) { TQDomElement n = e.firstChild().toElement(); int row = e.attribute( "row" ).toInt(); @@ -2122,14 +2164,14 @@ TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *parent, TQLay spacer->setInteraciveMode( FALSE ); while ( !n.isNull() ) { if ( n.tagName() == "property" ) - setObjectProperty( TQT_TQOBJECT(spacer), n.attribute( "name" ), n.firstChild().toElement() ); + setObjectProperty( spacer, n.attribute( "name" ), n.firstChild().toElement() ); n = n.nextSibling().toElement(); } spacer->setInteraciveMode( TRUE ); if ( formwindow ) formwindow->insertWidget( spacer, pasting ); if ( layout ) { - if ( ::tqqt_cast<TQBoxLayout*>(layout) ) + if ( ::tqt_cast<TQBoxLayout*>(layout) ) ( (TQBoxLayout*)layout )->addWidget( spacer, 0, spacer->alignment() ); else ( (QDesignerGridLayout*)layout )->addMultiCellWidget( spacer, row, row + rowspan - 1, col, col + colspan - 1, @@ -2145,7 +2187,7 @@ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQD { const TQMetaProperty *p = obj->metaObject()->property( obj->metaObject()->findProperty( prop, TRUE ), TRUE ); - if ( !::tqqt_cast<TQLayout*>(obj) ) {// no layouts in metadatabase... (RS) + if ( !::tqt_cast<TQLayout*>(obj) ) {// no layouts in metadatabase... (RS) if ( obj->inherits( "CustomWidget" ) ) { MetaDataBase::CustomWidget *cw = ( (CustomWidget*)obj )->customWidget(); if ( cw && !cw->hasProperty( prop.latin1() ) && !p && prop != "toolTip" && prop != "whatsThis" ) @@ -2187,7 +2229,7 @@ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQD if ( !p ) { MetaDataBase::setFakeProperty( obj, prop, v ); if ( obj->isWidgetType() ) { - if ( prop == "database" && TQT_TQOBJECT(obj) != TQT_TQOBJECT(toplevel) ) { + if ( prop == "database" && obj != toplevel ) { TQStringList lst = MetaDataBase::fakeProperty( obj, "database" ).toStringList(); if ( lst.count() > 2 ) dbControls.insert( obj->name(), lst[ 2 ] ); @@ -2241,32 +2283,32 @@ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQD } if ( prop == "icon" ) { formwindow->setIcon( v.toPixmap() ); - TQString pmk = MetaDataBase::pixmapKey( TQT_TQOBJECT(formwindow), v.toPixmap().serialNumber() ); - MetaDataBase::setPixmapKey( TQT_TQOBJECT(formwindow), + TQString pmk = MetaDataBase::pixmapKey( formwindow, v.toPixmap().serialNumber() ); + MetaDataBase::setPixmapKey( formwindow, formwindow->icon()->serialNumber(), pmk ); } if ( prop == "geometry" ) { - if ( TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(toplevel) ) { + if ( obj == toplevel ) { hadGeometry = TRUE; toplevel->resize( v.toRect().size() ); return; - } else if ( TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(formwindow->mainContainer()) ) { + } else if ( obj == formwindow->mainContainer() ) { hadGeometry = TRUE; formwindow->resize( v.toRect().size() ); return; } } - if ( ::tqqt_cast<TQLayout*>(obj) ) { + if ( ::tqt_cast<TQLayout*>(obj) ) { if ( prop == "spacing" ) { - MetaDataBase::setSpacing( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(obj) ) ) ), v.toInt() ); + MetaDataBase::setSpacing( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(obj) ) ) , v.toInt() ); return; } else if ( prop == "margin" ) { - MetaDataBase::setMargin( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(obj) ) ) ), v.toInt() ); + MetaDataBase::setMargin( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(obj) ) ) , v.toInt() ); return; } else if ( e.tagName() == "enum" && prop == "resizeMode" ) { - MetaDataBase::setResizeMode( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(obj) ) ) ), v.toString() ); + MetaDataBase::setResizeMode( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(obj) ) ) , v.toString() ); return; } } @@ -2274,10 +2316,10 @@ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQD if ( prop == "name" ) { if ( pasting ) { TQString s = v.toString(); - formwindow->unify( TQT_TQOBJECT(obj), s, TRUE ); + formwindow->unify( obj, s, TRUE ); obj->setName( s ); return; - } else if ( formwindow && TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(formwindow->mainContainer()) ) { + } else if ( formwindow && obj == formwindow->mainContainer() ) { formwindow->setName( v.toCString() ); } } @@ -2443,7 +2485,7 @@ TQImage Resource::loadFromCollection( const TQString &name ) void Resource::saveConnections( TQTextStream &ts, int indent ) { - TQValueList<MetaDataBase::Connection> connections = MetaDataBase::connections( TQT_TQOBJECT(formwindow) ); + TQValueList<MetaDataBase::Connection> connections = MetaDataBase::connections( formwindow ); if ( connections.isEmpty() ) return; ts << makeIndent( indent ) << "<connections>" << endl; @@ -2456,8 +2498,8 @@ void Resource::saveConnections( TQTextStream &ts, int indent ) ( knownNames.findIndex( TQString( conn.receiver->name() ) ) == -1 && qstrcmp( conn.receiver->name(), "this" ) != 0 ) ) continue; - if ( formwindow->isMainContainer( TQT_TQOBJECT((*it).receiver) ) && - !MetaDataBase::hasSlot( TQT_TQOBJECT(formwindow), MetaDataBase::normalizeFunction( (*it).slot ).latin1() ) ) + if ( formwindow->isMainContainer( (*it).receiver ) && + !MetaDataBase::hasSlot( formwindow, MetaDataBase::normalizeFunction( (*it).slot ).latin1() ) ) continue; if ( conn.sender->inherits( "CustomWidget" ) ) { @@ -2500,7 +2542,7 @@ void Resource::loadConnections( const TQDomElement &e ) conn.sender = 0; TQString name = n2.firstChild().toText().data(); if ( name == "this" || qstrcmp( toplevel->name(), name ) == 0 ) { - conn.sender = TQT_TQOBJECT(toplevel); + conn.sender = toplevel; } else { if ( name == "this" ) name = toplevel->name(); @@ -2520,7 +2562,7 @@ void Resource::loadConnections( const TQDomElement &e ) conn.receiver = 0; TQString name = n2.firstChild().toText().data(); if ( name == "this" || qstrcmp( toplevel->name(), name ) == 0 ) { - conn.receiver = TQT_TQOBJECT(toplevel); + conn.receiver = toplevel; } else { TQObjectList *l = toplevel->queryList( 0, name, FALSE ); if ( l ) { @@ -2538,14 +2580,14 @@ void Resource::loadConnections( const TQDomElement &e ) n2 = n2.nextSibling().toElement(); } if ( formwindow ) { - if ( TQT_BASE_OBJECT(conn.sender) == TQT_BASE_OBJECT(formwindow) ) - conn.sender = TQT_TQOBJECT(formwindow->mainContainer()); - if ( TQT_BASE_OBJECT(conn.receiver) == TQT_BASE_OBJECT(formwindow) ) - conn.receiver = TQT_TQOBJECT(formwindow->mainContainer()); + if ( conn.sender == formwindow ) + conn.sender = formwindow->mainContainer(); + if ( conn.receiver == formwindow ) + conn.receiver = formwindow->mainContainer(); } if ( conn.sender && conn.receiver ) { if ( lang == "C++" ) { - MetaDataBase::addConnection( TQT_TQOBJECT(formwindow ? formwindow : toplevel), + MetaDataBase::addConnection( formwindow ? formwindow : toplevel, conn.sender, conn.signal, conn.receiver, conn.slot ); } } @@ -2562,11 +2604,11 @@ void Resource::loadConnections( const TQDomElement &e ) if ( slot.returnType.isEmpty() ) slot.returnType = "void"; slot.function = n.firstChild().toText().data(); - if ( !MetaDataBase::hasFunction( TQT_TQOBJECT(formwindow), slot.function, TRUE ) ) - MetaDataBase::addFunction( TQT_TQOBJECT(formwindow), slot.function, slot.specifier, + if ( !MetaDataBase::hasFunction( formwindow, slot.function, TRUE ) ) + MetaDataBase::addFunction( formwindow, slot.function, slot.specifier, slot.access, "slot", slot.language, slot.returnType ); else - MetaDataBase::changeFunctionAttributes( TQT_TQOBJECT(formwindow), slot.function, slot.function, + MetaDataBase::changeFunctionAttributes( formwindow, slot.function, slot.function, slot.specifier, slot.access, "slot", slot.language, slot.returnType ); } @@ -2756,7 +2798,7 @@ void Resource::loadTabOrder( const TQDomElement &e ) void Resource::saveMetaInfoBefore( TQTextStream &ts, int indent ) { - MetaDataBase::MetaInfo info = MetaDataBase::metaInfo( TQT_TQOBJECT(formwindow) ); + MetaDataBase::MetaInfo info = MetaDataBase::metaInfo( formwindow ); TQString cn; if ( info.classNameChanged && !info.className.isEmpty() ) cn = info.className; @@ -2771,9 +2813,9 @@ void Resource::saveMetaInfoBefore( TQTextStream &ts, int indent ) void Resource::saveMetaInfoAfter( TQTextStream &ts, int indent ) { - MetaDataBase::MetaInfo info = MetaDataBase::metaInfo( TQT_TQOBJECT(formwindow) ); + MetaDataBase::MetaInfo info = MetaDataBase::metaInfo( formwindow ); if ( !langIface || formwindow->project()->isCpp() ) { - TQValueList<MetaDataBase::Include> includes = MetaDataBase::includes( TQT_TQOBJECT(formwindow) ); + TQValueList<MetaDataBase::Include> includes = MetaDataBase::includes( formwindow ); TQString extensionInclude; bool needExtensionInclude = FALSE; if ( langIface && @@ -2800,7 +2842,7 @@ void Resource::saveMetaInfoAfter( TQTextStream &ts, int indent ) ts << makeIndent( indent ) << "</includes>" << endl; } - TQStringList forwards = MetaDataBase::forwards( TQT_TQOBJECT(formwindow) ); + TQStringList forwards = MetaDataBase::forwards( formwindow ); if ( !forwards.isEmpty() ) { ts << makeIndent( indent ) << "<forwards>" << endl; indent++; @@ -2809,7 +2851,7 @@ void Resource::saveMetaInfoAfter( TQTextStream &ts, int indent ) indent--; ts << makeIndent( indent ) << "</forwards>" << endl; } - TQValueList<MetaDataBase::Variable> varLst = MetaDataBase::variables( TQT_TQOBJECT(formwindow) ); + TQValueList<MetaDataBase::Variable> varLst = MetaDataBase::variables( formwindow ); if ( !varLst.isEmpty() ) { ts << makeIndent( indent ) << "<variables>" << endl; indent++; @@ -2825,7 +2867,7 @@ void Resource::saveMetaInfoAfter( TQTextStream &ts, int indent ) indent--; ts << makeIndent( indent ) << "</variables>" << endl; } - TQStringList sigs = MetaDataBase::signalList( TQT_TQOBJECT(formwindow) ); + TQStringList sigs = MetaDataBase::signalList( formwindow ); if ( !sigs.isEmpty() ) { ts << makeIndent( indent ) << "<signals>" << endl; indent++; @@ -2835,7 +2877,7 @@ void Resource::saveMetaInfoAfter( TQTextStream &ts, int indent ) ts << makeIndent( indent ) << "</signals>" << endl; } - TQValueList<MetaDataBase::Function> slotList = MetaDataBase::slotList( TQT_TQOBJECT(formwindow) ); + TQValueList<MetaDataBase::Function> slotList = MetaDataBase::slotList( formwindow ); if ( !slotList.isEmpty() ) { ts << makeIndent( indent ) << "<slots>" << endl; indent++; @@ -2858,7 +2900,7 @@ void Resource::saveMetaInfoAfter( TQTextStream &ts, int indent ) ts << makeIndent( indent ) << "</slots>" << endl; } - TQValueList<MetaDataBase::Function> functionList = MetaDataBase::functionList( TQT_TQOBJECT(formwindow), TRUE ); + TQValueList<MetaDataBase::Function> functionList = MetaDataBase::functionList( formwindow, TRUE ); if ( !functionList.isEmpty() ) { ts << makeIndent( indent ) << "<functions>" << endl; indent++; @@ -2888,7 +2930,7 @@ void Resource::saveMetaInfoAfter( TQTextStream &ts, int indent ) ts << makeIndent( indent ) << "<pixmapinproject/>" << endl; else ts << makeIndent( indent ) << "<pixmapfunction>" << formwindow->pixmapLoaderFunction() << "</pixmapfunction>" << endl; - if ( !( exportMacro = MetaDataBase::exportMacro( TQT_TQOBJECT(formwindow->mainContainer()) ) ).isEmpty() ) + if ( !( exportMacro = MetaDataBase::exportMacro( formwindow->mainContainer() ) ).isEmpty() ) ts << makeIndent( indent ) << "<exportmacro>" << exportMacro << "</exportmacro>" << endl; if ( formwindow ) { ts << makeIndent( indent ) << "<layoutdefaults spacing=\"" << formwindow->layoutDefaultSpacing() @@ -2905,18 +2947,6 @@ void Resource::saveMetaInfoAfter( TQTextStream &ts, int indent ) } } -void Resource::saveIncludeHints( TQTextStream &ts, int indent ) -{ - if ( includeHints.isEmpty() ) - return; - ts << makeIndent( indent ) << "<includehints>" << endl; - indent++; - for ( TQStringList::Iterator it = includeHints.begin(); it != includeHints.end(); ++it ) - ts << makeIndent( indent ) << "<includehint>" << *it << "</includehint>" << endl; - indent--; - ts << makeIndent( indent ) << "</includehints>" << endl; -} - TQColorGroup Resource::loadColorGroup( const TQDomElement &e ) { TQColorGroup cg; @@ -2945,10 +2975,10 @@ void Resource::saveChildActions( TQAction *a, TQTextStream &ts, int indent ) while ( it.current() ) { TQObject *o = it.current(); ++it; - if ( !::tqqt_cast<TQAction*>(o) ) + if ( !::tqt_cast<TQAction*>(o) ) continue; TQAction *ac = (TQAction*)o; - bool isGroup = ::tqqt_cast<TQActionGroup*>(ac); + bool isGroup = ::tqt_cast<TQActionGroup*>(ac); if ( isGroup ) ts << makeIndent( indent ) << "<actiongroup>" << endl; else @@ -2977,7 +3007,7 @@ void Resource::saveActions( const TQPtrList<TQAction> &actions, TQTextStream &ts TQPtrListIterator<TQAction> it( actions ); while ( it.current() ) { TQAction *a = it.current(); - bool isGroup = ::tqqt_cast<TQActionGroup*>(a); + bool isGroup = ::tqt_cast<TQActionGroup*>(a); if ( isGroup ) ts << makeIndent( indent ) << "<actiongroup>" << endl; else @@ -3022,7 +3052,7 @@ void Resource::loadChildAction( TQObject *parent, const TQDomElement &e ) } n2 = n2.nextSibling().toElement(); } - if ( !::tqqt_cast<TQAction*>(parent) ) + if ( !::tqt_cast<TQAction*>(parent) ) formwindow->actionList().append( a ); } else if ( n.tagName() == "actiongroup" ) { a = new QDesignerActionGroup( parent ); @@ -3045,7 +3075,7 @@ void Resource::loadChildAction( TQObject *parent, const TQDomElement &e ) } n2 = n2.nextSibling().toElement(); } - if ( !::tqqt_cast<TQAction*>(parent) ) + if ( !::tqt_cast<TQAction*>(parent) ) formwindow->actionList().append( a ); } } @@ -3055,9 +3085,9 @@ void Resource::loadActions( const TQDomElement &e ) TQDomElement n = e.firstChild().toElement(); while ( !n.isNull() ) { if ( n.tagName() == "action" ) { - loadChildAction( TQT_TQOBJECT(formwindow), n ); + loadChildAction( formwindow, n ); } else if ( n.tagName() == "actiongroup" ) { - loadChildAction( TQT_TQOBJECT(formwindow), n ); + loadChildAction( formwindow, n ); } n = n.nextSibling().toElement(); } @@ -3078,23 +3108,23 @@ void Resource::saveToolBars( TQMainWindow *mw, TQTextStream &ts, int indent ) continue; ts << makeIndent( indent ) << "<toolbar dock=\"" << i << "\">" << endl; indent++; - saveObjectProperties( TQT_TQOBJECT(tb), ts, indent ); + saveObjectProperties( tb, ts, indent ); TQPtrList<TQAction> actionList = ( (QDesignerToolBar*)tb )->insertedActions(); for ( TQAction *a = actionList.first(); a; a = actionList.next() ) { - if ( ::tqqt_cast<QSeparatorAction*>(a) ) { + if ( ::tqt_cast<QSeparatorAction*>(a) ) { ts << makeIndent( indent ) << "<separator/>" << endl; } else { - if ( ::tqqt_cast<QDesignerAction*>(a) && !( (QDesignerAction*)a )->supportsMenu() ) { + if ( ::tqt_cast<QDesignerAction*>(a) && !( (QDesignerAction*)a )->supportsMenu() ) { TQWidget *w = ( (QDesignerAction*)a )->widget(); ts << makeIndent( indent ) << "<widget class=\"" - << WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) << "\">" << endl; + << WidgetFactory::classNameOf( w ) << "\">" << endl; indent++; - const char *className = WidgetFactory::classNameOf( TQT_TQOBJECT(w) ); + const char *className = WidgetFactory::classNameOf( w ); if ( w->isA( "CustomWidget" ) ) usedCustomWidgets << TQString( className ); - if ( WidgetFactory::hasItems( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) ), TQT_TQOBJECT(w) ) ) - saveItems( TQT_TQOBJECT(w), ts, indent ); - saveObjectProperties( TQT_TQOBJECT(w), ts, indent ); + if ( WidgetFactory::hasItems( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ), w ) ) + saveItems( w, ts, indent ); + saveObjectProperties( w, ts, indent ); indent--; ts << makeIndent( indent ) << "</widget>" << endl; } else { @@ -3117,8 +3147,8 @@ void Resource::saveMenuBar( TQMainWindow *mw, TQTextStream &ts, int indent ) return; ts << makeIndent( indent ) << "<menubar>" << endl; indent++; - MetaDataBase::setPropertyChanged( TQT_TQOBJECT(mb), "name", TRUE ); // FIXME: remove - saveObjectProperties( TQT_TQOBJECT(mb), ts, indent ); + MetaDataBase::setPropertyChanged( mb, "name", TRUE ); // FIXME: remove + saveObjectProperties( mb, ts, indent ); for ( int i = 0; i < (int)mb->count(); ++i ) { MenuBarEditorItem *m = mb->item( i ); @@ -3143,11 +3173,11 @@ void Resource::savePopupMenu( PopupMenuEditor *pm, TQMainWindow *mw, TQTextStrea { for ( PopupMenuEditorItem *i = pm->items()->first(); i; i = pm->items()->next() ) { TQAction *a = i->action(); - if ( ::tqqt_cast<QSeparatorAction*>(a) ) + if ( ::tqt_cast<QSeparatorAction*>(a) ) ts << makeIndent( indent ) << "<separator/>" << endl; - else if ( ::tqqt_cast<QDesignerAction*>(a) ) + else if ( ::tqt_cast<QDesignerAction*>(a) ) ts << makeIndent( indent ) << "<action name=\"" << a->name() << "\"/>" << endl; - else if ( ::tqqt_cast<QDesignerActionGroup*>(a) ) + else if ( ::tqt_cast<QDesignerActionGroup*>(a) ) ts << makeIndent( indent ) << "<actiongroup name=\"" << a->name() << "\"/>" << endl; PopupMenuEditor *s = i->subMenu(); if ( s && s->count() ) { @@ -3187,12 +3217,12 @@ void Resource::loadToolBars( const TQDomElement &e ) tb->addAction( a ); } else if ( n2.tagName() == "widget" ) { TQWidget *w = (TQWidget*)createObject( n2, tb ); - QDesignerAction *a = new QDesignerAction( w, TQT_TQOBJECT(tb) ); + QDesignerAction *a = new QDesignerAction( w, tb ); a->addTo( tb ); tb->addAction( a ); tb->installEventFilters( w ); } else if ( n2.tagName() == "property" ) { - setObjectProperty( TQT_TQOBJECT(tb), n2.attribute( "name" ), n2.firstChild().toElement() ); + setObjectProperty( tb, n2.attribute( "name" ), n2.firstChild().toElement() ); } n2 = n2.nextSibling().toElement(); } @@ -3206,16 +3236,16 @@ void Resource::loadMenuBar( const TQDomElement &e ) TQDomElement n = e.firstChild().toElement(); TQMainWindow *mw = (TQMainWindow*)formwindow->mainContainer(); MenuBarEditor *mb = new MenuBarEditor( formwindow, mw ); - MetaDataBase::addEntry( TQT_TQOBJECT(mb) ); + MetaDataBase::addEntry( mb ); while ( !n.isNull() ) { if ( n.tagName() == "item" ) { PopupMenuEditor * popup = new PopupMenuEditor( formwindow, mw ); loadPopupMenu( popup, n ); popup->setName( n.attribute( "name" ) ); mb->insertItem( n.attribute( "text" ), popup ); - MetaDataBase::addEntry( TQT_TQOBJECT(popup) ); + MetaDataBase::addEntry( popup ); } else if ( n.tagName() == "property" ) { - setObjectProperty( TQT_TQOBJECT(mb), n.attribute( "name" ), n.firstChild().toElement() ); + setObjectProperty( mb, n.attribute( "name" ), n.firstChild().toElement() ); } else if ( n.tagName() == "separator" ) { mb->insertSeparator(); } @@ -3225,7 +3255,7 @@ void Resource::loadMenuBar( const TQDomElement &e ) void Resource::loadPopupMenu( PopupMenuEditor *p, const TQDomElement &e ) { - MetaDataBase::addEntry( TQT_TQOBJECT(p) ); + MetaDataBase::addEntry( p ); TQDomElement n = e.firstChild().toElement(); TQAction *a = 0; while ( !n.isNull() ) { |