summaryrefslogtreecommitdiffstats
path: root/kommander/editor/widgetdatabase.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:54:04 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:54:04 +0000
commitdc6b8e72fed2586239e3514819238c520636c9d9 (patch)
tree88b200df0a0b7fab9d6f147596173556f1ed9a13 /kommander/editor/widgetdatabase.cpp
parent6927d4436e54551917f600b706a8d6109e49de1c (diff)
downloadtdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.tar.gz
tdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1157656 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kommander/editor/widgetdatabase.cpp')
-rw-r--r--kommander/editor/widgetdatabase.cpp176
1 files changed, 88 insertions, 88 deletions
diff --git a/kommander/editor/widgetdatabase.cpp b/kommander/editor/widgetdatabase.cpp
index 4de615d0..940176c1 100644
--- a/kommander/editor/widgetdatabase.cpp
+++ b/kommander/editor/widgetdatabase.cpp
@@ -26,16 +26,16 @@
#endif
#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>
@@ -46,11 +46,11 @@ const int dbsize = 300;
const int dbcustom = 200;
const int dbdictsize = 211;
static WidgetDatabaseRecord* widget_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;
#ifndef KOMMANDER
static QPluginManager<WidgetInterface> *widgetPluginManager = 0;
@@ -59,7 +59,7 @@ static bool plugins_set_up = false;
static bool was_in_setup = false;
#ifndef KOMMANDER
-QCleanupHandler<QPluginManager<WidgetInterface> > cleanup_manager;
+TQCleanupHandler<QPluginManager<WidgetInterface> > cleanup_manager;
#endif
WidgetDatabaseRecord::WidgetDatabaseRecord()
@@ -126,7 +126,7 @@ 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;
@@ -134,35 +134,35 @@ void WidgetDatabase::setupDataBase( int id )
/* Designer widgets */
r = new WidgetDatabaseRecord;
r->iconName = "pushbutton.xpm";
- r->name = "QPushButton";
+ r->name = "TQPushButton";
r->group = widgetGroup("Buttons");
r->toolTip = i18n("Push Button");
append(r);
r = new WidgetDatabaseRecord;
r->iconName = "toolbutton.xpm";
- r->name = "QToolButton";
+ r->name = "TQToolButton";
r->group = widgetGroup("Buttons");
r->toolTip = i18n("Tool Button");
append(r);
r = new WidgetDatabaseRecord;
r->iconName = "radiobutton.xpm";
- r->name = "QRadioButton";
+ r->name = "TQRadioButton";
r->group = widgetGroup("Buttons");
r->toolTip = i18n("Radio Button");
append(r);
r = new WidgetDatabaseRecord;
r->iconName = "checkbox.xpm";
- r->name = "QCheckBox";
+ r->name = "TQCheckBox";
r->group = widgetGroup("Buttons");
r->toolTip = i18n("Check Box");
append(r);
r = new WidgetDatabaseRecord;
r->iconName = "groupbox.xpm";
- r->name = "QGroupBox";
+ r->name = "TQGroupBox";
r->group = widgetGroup("Containers");
r->toolTip = i18n("Group Box");
r->isContainer = true;
@@ -170,7 +170,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconName = "buttongroup.xpm";
- r->name = "QButtonGroup";
+ r->name = "TQButtonGroup";
r->group = widgetGroup("Containers");
r->toolTip = i18n("Button Group");
r->isContainer = true;
@@ -178,7 +178,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconName = "frame.xpm";
- r->name = "QFrame";
+ r->name = "TQFrame";
r->group = widgetGroup("Containers");
r->toolTip = i18n("Frame");
r->isContainer = true;
@@ -186,7 +186,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconName = "tabwidget.xpm";
- r->name = "QTabWidget";
+ r->name = "TQTabWidget";
r->group = widgetGroup("Containers");
r->toolTip = i18n("Tabwidget");
r->isContainer = true;
@@ -194,14 +194,14 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconName = "listbox.xpm";
- r->name = "QListBox";
+ r->name = "TQListBox";
r->group = widgetGroup("Views");
r->toolTip = i18n("List Box");
append(r);
r = new WidgetDatabaseRecord;
r->iconName = "listview.xpm";
- r->name = "QListView";
+ r->name = "TQListView";
r->group = widgetGroup("Views");
r->toolTip = i18n("List View");
append(r);
@@ -209,7 +209,7 @@ void WidgetDatabase::setupDataBase( int id )
#if !defined(QT_NO_ICONVIEW) || defined(UIC)
r = new WidgetDatabaseRecord;
r->iconName = "iconview.xpm";
- r->name = "QIconView";
+ r->name = "TQIconView";
r->group = widgetGroup("Views");
r->toolTip = i18n("Icon View");
append(r);
@@ -218,7 +218,7 @@ void WidgetDatabase::setupDataBase( int id )
#if !defined(QT_NO_TABLE)
r = new WidgetDatabaseRecord;
r->iconName = "table.xpm";
- r->name = "QTable";
+ r->name = "TQTable";
r->group = widgetGroup("Views");
r->toolTip = i18n("Table");
append(r);
@@ -227,8 +227,8 @@ void WidgetDatabase::setupDataBase( int id )
#if !defined(QT_NO_SQL)
r = new WidgetDatabaseRecord;
r->iconName = "datatable.xpm";
- r->includeFile = "qdatatable.h";
- r->name = "QDataTable";
+ r->includeFile = "tqdatatable.h";
+ r->name = "TQDataTable";
r->group = widgetGroup("Database");
r->toolTip = i18n("Data Table");
append(r);
@@ -236,14 +236,14 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconName = "lineedit.xpm";
- r->name = "QLineEdit";
+ r->name = "TQLineEdit";
r->group = widgetGroup("Input");
r->toolTip = i18n("Line Edit");
append(r);
r = new WidgetDatabaseRecord;
r->iconName = "spinbox.xpm";
- r->name = "QSpinBox";
+ r->name = "TQSpinBox";
r->group = widgetGroup("Input");
r->toolTip = i18n("Spin Box");
append(r);
@@ -253,7 +253,7 @@ void WidgetDatabase::setupDataBase( int id )
r->name = "QDateEdit";
r->group = widgetGroup("Input");
r->toolTip = i18n("Date Edit");
- r->includeFile = "qdatetimeedit.h";
+ r->includeFile = "tqdatetimeedit.h";
append(r);
r = new WidgetDatabaseRecord;
@@ -261,7 +261,7 @@ void WidgetDatabase::setupDataBase( int id )
r->name = "QTimeEdit";
r->group = widgetGroup("Input");
r->toolTip = i18n("Time Edit");
- r->includeFile = "qdatetimeedit.h";
+ r->includeFile = "tqdatetimeedit.h";
append(r);
r = new WidgetDatabaseRecord;
@@ -269,82 +269,82 @@ void WidgetDatabase::setupDataBase( int id )
r->name = "QDateTimeEdit";
r->group = widgetGroup("Input");
r->toolTip = i18n("Date-Time Edit");
- r->includeFile = "qdatetimeedit.h";
+ r->includeFile = "tqdatetimeedit.h";
append(r);
r = new WidgetDatabaseRecord;
r->iconName = "multilineedit.xpm";
- r->name = "QMultiLineEdit";
+ r->name = "TQMultiLineEdit";
r->group = widgetGroup("Temp");
r->toolTip = i18n("Multi Line Edit");
append(r);
r = new WidgetDatabaseRecord;
r->iconName = "richtextedit.xpm";
- r->name = "QTextEdit";
+ r->name = "TQTextEdit";
r->group = widgetGroup("Input");
r->toolTip = i18n("Rich Text Edit");
append(r);
r = new WidgetDatabaseRecord;
r->iconName = "combobox.xpm";
- r->name = "QComboBox";
+ r->name = "TQComboBox";
r->group = widgetGroup("Input");
r->toolTip = i18n("Combo Box");
append(r);
r = new WidgetDatabaseRecord;
r->iconName = "slider.xpm";
- r->name = "QSlider";
+ r->name = "TQSlider";
r->group = widgetGroup("Input");
r->toolTip = i18n("Slider");
append(r);
r = new WidgetDatabaseRecord;
r->iconName = "scrollbar.xpm";
- r->name = "QScrollBar";
+ r->name = "TQScrollBar";
r->group = widgetGroup("Input");
r->toolTip = i18n("Scrollbar");
append(r);
r = new WidgetDatabaseRecord;
r->iconName = "dial.xpm";
- r->name = "QDial";
+ r->name = "TQDial";
r->group = widgetGroup("Input");
r->toolTip = i18n("Dial");
append(r);
r = new WidgetDatabaseRecord;
r->iconName = "label.xpm";
- r->name = "QLabel";
+ r->name = "TQLabel";
r->group = widgetGroup("Temp");
r->toolTip = i18n("Label");
append(r);
r = new WidgetDatabaseRecord;
r->iconName = "lcdnumber.xpm";
- r->name = "QLCDNumber";
+ r->name = "TQLCDNumber";
r->group = widgetGroup("Display");
r->toolTip = i18n("LCD Number");
append(r);
r = new WidgetDatabaseRecord;
r->iconName = "progress.xpm";
- r->name = "QProgressBar";
+ r->name = "TQProgressBar";
r->group = widgetGroup("Display");
r->toolTip = i18n("Progress Bar");
append(r);
r = new WidgetDatabaseRecord;
r->iconName = "textview.xpm";
- r->name = "QTextView";
+ r->name = "TQTextView";
r->group = widgetGroup("Temp");
r->toolTip = i18n("Text View");
append(r);
r = new WidgetDatabaseRecord;
r->iconName = "textbrowser.xpm";
- r->name = "QTextBrowser";
+ r->name = "TQTextBrowser";
r->group = widgetGroup("Display");
r->toolTip = i18n("Text Browser");
append(r);
@@ -359,19 +359,19 @@ 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;
append(r);
@@ -390,9 +390,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);
@@ -419,16 +419,16 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconName = "";
- r->name = "QMainWindow";
- r->includeFile = "qmainwindow.h";
+ r->name = "TQMainWindow";
+ r->includeFile = "tqmainwindow.h";
r->group = widgetGroup("Temp");
r->isContainer = true;
append(r);
#ifndef QT_NO_SQL
r = new WidgetDatabaseRecord;
- r->name = "QDataBrowser";
- r->includeFile = "qdatabrowser.h";
+ r->name = "TQDataBrowser";
+ r->includeFile = "tqdatabrowser.h";
r->group = widgetGroup("Database");
r->toolTip = "Data Browser";
r->iconName = "databrowser.xpm";
@@ -436,8 +436,8 @@ void WidgetDatabase::setupDataBase( int id )
append(r);
r = new WidgetDatabaseRecord;
- r->name = "QDataView";
- r->includeFile = "qdataview.h";
+ r->name = "TQDataView";
+ r->includeFile = "tqdataview.h";
r->group = widgetGroup("Database");
r->toolTip = "Data View";
r->iconName = "dataview.xpm";
@@ -702,7 +702,7 @@ void WidgetDatabase::setupPlugins()
continue;
WidgetDatabaseRecord *r = new WidgetDatabaseRecord;
- QString grp = (*it).group;
+ TQString grp = (*it).group;
if (grp.isEmpty())
grp = "Kommander";
r->group = widgetGroup(grp);
@@ -739,19 +739,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->iconSet )
- r->iconSet = new QIconSet( PixmapChooser::loadPixmap( r->iconName, PixmapChooser::Small ),
+ r->iconSet = new TQIconSet( PixmapChooser::loadPixmap( r->iconName, PixmapChooser::Small ),
PixmapChooser::loadPixmap( r->iconName, PixmapChooser::Large ) );
return *r->iconSet;
#else
- return QIconSet();
+ return TQIconSet();
#endif
}
@@ -759,12 +759,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;
}
@@ -772,12 +772,12 @@ QString WidgetDatabase::className( int id )
Returns the group the widget registered as \a id belongs to.
*/
-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;
}
@@ -785,12 +785,12 @@ QString WidgetDatabase::group( int id )
Returns the tooltip text of the widget which is registered as \a 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;
}
@@ -798,12 +798,12 @@ QString WidgetDatabase::toolTip( int id )
Returns the what's this? text of the widget which is registered 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;
}
@@ -811,12 +811,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;
@@ -845,10 +845,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' )
@@ -856,13 +856,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() )
@@ -881,7 +881,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;
}
@@ -914,14 +914,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 ) {
@@ -940,12 +940,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()
@@ -954,7 +954,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;
@@ -978,16 +978,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 )
@@ -1001,16 +1001,16 @@ void WidgetDatabase::loadWhatsThis( const QString &docPath )
#ifndef KOMMANDER
#if defined(UIC)
bool dbnounload = false;
-QStringList *dbpaths = 0;
+TQStringList *dbpaths = 0;
#endif
QPluginManager<WidgetInterface> *widgetManager()
{
if ( !widgetPluginManager ) {
#ifndef KOMMANDER
- widgetPluginManager = new QPluginManager<WidgetInterface>( IID_Widget, QApplication::libraryPaths(), "/designer" );
+ widgetPluginManager = new QPluginManager<WidgetInterface>( IID_Widget, TQApplication::libraryPaths(), "/designer" );
#else
- widgetPluginManager = new QPluginManager<WidgetInterface>( IID_Widget, QApplication::libraryPaths(), "" );
+ widgetPluginManager = new QPluginManager<WidgetInterface>( IID_Widget, TQApplication::libraryPaths(), "" );
#endif
cleanup_manager.add( &widgetPluginManager );
@@ -1018,7 +1018,7 @@ QPluginManager<WidgetInterface> *widgetManager()
if ( dbnounload )
widgetPluginManager->setAutoUnload( false );
if ( dbpaths ) {
- QStringList::ConstIterator it = dbpaths->begin();
+ TQStringList::ConstIterator it = dbpaths->begin();
for ( ; it != dbpaths->end(); ++it )
widgetPluginManager->addLibraryPath( *it );
}