diff options
Diffstat (limited to 'kdevdesigner/designer/resource.cpp')
-rw-r--r-- | kdevdesigner/designer/resource.cpp | 730 |
1 files changed, 380 insertions, 350 deletions
diff --git a/kdevdesigner/designer/resource.cpp b/kdevdesigner/designer/resource.cpp index f86490c4..b6a9e234 100644 --- a/kdevdesigner/designer/resource.cpp +++ b/kdevdesigner/designer/resource.cpp @@ -79,7 +79,7 @@ #include <tqworkspace.h> #include <tqworkspace.h> #include <tqsplitter.h> -#include <tqucom_p.h> +#include <private/tqucom_p.h> #include <kiconloader.h> #include <tdefiledialog.h> @@ -94,7 +94,7 @@ static TQString makeIndent( int indent ) return s; } -static TQString entitize( const TQString &s, bool attribute = FALSE ) +static TQString entitize( const TQString &s, bool attribute = false ) { TQString s2 = s; s2 = s2.replace( "&", "&" ); @@ -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 } }; @@ -273,11 +273,11 @@ Resource::Resource() mainwindow = 0; formwindow = 0; toplevel = 0; - copying = FALSE; - pasting = FALSE; - hadGeometry = FALSE; + copying = false; + pasting = false; + hadGeometry = false; langIface = 0; - hasFunctions = FALSE; + hasFunctions = false; } Resource::Resource( MainWindow* mw ) @@ -285,11 +285,11 @@ Resource::Resource( MainWindow* mw ) { formwindow = 0; toplevel = 0; - copying = FALSE; - pasting = FALSE; - hadGeometry = FALSE; + copying = false; + pasting = false; + hadGeometry = false; langIface = 0; - hasFunctions = FALSE; + hasFunctions = false; } Resource::~Resource() @@ -312,14 +312,14 @@ TQWidget *Resource::widget() const bool Resource::load( FormFile *ff, Project *defProject ) { if ( !ff || ff->absFileName().isEmpty() ) - return FALSE; + return false; currFileName = ff->absFileName(); - mainContainerSet = FALSE; + mainContainerSet = false; 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; @@ -334,7 +334,7 @@ bool Resource::load( FormFile *ff, TQIODevice* dev, Project *defProject ) TQString errMsg; int errLine; if ( !doc.setContent( dev, &errMsg, &errLine ) ) { - return FALSE; + return false; } DomTool::fixDocument( doc ); @@ -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 ); @@ -449,14 +462,14 @@ bool Resource::load( FormFile *ff, TQIODevice* dev, Project *defProject ) metaInfo.className = e.firstChild().toText().data(); } else if ( e.tagName() == "pixmapfunction" ) { if ( formwindow ) { - formwindow->setSavePixmapInline( FALSE ); - formwindow->setSavePixmapInProject( FALSE ); + formwindow->setSavePixmapInline( false ); + formwindow->setSavePixmapInProject( false ); formwindow->setPixmapLoaderFunction( e.firstChild().toText().data() ); } } else if ( e.tagName() == "pixmapinproject" ) { if ( formwindow ) { - formwindow->setSavePixmapInline( FALSE ); - formwindow->setSavePixmapInProject( TRUE ); + formwindow->setSavePixmapInline( false ); + formwindow->setSavePixmapInProject( true ); } } else if ( e.tagName() == "exportmacro" ) { exportMacro = e.firstChild().toText().data(); @@ -467,7 +480,7 @@ bool Resource::load( FormFile *ff, TQIODevice* dev, Project *defProject ) formwindow->setSpacingFunction( e.attribute( "spacing" ) ); formwindow->setMarginFunction( e.attribute( "margin" ) ); if ( !formwindow->marginFunction().isEmpty() || !formwindow->spacingFunction().isEmpty() ) - formwindow->hasLayoutFunctions( TRUE ); + formwindow->hasLayoutFunctions( true ); } e = e.nextSibling().toElement(); @@ -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 + return false; 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 ) @@ -631,7 +648,7 @@ bool Resource::load( FormFile *ff, TQIODevice* dev, Project *defProject ) formwindow->resize( formwindow->size().expandedTo( formwindow->sizeHint() ) ); } - return TRUE; + return true; } static bool saveCode( const TQString &filename, const TQString &code ) @@ -640,15 +657,15 @@ static bool saveCode( const TQString &filename, const TQString &code ) if ( f.open(IO_WriteOnly | IO_Translate) ) { TQTextStream ts( &f ); ts << code; - return TRUE; + return true; } - return FALSE; + return false; } bool Resource::save( const TQString& filename, bool formCodeOnly ) { if ( !formwindow || filename.isEmpty() ) - return FALSE; + return false; if (!langIface) { TQString lang = "TQt Script"; if ( mainwindow ) @@ -659,8 +676,8 @@ bool Resource::save( const TQString& filename, bool formCodeOnly ) } if ( formCodeOnly && langIface ) { if ( saveFormCode(formwindow->formFile(), langIface) ) - return TRUE; - bool breakout = FALSE; + return true; + bool breakout = false; FormFile *ff = formwindow->formFile(); TQString codeFile = ff->project()->makeAbsolute( ff->codeFile() ); TQString filter = langIface->fileFilterList().join("\n"); @@ -669,7 +686,7 @@ bool Resource::save( const TQString& filename, bool formCodeOnly ) breakout = fn.isEmpty(); if ( !breakout ) { if ( saveCode(fn, ff->code()) ) - return TRUE; + return true; } } } @@ -677,8 +694,8 @@ 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) ); + return false; + bool b = save( &f ); f.close(); return b; } @@ -686,7 +703,7 @@ bool Resource::save( const TQString& filename, bool formCodeOnly ) bool Resource::save( TQIODevice* dev ) { if ( !formwindow ) - return FALSE; + return false; if ( !langIface ) { TQString lang = "C++"; @@ -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(); @@ -731,7 +747,7 @@ TQString Resource::copy() if ( !formwindow ) return TQString(); - copying = TRUE; + copying = true; TQString s; TQTextOStream ts( &s ); @@ -740,16 +756,16 @@ TQString Resource::copy() TQWidgetList tmp( widgets ); for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) { TQWidget *p = w->parentWidget(); - bool save = TRUE; + bool save = true; while ( p ) { if ( tmp.findRef( p ) != -1 ) { - save = FALSE; + save = false; break; } 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 ); @@ -765,9 +781,9 @@ void Resource::paste( const TQString &cb, TQWidget *parent ) { if ( !formwindow ) return; - mainContainerSet = TRUE; + mainContainerSet = true; - pasting = TRUE; + pasting = true; TQDomDocument doc; TQString errMsg; int errLine; @@ -790,9 +806,9 @@ void Resource::paste( const TQString &cb, TQWidget *parent ) loadCustomWidgets( customWidgets, this ); TQWidgetList widgets; - formwindow->clearSelection( FALSE ); - formwindow->setPropertyShowingBlocked( TRUE ); - formwindow->clearSelection( FALSE ); + formwindow->clearSelection( false ); + formwindow->setPropertyShowingBlocked( true ); + formwindow->clearSelection( false ); while ( !firstWidget.isNull() ) { if ( firstWidget.tagName() == "widget" ) { TQWidget *w = (TQWidget*)createObject( firstWidget, parent, 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,11 +837,11 @@ 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(); } - formwindow->setPropertyShowingBlocked( FALSE ); + formwindow->setPropertyShowingBlocked( false ); formwindow->emitShowProperties(); PasteCommand *cmd = new PasteCommand( i18n( "Paste" ), formwindow, widgets ); @@ -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,14 +1019,14 @@ 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; + bool saved = false; #ifdef TQT_CONTAINER_CUSTOM_WIDGETS if ( isPlugin ) { WidgetInterface *iface = 0; @@ -1003,14 +1038,14 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea if ( iface2->supportsPages( className ) ) { TQWidgetList containers = iface2->pages( className, (TQWidget*)obj ); if ( !containers.isEmpty() ) { - saved = TRUE; + saved = true; 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; @@ -1032,11 +1067,11 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea } } } else { - saved = TRUE; + saved = true; 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; @@ -1054,14 +1089,14 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea MetaDataBase::CustomWidget *cw = new MetaDataBase::CustomWidget; cw->className = className; cw->includeFile = WidgetDatabase::includeFile( classID ); - TQStrList lst = w->metaObject()->signalNames( TRUE ); + TQStrList lst = w->metaObject()->signalNames( true ); for ( TQPtrListIterator<char> it(lst); it.current(); ++it ) cw->lstSignals.append(it.current()); int i; - int total = w->metaObject()->numProperties( TRUE ); + int total = w->metaObject()->numProperties( true ); for ( i = 0; i < total; i++ ) { - const TQMetaProperty *p = w->metaObject()->property( i, TRUE ); + const TQMetaProperty *p = w->metaObject()->property( i, true ); if ( p->designable(w) ) { MetaDataBase::Property prop; prop.property = p->name(); @@ -1079,9 +1114,9 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea } } - total = w->metaObject()->numSlots( TRUE ); + total = w->metaObject()->numSlots( true ); for ( i = 0; i < total; i++ ) { - const TQMetaData *md = w->metaObject()->slot( i, TRUE ); + const TQMetaData *md = w->metaObject()->slot( i, true ); MetaDataBase::Function funky; // Find out if we have a return type. if ( md->method->count > 0 ) { @@ -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 ) { @@ -1168,7 +1203,7 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent ) TQStringList l; l << lv->header()->label( i ); TQPtrList<TQPixmap> pix; - pix.setAutoDelete( TRUE ); + pix.setAutoDelete( true ); if ( lv->header()->iconSet( i ) ) pix.append( new TQPixmap( lv->header()->iconSet( i )->pixmap() ) ); saveItem( l, pix, ts, indent ); @@ -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 @@ -1207,7 +1245,7 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent ) TQStringList l; l << table->horizontalHeader()->label( i ); TQPtrList<TQPixmap> pix; - pix.setAutoDelete( TRUE ); + pix.setAutoDelete( true ); if ( table->horizontalHeader()->iconSet( i ) ) pix.append( new TQPixmap( table->horizontalHeader()->iconSet( i )->pixmap() ) ); saveItem( l, pix, ts, indent ); @@ -1231,7 +1269,7 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent ) TQStringList l; l << table->verticalHeader()->label( i ); TQPtrList<TQPixmap> pix; - pix.setAutoDelete( TRUE ); + pix.setAutoDelete( true ); if ( table->verticalHeader()->iconSet( i ) ) pix.append( new TQPixmap( table->verticalHeader()->iconSet( i )->pixmap() ) ); saveItem( l, pix, ts, indent ); @@ -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; @@ -1440,13 +1482,13 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent ) continue; saved << TQString::fromLatin1( it.current() ); const TQMetaProperty* p = w->metaObject()-> - property( w->metaObject()->findProperty( it.current(), TRUE ), TRUE ); + 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 ); @@ -1496,7 +1538,7 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent ) void Resource::saveSetProperty( TQObject *w, const TQString &name, TQVariant::Type, TQTextStream &ts, int indent ) { - const TQMetaProperty *p = w->metaObject()->property( w->metaObject()->findProperty( name, TRUE ), TRUE ); + const TQMetaProperty *p = w->metaObject()->property( w->metaObject()->findProperty( name, true ), true ); TQStrList l( p->valueToKeys( w->property( name ).toInt() ) ); TQString v; for ( uint i = 0; i < l.count(); ++i ) { @@ -1509,7 +1551,7 @@ void Resource::saveSetProperty( TQObject *w, const TQString &name, TQVariant::Ty void Resource::saveEnumProperty( TQObject *w, const TQString &name, TQVariant::Type, TQTextStream &ts, int indent ) { - const TQMetaProperty *p = w->metaObject()->property( w->metaObject()->findProperty( name, TRUE ), TRUE ); + const TQMetaProperty *p = w->metaObject()->property( w->metaObject()->findProperty( name, true ), true ); ts << makeIndent( indent ) << "<enum>" << p->valueToKey( w->property( name ).toInt() ) << "</enum>" << endl; } @@ -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" @@ -1793,10 +1835,10 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay if ( !mainContainerSet ) { if ( formwindow ) formwindow->setMainContainer( (TQWidget*)obj ); - mainContainerSet = TRUE; + 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,13 +1976,13 @@ 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; - bool hasPixmap = FALSE; + bool hasPixmap = false; TQString txt; - bool clickable = TRUE, resizable = TRUE; + bool clickable = true, resizable = true; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { TQString attrib = n.attribute( "name" ); @@ -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" ) ) @@ -1978,10 +2020,10 @@ void Resource::createColumn( const TQDomElement &e, TQWidget *widget ) TQDomElement n = e.firstChild().toElement(); TQPixmap pix; - bool hasPixmap = FALSE; + 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 } @@ -2014,7 +2056,7 @@ void Resource::createColumn( const TQDomElement &e, TQWidget *widget ) void Resource::loadItem( const TQDomElement &e, TQPixmap &pix, TQString &txt, bool &hasPixmap ) { TQDomElement n = e; - hasPixmap = FALSE; + hasPixmap = false; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { TQString attrib = n.attribute( "name" ); @@ -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; + 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,10 +2093,10 @@ 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; + bool hasPixmap = false; TQString txt; loadItem( n, pix, txt, hasPixmap ); TQIconView *iv = (TQIconView*)widget; @@ -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; @@ -2089,7 +2131,7 @@ void Resource::createItem( const TQDomElement &e, TQWidget *widget, TQListViewIt } } } else if ( n.tagName() == "item" ) { - item->setOpen( TRUE ); + item->setOpen( true ); createItem( n, widget, item ); } @@ -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(); @@ -2117,19 +2159,19 @@ TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *parent, TQLay colspan = 1; Spacer *spacer = (Spacer*) WidgetFactory::create( WidgetDatabase::idFromClassName("Spacer"), - parent, "spacer", FALSE); + parent, "spacer", false); spacer->setOrientation( o ); - spacer->setInteraciveMode( FALSE ); + 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 ); + 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, @@ -2143,15 +2185,15 @@ TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *parent, TQLay */ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQDomElement &e ) { - const TQMetaProperty *p = obj->metaObject()->property( obj->metaObject()->findProperty( prop, TRUE ), TRUE ); + 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" ) return; } - MetaDataBase::setPropertyChanged( obj, prop, TRUE ); + MetaDataBase::setPropertyChanged( obj, prop, true ); } TQVariant defVarient; @@ -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) ) { - hadGeometry = TRUE; + if ( obj == toplevel ) { + hadGeometry = true; toplevel->resize( v.toRect().size() ); return; - } else if ( TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(formwindow->mainContainer()) ) { - hadGeometry = TRUE; + } 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() ); } } @@ -2321,12 +2363,12 @@ void Resource::saveImageData( const TQImage &img, TQTextStream &ts, int indent ) TQBuffer buf( ba ); buf.open( IO_WriteOnly | IO_Translate ); TQString format; - bool compress = FALSE; + bool compress = false; if (img.hasAlphaBuffer()) { format = "PNG"; } else { format = img.depth() > 1 ? "XPM" : "XBM"; - compress = TRUE; + compress = true; } TQImageIO iio( &buf, format ); iio.setImage( img ); @@ -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,11 +2542,11 @@ 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(); - TQObjectList *l = toplevel->queryList( 0, name, FALSE ); + TQObjectList *l = toplevel->queryList( 0, name, false ); if ( l ) { if ( l->first() ) conn.sender = l->first(); @@ -2520,9 +2562,9 @@ 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 ); + TQObjectList *l = toplevel->queryList( 0, name, false ); if ( l ) { if ( l->first() ) conn.receiver = l->first(); @@ -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 ); } @@ -2735,7 +2777,7 @@ void Resource::loadTabOrder( const TQDomElement &e ) TQString name = n.firstChild().toText().data(); if ( name.isEmpty() ) continue; - TQObjectList *l = toplevel->queryList( 0, name, FALSE ); + TQObjectList *l = toplevel->queryList( 0, name, false ); if ( l ) { if ( l->first() ) { TQWidget *w = (TQWidget*)l->first(); @@ -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,16 +2813,16 @@ 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; + bool needExtensionInclude = false; if ( langIface && formwindow->formFile()->hasFormCode() && formwindow->formFile()->codeFileState() != FormFile::Deleted ) { extensionInclude = TQFileInfo( currFileName ).fileName() + langIface->formCodeExtension(); - needExtensionInclude = TRUE; + needExtensionInclude = true; } if ( !includes.isEmpty() || needExtensionInclude ) { ts << makeIndent( indent ) << "<includes>" << endl; @@ -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 @@ -3008,13 +3038,13 @@ void Resource::loadChildAction( TQObject *parent, const TQDomElement &e ) a = new QDesignerAction( parent ); MetaDataBase::addEntry( a ); TQDomElement n2 = n.firstChild().toElement(); - bool hasMenuText = FALSE; + bool hasMenuText = false; while ( !n2.isNull() ) { if ( n2.tagName() == "property" ) { TQDomElement n3(n2); // don't modify n2 TQString prop = n3.attribute( "name" ); if (prop == "menuText") - hasMenuText = TRUE; + hasMenuText = true; TQDomElement value(n3.firstChild().toElement()); setObjectProperty( a, prop, value ); if (!hasMenuText && uiFileVersion < "3.3" && prop == "text") @@ -3022,19 +3052,19 @@ 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 ); MetaDataBase::addEntry( a ); TQDomElement n2 = n.firstChild().toElement(); - bool hasMenuText = FALSE; + bool hasMenuText = false; while ( !n2.isNull() ) { if ( n2.tagName() == "property" ) { TQDomElement n3(n2); // don't modify n2 TQString prop = n3.attribute( "name" ); if (prop == "menuText") - hasMenuText = TRUE; + hasMenuText = true; TQDomElement value = n3.firstChild().toElement(); setObjectProperty( a, prop, value ); if (!hasMenuText && uiFileVersion < "3.3" && prop == "text") @@ -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() ) { @@ -3238,7 +3268,7 @@ void Resource::loadPopupMenu( PopupMenuEditor *p, const TQDomElement &e ) PopupMenuEditorItem *i = p->at( p->find( a ) ); if ( i ) { TQString name = n.attribute( "name" ); - formwindow->unify( i, name, TRUE ); + formwindow->unify( i, name, true ); i->setName( name ); MetaDataBase::addEntry( i ); loadPopupMenu( i->subMenu(), n ); @@ -3258,7 +3288,7 @@ bool Resource::saveFormCode( FormFile *formfile, LanguageInterface * /*langIface formfile->code().isEmpty() || !formfile->hasFormCode() || !formfile->isModified(FormFile::WFormCode) ) - return TRUE; // There is no code to be saved. + return true; // There is no code to be saved. return saveCode( formfile->project()->makeAbsolute(formfile->codeFile()), formfile->code() ); } |