diff options
Diffstat (limited to 'pyuic2/widgetdatabase.cpp')
-rw-r--r-- | pyuic2/widgetdatabase.cpp | 138 |
1 files changed, 69 insertions, 69 deletions
diff --git a/pyuic2/widgetdatabase.cpp b/pyuic2/widgetdatabase.cpp index 0733fce..8016ac2 100644 --- a/pyuic2/widgetdatabase.cpp +++ b/pyuic2/widgetdatabase.cpp @@ -1,7 +1,7 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** -** This file is part of Qt Designer. +** This file is part of TQt Designer. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software @@ -41,11 +41,11 @@ const int dbsize = 300; const int dbcustom = 200; const int dbdictsize = 211; static WidgetDatabaseRecord* db[ dbsize ]; -static QDict<int> *className2Id = 0; +static TQDict<int> *className2Id = 0; static int dbcount = 0; static int dbcustomcount = 200; -static QStrList *wGroups; -static QStrList *invisibleGroups; +static TQStrList *wGroups; +static TQStrList *invisibleGroups; static bool whatsThisLoaded = FALSE; @@ -95,18 +95,18 @@ void WidgetDatabase::setupDataBase() if ( dbcount ) return; - wGroups = new QStrList; - invisibleGroups = new QStrList; + wGroups = new TQStrList; + invisibleGroups = new TQStrList; invisibleGroups->append( "Forms" ); invisibleGroups->append( "Temp" ); - className2Id = new QDict<int>( dbdictsize ); + className2Id = new TQDict<int>( dbdictsize ); className2Id->setAutoDelete( TRUE ); WidgetDatabaseRecord *r = 0; r = new WidgetDatabaseRecord; r->iconSet = "pushbutton.xpm"; - r->name = "QPushButton"; + r->name = "TQPushButton"; r->group = widgetGroup( "Buttons" ); r->toolTip = "Push Button"; @@ -114,7 +114,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "toolbutton.xpm"; - r->name = "QToolButton"; + r->name = "TQToolButton"; r->group = widgetGroup( "Buttons" ); r->toolTip = "Tool Button"; @@ -122,7 +122,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "radiobutton.xpm"; - r->name = "QRadioButton"; + r->name = "TQRadioButton"; r->group = widgetGroup( "Buttons" ); r->toolTip = "Radio Button"; @@ -130,7 +130,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "checkbox.xpm"; - r->name = "QCheckBox"; + r->name = "TQCheckBox"; r->group = widgetGroup( "Buttons" ); r->toolTip = "Check Box"; @@ -140,7 +140,7 @@ void WidgetDatabase::setupDataBase() append( r ); r = new WidgetDatabaseRecord; r->iconSet = "groupbox.xpm"; - r->name = "QGroupBox"; + r->name = "TQGroupBox"; r->group = widgetGroup( "Containers" ); r->toolTip = "Group Box"; r->isContainer = TRUE; @@ -149,7 +149,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "buttongroup.xpm"; - r->name = "QButtonGroup"; + r->name = "TQButtonGroup"; r->group = widgetGroup( "Containers" ); r->toolTip = "Button Group"; r->isContainer = TRUE; @@ -158,7 +158,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "frame.xpm"; - r->name = "QFrame"; + r->name = "TQFrame"; r->group = widgetGroup( "Containers" ); r->toolTip = "Frame"; r->isContainer = TRUE; @@ -167,7 +167,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "tabwidget.xpm"; - r->name = "QTabWidget"; + r->name = "TQTabWidget"; r->group = widgetGroup( "Containers" ); r->toolTip = "Tabwidget"; r->isContainer = TRUE; @@ -177,7 +177,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "listbox.xpm"; - r->name = "QListBox"; + r->name = "TQListBox"; r->group = widgetGroup( "Views" ); r->toolTip = "List Box"; @@ -185,7 +185,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "listview.xpm"; - r->name = "QListView"; + r->name = "TQListView"; r->group = widgetGroup( "Views" ); r->toolTip = "List View"; @@ -194,7 +194,7 @@ void WidgetDatabase::setupDataBase() #if defined(QT_MODULE_ICONVIEW) || defined(UIC) r = new WidgetDatabaseRecord; r->iconSet = "iconview.xpm"; - r->name = "QIconView"; + r->name = "TQIconView"; r->group = widgetGroup( "Views" ); r->toolTip = "Icon View"; @@ -204,7 +204,7 @@ void WidgetDatabase::setupDataBase() #if defined(QT_MODULE_TABLE) r = new WidgetDatabaseRecord; r->iconSet = "table.xpm"; - r->name = "QTable"; + r->name = "TQTable"; r->group = widgetGroup( "Views" ); r->toolTip = "Table"; @@ -214,7 +214,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "lineedit.xpm"; - r->name = "QLineEdit"; + r->name = "TQLineEdit"; r->group = widgetGroup( "Input" ); r->toolTip = "Line Edit"; @@ -222,7 +222,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "spinbox.xpm"; - r->name = "QSpinBox"; + r->name = "TQSpinBox"; r->group = widgetGroup( "Input" ); r->toolTip = "Spin Box"; @@ -230,7 +230,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "multilineedit.xpm"; - r->name = "QMultiLineEdit"; + r->name = "TQMultiLineEdit"; r->group = widgetGroup( "Input" ); r->toolTip = "Multi Line Edit"; @@ -238,7 +238,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "combobox.xpm"; - r->name = "QComboBox"; + r->name = "TQComboBox"; r->group = widgetGroup( "Input" ); r->toolTip = "Combo Box"; @@ -246,7 +246,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "slider.xpm"; - r->name = "QSlider"; + r->name = "TQSlider"; r->group = widgetGroup( "Input" ); r->toolTip = "Slider"; @@ -254,7 +254,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "dial.xpm"; - r->name = "QDial"; + r->name = "TQDial"; r->group = widgetGroup( "Input" ); r->toolTip = "Dial"; @@ -262,7 +262,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "label.xpm"; - r->name = "QLabel"; + r->name = "TQLabel"; r->group = widgetGroup( "Temp" ); r->toolTip = "Label"; @@ -288,7 +288,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "lcdnumber.xpm"; - r->name = "QLCDNumber"; + r->name = "TQLCDNumber"; r->group = widgetGroup( "Display" ); r->toolTip = "LCD Number"; @@ -306,7 +306,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "progress.xpm"; - r->name = "QProgressBar"; + r->name = "TQProgressBar"; r->group = widgetGroup( "Display" ); r->toolTip = "Progress Bar"; @@ -314,7 +314,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "textview.xpm"; - r->name = "QTextView"; + r->name = "TQTextView"; r->group = widgetGroup( "Display" ); r->toolTip = "Text View"; @@ -322,7 +322,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "textbrowser.xpm"; - r->name = "QTextBrowser"; + r->name = "TQTextBrowser"; r->group = widgetGroup( "Display" ); r->toolTip = "Text Browser"; @@ -338,35 +338,35 @@ void WidgetDatabase::setupDataBase() append( r ); r = new WidgetDatabaseRecord; - r->name = "QWidget"; + r->name = "TQWidget"; r->isContainer = FALSE; r->group = widgetGroup( "Forms" ); append( r ); r = new WidgetDatabaseRecord; - r->name = "QDialog"; + r->name = "TQDialog"; r->group = widgetGroup( "Forms" ); r->isContainer = FALSE; append( r ); r = new WidgetDatabaseRecord; - r->name = "QWizard"; + r->name = "TQWizard"; r->group = widgetGroup( "Forms" ); r->isContainer = TRUE; append( r ); r = new WidgetDatabaseRecord; - r->name = "QDesignerWizard"; + r->name = "TQDesignerWizard"; r->group = widgetGroup( "Forms" ); r->isContainer = TRUE; append( r ); r = new WidgetDatabaseRecord; - r->name = "QLayoutWidget"; + r->name = "TQLayoutWidget"; r->group = widgetGroup( "Temp" ); r->includeFile = ""; r->isContainer = TRUE; @@ -375,7 +375,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "tabwidget.xpm"; - r->name = "QDesignerTabWidget"; + r->name = "TQDesignerTabWidget"; r->group = widgetGroup( "Temp" ); r->isContainer = TRUE; @@ -383,7 +383,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "tabwidget.xpm"; - r->name = "QDesignerWidget"; + r->name = "TQDesignerWidget"; r->group = widgetGroup( "Temp" ); r->isContainer = TRUE; @@ -391,7 +391,7 @@ void WidgetDatabase::setupDataBase() r = new WidgetDatabaseRecord; r->iconSet = "tabwidget.xpm"; - r->name = "QDesignerDialog"; + r->name = "TQDesignerDialog"; r->group = widgetGroup( "Temp" ); r->isContainer = TRUE; @@ -424,32 +424,32 @@ int WidgetDatabase::startCustom() id. */ -QIconSet WidgetDatabase::iconSet( int id ) +TQIconSet WidgetDatabase::iconSet( int id ) { setupDataBase(); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return QIconSet(); + return TQIconSet(); #if defined(DESIGNER) if ( !r->icon ) - r->icon = new QIconSet( PixmapChooser::loadPixmap( r->iconSet, PixmapChooser::Small ), + r->icon = new TQIconSet( PixmapChooser::loadPixmap( r->iconSet, PixmapChooser::Small ), PixmapChooser::loadPixmap( r->iconSet, PixmapChooser::Large ) ); return *r->icon; #endif - return QIconSet(); + return TQIconSet(); } /*! Returns the classname of the widget which is registered as \a id. */ -QString WidgetDatabase::className( int id ) +TQString WidgetDatabase::className( int id ) { setupDataBase(); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return QString::null; + return TQString::null; return r->name; } @@ -457,12 +457,12 @@ QString WidgetDatabase::className( int id ) Returns the group to which the widget registered as \a id belongs. */ -QString WidgetDatabase::group( int id ) +TQString WidgetDatabase::group( int id ) { setupDataBase(); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return QString::null; + return TQString::null; return r->group; } @@ -470,12 +470,12 @@ QString WidgetDatabase::group( int id ) id. */ -QString WidgetDatabase::toolTip( int id ) +TQString WidgetDatabase::toolTip( int id ) { setupDataBase(); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return QString::null; + return TQString::null; return r->toolTip; } @@ -483,12 +483,12 @@ QString WidgetDatabase::toolTip( int id ) as \a id. */ -QString WidgetDatabase::whatsThis( int id ) +TQString WidgetDatabase::whatsThis( int id ) { setupDataBase(); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return QString::null; + return TQString::null; return r->whatsThis; } @@ -496,12 +496,12 @@ QString WidgetDatabase::whatsThis( int id ) Returns the include file if the widget which is registered as \a id. */ -QString WidgetDatabase::includeFile( int id ) +TQString WidgetDatabase::includeFile( int id ) { setupDataBase(); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return QString::null; + return TQString::null; if ( r->includeFile.isNull() ) return r->name.lower() + ".h"; return r->includeFile; @@ -520,24 +520,24 @@ bool WidgetDatabase::isContainer( int id ) return r->isContainer; } -QString WidgetDatabase::createWidgetName( int id ) +TQString WidgetDatabase::createWidgetName( int id ) { setupDataBase(); - QString n = className( id ); - if ( n == "QLayoutWidget" ) + TQString n = className( id ); + if ( n == "TQLayoutWidget" ) n = "Layout"; if ( n[ 0 ] == 'Q' ) n = n.mid( 1 ); WidgetDatabaseRecord *r = at( id ); if ( !r ) return n; - n += QString::number( ++r->nameCounter ); + n += TQString::number( ++r->nameCounter ); return n; } /*! Returns the id for \a name or -1 if \a name is unknown. */ -int WidgetDatabase::idFromClassName( const QString &name ) +int WidgetDatabase::idFromClassName( const TQString &name ) { setupDataBase(); if ( name.isEmpty() ) @@ -546,7 +546,7 @@ int WidgetDatabase::idFromClassName( const QString &name ) if ( i ) return *i; if ( name == "FormWindow" ) - return idFromClassName( "QLayoutWidget" ); + return idFromClassName( "TQLayoutWidget" ); return -1; } @@ -568,7 +568,7 @@ void WidgetDatabase::insert( int index, WidgetDatabaseRecord *r ) db[ index ] = r; className2Id->insert( r->name, new int( index ) ); if ( index < dbcustom ) - dbcount = QMAX( dbcount, index ); + dbcount = TQMAX( dbcount, index ); } void WidgetDatabase::append( WidgetDatabaseRecord *r ) @@ -576,19 +576,19 @@ void WidgetDatabase::append( WidgetDatabaseRecord *r ) insert( dbcount++, r ); } -QString WidgetDatabase::widgetGroup( const QString &g ) +TQString WidgetDatabase::widgetGroup( const TQString &g ) { if ( wGroups->find( g ) == -1 ) wGroups->append( g ); return g; } -QString WidgetDatabase::widgetGroup( int i ) +TQString WidgetDatabase::widgetGroup( int i ) { setupDataBase(); if ( i >= 0 && i < (int)wGroups->count() ) return wGroups->at( i ); - return QString::null; + return TQString::null; } int WidgetDatabase::numWidgetGroups() @@ -597,7 +597,7 @@ int WidgetDatabase::numWidgetGroups() return wGroups->count(); } -bool WidgetDatabase::isGroupVisible( const QString &g ) +bool WidgetDatabase::isGroupVisible( const TQString &g ) { setupDataBase(); return invisibleGroups->find( g ) == -1; @@ -621,16 +621,16 @@ bool WidgetDatabase::isWhatsThisLoaded() return whatsThisLoaded; } -void WidgetDatabase::loadWhatsThis( const QString &docPath ) +void WidgetDatabase::loadWhatsThis( const TQString &docPath ) { - QString whatsthisFile = docPath + "/whatsthis"; - QFile f( whatsthisFile ); + TQString whatsthisFile = docPath + "/whatsthis"; + TQFile f( whatsthisFile ); if ( !f.open( IO_ReadOnly ) ) return; - QTextStream ts( &f ); + TQTextStream ts( &f ); while ( !ts.atEnd() ) { - QString s = ts.readLine(); - QStringList l = QStringList::split( " | ", s ); + TQString s = ts.readLine(); + TQStringList l = TQStringList::split( " | ", s ); int id = idFromClassName( l[ 1 ] ); WidgetDatabaseRecord *r = at( id ); if ( r ) |