summaryrefslogtreecommitdiffstats
path: root/kdevdesigner/designer/newformimpl.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:56:07 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:56:07 +0000
commitd6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch)
treed109539636691d7b03036ca1c0ed29dbae6577cf /kdevdesigner/designer/newformimpl.cpp
parent3331a47a9cad24795c7440ee8107143ce444ef34 (diff)
downloadtdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.tar.gz
tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdevdesigner/designer/newformimpl.cpp')
-rw-r--r--kdevdesigner/designer/newformimpl.cpp118
1 files changed, 59 insertions, 59 deletions
diff --git a/kdevdesigner/designer/newformimpl.cpp b/kdevdesigner/designer/newformimpl.cpp
index 9ff44d01..80bc6463 100644
--- a/kdevdesigner/designer/newformimpl.cpp
+++ b/kdevdesigner/designer/newformimpl.cpp
@@ -41,19 +41,19 @@
#include "kdevdesigner_part.h"
#include <klocale.h>
-#include <qiconview.h>
-#include <qlabel.h>
-#include <qfileinfo.h>
-#include <qdir.h>
-#include <qpushbutton.h>
+#include <tqiconview.h>
+#include <tqlabel.h>
+#include <tqfileinfo.h>
+#include <tqdir.h>
+#include <tqpushbutton.h>
#include <stdlib.h>
-#include <qcombobox.h>
-#include <qworkspace.h>
-#include <qmessagebox.h>
+#include <tqcombobox.h>
+#include <tqworkspace.h>
+#include <tqmessagebox.h>
static int forms = 0;
-ProjectItem::ProjectItem( QIconView *view, const QString &text )
+ProjectItem::ProjectItem( TQIconView *view, const TQString &text )
: NewItem( view, text )
{
}
@@ -65,32 +65,32 @@ void ProjectItem::insert( Project * )
-FormItem::FormItem( QIconView *view, const QString &text )
+FormItem::FormItem( TQIconView *view, const TQString &text )
: NewItem( view, text )
{
}
void FormItem::insert( Project *pro )
{
- QString n = "Form" + QString::number( ++forms );
+ TQString n = "Form" + TQString::number( ++forms );
FormWindow *fw = 0;
FormFile *ff = new FormFile( FormFile::createUnnamedFileName(), TRUE, pro );
fw = new FormWindow( ff, MainWindow::self, MainWindow::self->qWorkspace(), n );
fw->setProject( pro );
MetaDataBase::addEntry( fw );
if ( fType == Widget ) {
- QWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "QWidget" ),
+ TQWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "TQWidget" ),
fw, n.latin1() );
fw->setMainContainer( w );
} else if ( fType == Dialog ) {
- QWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "QDialog" ), fw, n.latin1() );
+ TQWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "TQDialog" ), fw, n.latin1() );
fw->setMainContainer( w );
} else if ( fType == Wizard ) {
- QWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "QWizard" ),
+ TQWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "TQWizard" ),
fw, n.latin1() );
fw->setMainContainer( w );
} else if ( fType == MainWindow ) {
- QWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "QMainWindow" ),
+ TQWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "TQMainWindow" ),
fw, n.latin1() );
fw->setMainContainer( w );
}
@@ -123,16 +123,16 @@ void FormItem::insert( Project *pro )
-CustomFormItem::CustomFormItem( QIconView *view, const QString &text )
+CustomFormItem::CustomFormItem( TQIconView *view, const TQString &text )
: NewItem( view, text )
{
}
-static void unifyFormName( FormWindow *fw, QWorkspace *qworkspace )
+static void unifyFormName( FormWindow *fw, TQWorkspace *qworkspace )
{
- QStringList lst;
- QWidgetList windows = qworkspace->windowList();
- for ( QWidget *w =windows.first(); w; w = windows.next() ) {
+ TQStringList lst;
+ TQWidgetList windows = qworkspace->windowList();
+ for ( TQWidget *w =windows.first(); w; w = windows.next() ) {
if ( w == fw )
continue;
lst << w->name();
@@ -140,11 +140,11 @@ static void unifyFormName( FormWindow *fw, QWorkspace *qworkspace )
if ( lst.findIndex( fw->name() ) == -1 )
return;
- QString origName = fw->name();
- QString n = origName;
+ TQString origName = fw->name();
+ TQString n = origName;
int i = 1;
while ( lst.findIndex( n ) != -1 ) {
- n = origName + QString::number( i++ );
+ n = origName + TQString::number( i++ );
}
fw->setName( n );
fw->setCaption( n );
@@ -152,19 +152,19 @@ static void unifyFormName( FormWindow *fw, QWorkspace *qworkspace )
void CustomFormItem::insert( Project *pro )
{
- QString filename = templateFileName();
- if ( !filename.isEmpty() && QFile::exists( filename ) ) {
+ TQString filename = templateFileName();
+ if ( !filename.isEmpty() && TQFile::exists( filename ) ) {
Resource resource( MainWindow::self );
FormFile *ff = new FormFile( filename, TRUE, pro );
if ( !resource.load( ff ) ) {
- QMessageBox::information( MainWindow::self, i18n("Load Template"),
+ TQMessageBox::information( MainWindow::self, i18n("Load Template"),
i18n("Could not load form description from template '%1'" ).arg( filename ) );
delete ff;
return;
}
- ff->setFileName( QString::null );
+ ff->setFileName( TQString::null );
if ( MainWindow::self->formWindow() ) {
- MainWindow::self->formWindow()->setFileName( QString::null );
+ MainWindow::self->formWindow()->setFileName( TQString::null );
unifyFormName( MainWindow::self->formWindow(), MainWindow::self->qWorkspace() );
if ( !pro->isDummy() ) {
MainWindow::self->formWindow()->setSavePixmapInProject( TRUE );
@@ -176,7 +176,7 @@ void CustomFormItem::insert( Project *pro )
-SourceFileItem::SourceFileItem( QIconView *view, const QString &text )
+SourceFileItem::SourceFileItem( TQIconView *view, const TQString &text )
: NewItem( view, text ), visible( TRUE )
{
}
@@ -189,7 +189,7 @@ void SourceFileItem::insert( Project *pro )
void SourceFileItem::setProject( Project *pro )
{
- QIconView *iv = iconView();
+ TQIconView *iv = iconView();
bool v = lang == pro->language();
if ( !iv || v == visible )
return;
@@ -202,7 +202,7 @@ void SourceFileItem::setProject( Project *pro )
-SourceTemplateItem::SourceTemplateItem( QIconView *view, const QString &text )
+SourceTemplateItem::SourceTemplateItem( TQIconView *view, const TQString &text )
: NewItem( view, text ), visible( TRUE )
{
}
@@ -231,7 +231,7 @@ void SourceTemplateItem::insert( Project *pro )
void SourceTemplateItem::setProject( Project *pro )
{
- QIconView *iv = iconView();
+ TQIconView *iv = iconView();
bool v = !pro->isDummy() && lang == pro->language();
if ( !iv || v == visible )
return;
@@ -242,11 +242,11 @@ void SourceTemplateItem::setProject( Project *pro )
iv->insertItem( this );
}
-void NewForm::insertTemplates( QIconView *tView,
- const QString &templatePath )
+void NewForm::insertTemplates( TQIconView *tView,
+ const TQString &templatePath )
{
- QStringList::Iterator it;
- QStringList languages = MetaDataBase::languages();
+ TQStringList::Iterator it;
+ TQStringList languages = MetaDataBase::languages();
if ( !MainWindow::self->singleProjectMode() ) {
for ( it = languages.begin(); it != languages.end(); ++it ) {
ProjectItem *pi = new ProjectItem( tView, i18n("%1 Project" ).arg( *it ) );
@@ -256,7 +256,7 @@ void NewForm::insertTemplates( QIconView *tView,
pi->setDragEnabled( FALSE );
}
}
- QIconViewItem *cur = 0;
+ TQIconViewItem *cur = 0;
FormItem *fi = new FormItem( tView,i18n( "Dialog" ) );
allItems.append( fi );
fi->setFormType( FormItem::Dialog );
@@ -280,32 +280,32 @@ void NewForm::insertTemplates( QIconView *tView,
fi->setPixmap( BarIcon( "designer_newform.png" , KDevDesignerPartFactory::instance()) );
fi->setDragEnabled( FALSE );
- QString templPath = templatePath;
- QStringList templRoots;
+ TQString templPath = templatePath;
+ TQStringList templRoots;
const char *qtdir = getenv( "QTDIR" );
if(qtdir)
templRoots << qtdir;
templRoots << qInstallPathData();
if(qtdir) //try the tools/designer directory last!
- templRoots << (QString(qtdir) + "/tools/designer");
- for ( QStringList::Iterator it = templRoots.begin(); it != templRoots.end(); ++it ) {
- QString path = (*it) + "/templates";
- if ( QFile::exists( path )) {
+ templRoots << (TQString(qtdir) + "/tools/designer");
+ for ( TQStringList::Iterator it = templRoots.begin(); it != templRoots.end(); ++it ) {
+ TQString path = (*it) + "/templates";
+ if ( TQFile::exists( path )) {
templPath = path;
break;
}
}
if ( !templPath.isEmpty() ) {
- QDir dir( templPath );
- const QFileInfoList *filist = dir.entryInfoList( QDir::DefaultFilter, QDir::DirsFirst | QDir::Name );
+ TQDir dir( templPath );
+ const QFileInfoList *filist = dir.entryInfoList( TQDir::DefaultFilter, TQDir::DirsFirst | TQDir::Name );
if ( filist ) {
QFileInfoListIterator it( *filist );
- QFileInfo *fi;
+ TQFileInfo *fi;
while ( ( fi = it.current() ) != 0 ) {
++it;
if ( !fi->isFile() || fi->extension() != "ui" )
continue;
- QString name = fi->baseName();
+ TQString name = fi->baseName();
name = name.replace( '_', ' ' );
CustomFormItem *ci = new CustomFormItem( tView, name );
allItems.append( ci );
@@ -320,9 +320,9 @@ void NewForm::insertTemplates( QIconView *tView,
for ( it = languages.begin(); it != languages.end(); ++it ) {
LanguageInterface *iface = MetaDataBase::languageInterface( *it );
if ( iface ) {
- QMap<QString, QString> extensionMap;
+ TQMap<TQString, TQString> extensionMap;
iface->preferedExtensions( extensionMap );
- for ( QMap<QString, QString>::Iterator eit = extensionMap.begin();
+ for ( TQMap<TQString, TQString>::Iterator eit = extensionMap.begin();
eit != extensionMap.end(); ++eit ) {
SourceFileItem * si = new SourceFileItem( tView, *eit );
allItems.append( si );
@@ -336,8 +336,8 @@ void NewForm::insertTemplates( QIconView *tView,
}
if ( !MainWindow::self->singleProjectMode() ) {
- QStringList sourceTemplates = MainWindow::self->sourceTemplates();
- for ( QStringList::Iterator sit = sourceTemplates.begin(); sit != sourceTemplates.end(); ++sit ) {
+ TQStringList sourceTemplates = MainWindow::self->sourceTemplates();
+ for ( TQStringList::Iterator sit = sourceTemplates.begin(); sit != sourceTemplates.end(); ++sit ) {
SourceTemplateInterface *siface = MainWindow::self->sourceTemplateInterface( *sit );
if ( !siface )
continue;
@@ -358,17 +358,17 @@ void NewForm::insertTemplates( QIconView *tView,
adjustSize();
}
-NewForm::NewForm( QIconView *templateView, const QString &templatePath )
+NewForm::NewForm( TQIconView *templateView, const TQString &templatePath )
{
insertTemplates( templateView, templatePath );
projectChanged( i18n( "<No Project>" ) );
}
-NewForm::NewForm( QWidget *parent, const QStringList& projects,
- const QString& currentProject, const QString &templatePath )
+NewForm::NewForm( TQWidget *parent, const TQStringList& projects,
+ const TQString& currentProject, const TQString &templatePath )
: NewFormBase( parent, 0, TRUE )
{
- connect( helpButton, SIGNAL( clicked() ), MainWindow::self, SLOT( showDialogHelp() ) );
+ connect( helpButton, TQT_SIGNAL( clicked() ), MainWindow::self, TQT_SLOT( showDialogHelp() ) );
projectCombo->insertStringList( projects );
projectCombo->setCurrentText( currentProject );
@@ -390,25 +390,25 @@ void NewForm::accept()
( (NewItem*)templateView->currentItem() )->insert( pro );
}
-void NewForm::projectChanged( const QString &project )
+void NewForm::projectChanged( const TQString &project )
{
Project *pro = MainWindow::self->findProject( project );
if ( !pro )
return;
- QIconViewItem *i;
+ TQIconViewItem *i;
for ( i = allItems.first(); i; i = allItems.next() )
( (NewItem*)i )->setProject( pro );
templateView->setCurrentItem( templateView->firstItem() );
templateView->arrangeItemsInGrid( TRUE );
}
-void NewForm::itemChanged( QIconViewItem *item )
+void NewForm::itemChanged( TQIconViewItem *item )
{
labelProject->setEnabled( item->rtti() != NewItem::ProjectType );
projectCombo->setEnabled( item->rtti() != NewItem::ProjectType );
}
-QPtrList<QIconViewItem> NewForm::allViewItems()
+TQPtrList<TQIconViewItem> NewForm::allViewItems()
{
return allItems;
}