summaryrefslogtreecommitdiffstats
path: root/qtruby/rubylib/designer/rbuic/widgetdatabase.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:44:01 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:44:01 +0000
commit479f5f799523bffbcc83dff581a2299c047c6fff (patch)
tree186aae707ed02aac6c7cab2fb14e97f72aca5e36 /qtruby/rubylib/designer/rbuic/widgetdatabase.cpp
parentf1dbff6145c98324ff82e34448b7483727e8ace4 (diff)
downloadtdebindings-479f5f799523bffbcc83dff581a2299c047c6fff.tar.gz
tdebindings-479f5f799523bffbcc83dff581a2299c047c6fff.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1157645 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'qtruby/rubylib/designer/rbuic/widgetdatabase.cpp')
-rw-r--r--qtruby/rubylib/designer/rbuic/widgetdatabase.cpp180
1 files changed, 90 insertions, 90 deletions
diff --git a/qtruby/rubylib/designer/rbuic/widgetdatabase.cpp b/qtruby/rubylib/designer/rbuic/widgetdatabase.cpp
index c79815b1..17b5014c 100644
--- a/qtruby/rubylib/designer/rbuic/widgetdatabase.cpp
+++ b/qtruby/rubylib/designer/rbuic/widgetdatabase.cpp
@@ -24,16 +24,16 @@
#include "widgetinterface.h"
#include "widgetdatabase.h"
-#include <qapplication.h>
+#include <tqapplication.h>
#define NO_STATIC_COLORS
#include <globaldefs.h>
-#include <qstrlist.h>
-#include <qdict.h>
-#include <qfile.h>
-#include <qtextstream.h>
-#include <qcleanuphandler.h>
+#include <tqstrlist.h>
+#include <tqdict.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
+#include <tqcleanuphandler.h>
-#include <qfeatures.h>
+#include <tqfeatures.h>
#include <stdlib.h>
@@ -41,17 +41,17 @@ 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;
static QPluginManager<WidgetInterface> *widgetPluginManager = 0;
static bool plugins_set_up = false;
static bool was_in_setup = false;
-QCleanupHandler<QPluginManager<WidgetInterface> > cleanup_manager;
+TQCleanupHandler<QPluginManager<WidgetInterface> > cleanup_manager;
WidgetDatabaseRecord::WidgetDatabaseRecord()
{
@@ -117,14 +117,14 @@ void WidgetDatabase::setupDataBase( int id )
invisibleGroups = new QStrList;
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";
@@ -132,7 +132,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "toolbutton.xpm";
- r->name = "QToolButton";
+ r->name = "TQToolButton";
r->group = widgetGroup( "Buttons" );
r->toolTip = "Tool Button";
@@ -140,7 +140,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "radiobutton.xpm";
- r->name = "QRadioButton";
+ r->name = "TQRadioButton";
r->group = widgetGroup( "Buttons" );
r->toolTip = "Radio Button";
@@ -148,7 +148,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "checkbox.xpm";
- r->name = "QCheckBox";
+ r->name = "TQCheckBox";
r->group = widgetGroup( "Buttons" );
r->toolTip = "Check Box";
@@ -156,7 +156,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "groupbox.xpm";
- r->name = "QGroupBox";
+ r->name = "TQGroupBox";
r->group = widgetGroup( "Containers" );
r->toolTip = "Group Box";
r->isContainer = true;
@@ -165,7 +165,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "buttongroup.xpm";
- r->name = "QButtonGroup";
+ r->name = "TQButtonGroup";
r->group = widgetGroup( "Containers" );
r->toolTip = "Button Group";
r->isContainer = true;
@@ -174,7 +174,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "frame.xpm";
- r->name = "QFrame";
+ r->name = "TQFrame";
r->group = widgetGroup( "Containers" );
r->toolTip = "Frame";
r->isContainer = true;
@@ -183,7 +183,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "tabwidget.xpm";
- r->name = "QTabWidget";
+ r->name = "TQTabWidget";
r->group = widgetGroup( "Containers" );
r->toolTip = "Tabwidget";
r->isContainer = true;
@@ -193,7 +193,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "listbox.xpm";
- r->name = "QListBox";
+ r->name = "TQListBox";
r->group = widgetGroup( "Views" );
r->toolTip = "List Box";
@@ -201,7 +201,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "listview.xpm";
- r->name = "QListView";
+ r->name = "TQListView";
r->group = widgetGroup( "Views" );
r->toolTip = "List View";
@@ -210,7 +210,7 @@ void WidgetDatabase::setupDataBase( int id )
#if !defined(QT_NO_ICONVIEW) || defined(UIC)
r = new WidgetDatabaseRecord;
r->iconSet = "iconview.xpm";
- r->name = "QIconView";
+ r->name = "TQIconView";
r->group = widgetGroup( "Views" );
r->toolTip = "Icon View";
@@ -220,7 +220,7 @@ void WidgetDatabase::setupDataBase( int id )
#if !defined(QT_NO_TABLE)
r = new WidgetDatabaseRecord;
r->iconSet = "table.xpm";
- r->name = "QTable";
+ r->name = "TQTable";
r->group = widgetGroup( "Views" );
r->toolTip = "Table";
@@ -230,8 +230,8 @@ void WidgetDatabase::setupDataBase( int id )
#if !defined(QT_NO_SQL)
r = new WidgetDatabaseRecord;
r->iconSet = "datatable.xpm";
- r->includeFile = "qdatatable.h";
- r->name = "QDataTable";
+ r->includeFile = "tqdatatable.h";
+ r->name = "TQDataTable";
r->group = widgetGroup( "Database" );
r->toolTip = "Data Table";
@@ -240,7 +240,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "lineedit.xpm";
- r->name = "QLineEdit";
+ r->name = "TQLineEdit";
r->group = widgetGroup( "Input" );
r->toolTip = "Line Edit";
@@ -248,7 +248,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "spinbox.xpm";
- r->name = "QSpinBox";
+ r->name = "TQSpinBox";
r->group = widgetGroup( "Input" );
r->toolTip = "Spin Box";
@@ -259,7 +259,7 @@ void WidgetDatabase::setupDataBase( int id )
r->name = "QDateEdit";
r->group = widgetGroup( "Input" );
r->toolTip = "Date Edit";
- r->includeFile = "qdatetimeedit.h";
+ r->includeFile = "tqdatetimeedit.h";
append( r );
@@ -268,7 +268,7 @@ void WidgetDatabase::setupDataBase( int id )
r->name = "QTimeEdit";
r->group = widgetGroup( "Input" );
r->toolTip = "Time Edit";
- r->includeFile = "qdatetimeedit.h";
+ r->includeFile = "tqdatetimeedit.h";
append( r );
@@ -277,13 +277,13 @@ void WidgetDatabase::setupDataBase( int id )
r->name = "QDateTimeEdit";
r->group = widgetGroup( "Input" );
r->toolTip = "Date-Time Edit";
- r->includeFile = "qdatetimeedit.h";
+ r->includeFile = "tqdatetimeedit.h";
append( r );
r = new WidgetDatabaseRecord;
r->iconSet = "multilineedit.xpm";
- r->name = "QMultiLineEdit";
+ r->name = "TQMultiLineEdit";
r->group = widgetGroup( "Temp" );
r->toolTip = "Multi Line Edit";
@@ -291,7 +291,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "richtextedit.xpm";
- r->name = "QTextEdit";
+ r->name = "TQTextEdit";
r->group = widgetGroup( "Input" );
r->toolTip = "Richtext Editor";
@@ -299,7 +299,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "combobox.xpm";
- r->name = "QComboBox";
+ r->name = "TQComboBox";
r->group = widgetGroup( "Input" );
r->toolTip = "Combo Box";
@@ -307,7 +307,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "slider.xpm";
- r->name = "QSlider";
+ r->name = "TQSlider";
r->group = widgetGroup( "Input" );
r->toolTip = "Slider";
@@ -315,7 +315,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "scrollbar.xpm";
- r->name = "QScrollBar";
+ r->name = "TQScrollBar";
r->group = widgetGroup( "Input" );
r->toolTip = "Scrollbar";
@@ -323,7 +323,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "dial.xpm";
- r->name = "QDial";
+ r->name = "TQDial";
r->group = widgetGroup( "Input" );
r->toolTip = "Dial";
@@ -331,7 +331,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "label.xpm";
- r->name = "QLabel";
+ r->name = "TQLabel";
r->group = widgetGroup( "Temp" );
r->toolTip = "Label";
@@ -357,7 +357,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "lcdnumber.xpm";
- r->name = "QLCDNumber";
+ r->name = "TQLCDNumber";
r->group = widgetGroup( "Display" );
r->toolTip = "LCD Number";
@@ -368,14 +368,14 @@ void WidgetDatabase::setupDataBase( int id )
r->name = "Line";
r->group = widgetGroup( "Display" );
r->toolTip = "Line";
- r->includeFile = "qframe.h";
+ r->includeFile = "tqframe.h";
r->whatsThis = "The Line widget provides horizontal and vertical lines.";
append( r );
r = new WidgetDatabaseRecord;
r->iconSet = "progress.xpm";
- r->name = "QProgressBar";
+ r->name = "TQProgressBar";
r->group = widgetGroup( "Display" );
r->toolTip = "Progress Bar";
@@ -383,7 +383,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "textview.xpm";
- r->name = "QTextView";
+ r->name = "TQTextView";
r->group = widgetGroup( "Temp" );
r->toolTip = "Text View";
@@ -391,7 +391,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "textbrowser.xpm";
- r->name = "QTextBrowser";
+ r->name = "TQTextBrowser";
r->group = widgetGroup( "Display" );
r->toolTip = "Text Browser";
@@ -407,21 +407,21 @@ void WidgetDatabase::setupDataBase( int id )
append( r );
r = new WidgetDatabaseRecord;
- r->name = "QWidget";
+ r->name = "TQWidget";
r->isForm = true;
r->group = widgetGroup( "Forms" );
append( r );
r = new WidgetDatabaseRecord;
- r->name = "QDialog";
+ r->name = "TQDialog";
r->group = widgetGroup( "Forms" );
r->isForm = true;
append( r );
r = new WidgetDatabaseRecord;
- r->name = "QWizard";
+ r->name = "TQWizard";
r->group = widgetGroup( "Forms" );
r->isContainer = true;
@@ -443,9 +443,9 @@ void WidgetDatabase::setupDataBase( int id )
append( r );
r = new WidgetDatabaseRecord;
- r->name = "QSplitter";
+ r->name = "TQSplitter";
r->group = widgetGroup( "Temp" );
- r->includeFile = "qsplitter.h";
+ r->includeFile = "tqsplitter.h";
r->isContainer = true;
append( r );
@@ -476,8 +476,8 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "";
- r->name = "QMainWindow";
- r->includeFile = "qmainwindow.h";
+ r->name = "TQMainWindow";
+ r->includeFile = "tqmainwindow.h";
r->group = widgetGroup( "Temp" );
r->isContainer = true;
@@ -486,8 +486,8 @@ void WidgetDatabase::setupDataBase( int id )
#ifndef QT_NO_SQL
r = new WidgetDatabaseRecord;
r->iconSet = "";
- r->name = "QDataBrowser";
- r->includeFile = "qdatabrowser.h";
+ r->name = "TQDataBrowser";
+ r->includeFile = "tqdatabrowser.h";
r->group = widgetGroup( "Database" );
r->toolTip = "Data Browser";
r->iconSet = "databrowser.xpm";
@@ -497,8 +497,8 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "";
- r->name = "QDataView";
- r->includeFile = "qdataview.h";
+ r->name = "TQDataView";
+ r->includeFile = "tqdataview.h";
r->group = widgetGroup( "Database" );
r->toolTip = "Data View";
r->iconSet = "dataview.xpm";
@@ -517,8 +517,8 @@ void WidgetDatabase::setupPlugins()
if ( plugins_set_up )
return;
plugins_set_up = true;
- QStringList widgets = widgetManager()->featureList();
- for ( QStringList::Iterator it = widgets.begin(); it != widgets.end(); ++it ) {
+ TQStringList widgets = widgetManager()->featureList();
+ for ( TQStringList::Iterator it = widgets.begin(); it != widgets.end(); ++it ) {
if ( hasWidget( *it ) )
continue;
WidgetDatabaseRecord *r = new WidgetDatabaseRecord;
@@ -528,11 +528,11 @@ void WidgetDatabase::setupPlugins()
continue;
#ifndef UIC
- QIconSet icon = iface->iconSet( *it );
+ TQIconSet icon = iface->iconSet( *it );
if ( !icon.pixmap().isNull() )
- r->icon = new QIconSet( icon );
+ r->icon = new TQIconSet( icon );
#endif
- QString grp = iface->group( *it );
+ TQString grp = iface->group( *it );
if ( grp.isEmpty() )
grp = "3rd party widgets";
r->group = widgetGroup( grp );
@@ -570,19 +570,19 @@ int WidgetDatabase::startCustom()
Returns the iconset which represents the class registered as \a id.
*/
-QIconSet WidgetDatabase::iconSet( int id )
+TQIconSet WidgetDatabase::iconSet( int id )
{
setupDataBase( id );
WidgetDatabaseRecord *r = at( id );
if ( !r )
- return QIconSet();
+ return TQIconSet();
#if !defined(UIC) && !defined(RESOURCE)
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;
#else
- return QIconSet();
+ return TQIconSet();
#endif
}
@@ -590,12 +590,12 @@ QIconSet WidgetDatabase::iconSet( int id )
Returns the classname of the widget which is registered as \a id.
*/
-QString WidgetDatabase::className( int id )
+TQString WidgetDatabase::className( int id )
{
setupDataBase( id );
WidgetDatabaseRecord *r = at( id );
if ( !r )
- return QString::null;
+ return TQString::null;
return r->name;
}
@@ -603,12 +603,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( id );
WidgetDatabaseRecord *r = at( id );
if ( !r )
- return QString::null;
+ return TQString::null;
return r->group;
}
@@ -616,12 +616,12 @@ QString WidgetDatabase::group( int id )
id.
*/
-QString WidgetDatabase::toolTip( int id )
+TQString WidgetDatabase::toolTip( int id )
{
setupDataBase( id );
WidgetDatabaseRecord *r = at( id );
if ( !r )
- return QString::null;
+ return TQString::null;
return r->toolTip;
}
@@ -629,12 +629,12 @@ QString WidgetDatabase::toolTip( int id )
as \a id.
*/
-QString WidgetDatabase::whatsThis( int id )
+TQString WidgetDatabase::whatsThis( int id )
{
setupDataBase( id );
WidgetDatabaseRecord *r = at( id );
if ( !r )
- return QString::null;
+ return TQString::null;
return r->whatsThis;
}
@@ -642,12 +642,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( id );
WidgetDatabaseRecord *r = at( id );
if ( !r )
- return QString::null;
+ return TQString::null;
if ( r->includeFile.isNull() )
return r->name.lower() + ".h";
return r->includeFile;
@@ -677,10 +677,10 @@ bool WidgetDatabase::isContainer( int id )
return r->isContainer || r->isForm;
}
-QString WidgetDatabase::createWidgetName( int id )
+TQString WidgetDatabase::createWidgetName( int id )
{
setupDataBase( id );
- QString n = className( id );
+ TQString n = className( id );
if ( n == "QLayoutWidget" )
n = "Layout";
if ( n[ 0 ] == 'Q' )
@@ -688,13 +688,13 @@ QString WidgetDatabase::createWidgetName( int id )
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( -1 );
if ( name.isEmpty() )
@@ -715,7 +715,7 @@ int WidgetDatabase::idFromClassName( const QString &name )
return -1;
}
-bool WidgetDatabase::hasWidget( const QString &name )
+bool WidgetDatabase::hasWidget( const TQString &name )
{
return className2Id->find( name ) != 0;
}
@@ -748,14 +748,14 @@ 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;
}
-bool WidgetDatabase::isGroupEmpty( const QString &grp )
+bool WidgetDatabase::isGroupEmpty( const TQString &grp )
{
WidgetDatabaseRecord *r = 0;
for ( int i = 0; i < dbcount; ++i ) {
@@ -767,12 +767,12 @@ bool WidgetDatabase::isGroupEmpty( const QString &grp )
return true;
}
-QString WidgetDatabase::widgetGroup( int i )
+TQString WidgetDatabase::widgetGroup( int i )
{
setupDataBase( -1 );
if ( i >= 0 && i < (int)wGroups->count() )
return wGroups->at( i );
- return QString::null;
+ return TQString::null;
}
int WidgetDatabase::numWidgetGroups()
@@ -781,7 +781,7 @@ int WidgetDatabase::numWidgetGroups()
return wGroups->count();
}
-bool WidgetDatabase::isGroupVisible( const QString &g )
+bool WidgetDatabase::isGroupVisible( const TQString &g )
{
setupDataBase( -1 );
return invisibleGroups->find( g ) == -1;
@@ -805,16 +805,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 )
@@ -826,7 +826,7 @@ void WidgetDatabase::loadWhatsThis( const QString &docPath )
QPluginManager<WidgetInterface> *widgetManager()
{
if ( !widgetPluginManager ) {
- widgetPluginManager = new QPluginManager<WidgetInterface>( IID_Widget, QApplication::libraryPaths(), "/designer" );
+ widgetPluginManager = new QPluginManager<WidgetInterface>( IID_Widget, TQApplication::libraryPaths(), "/designer" );
cleanup_manager.add( &widgetPluginManager );
}
return widgetPluginManager;