summaryrefslogtreecommitdiffstats
path: root/kommander/factory/kommanderfactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kommander/factory/kommanderfactory.cpp')
-rw-r--r--kommander/factory/kommanderfactory.cpp136
1 files changed, 68 insertions, 68 deletions
diff --git a/kommander/factory/kommanderfactory.cpp b/kommander/factory/kommanderfactory.cpp
index 9058513a..0247a814 100644
--- a/kommander/factory/kommanderfactory.cpp
+++ b/kommander/factory/kommanderfactory.cpp
@@ -36,7 +36,7 @@
#endif
#include <tqdom.h>
#include <tqdir.h>
-#include <layout.h>
+#include <tqlayout.h>
#include <tqmetaobject.h>
#include "domtool.h"
#include <tqapplication.h>
@@ -79,13 +79,13 @@
#include <tqwizard.h>
#include <tqlcdnumber.h>
#include <tqprogressbar.h>
-#include <textview.h>
-#include <textbrowser.h>
+#include <tqtextview.h>
+#include <tqtextbrowser.h>
#include <tqdial.h>
#include <tqslider.h>
#include <tqframe.h>
#include <tqwidgetstack.h>
-#include <textedit.h>
+#include <tqtextedit.h>
#include <tqscrollbar.h>
#include <tqmainwindow.h>
#include <tqsplitter.h>
@@ -497,7 +497,7 @@ FeatureList KommanderFactory::featureList()
//iterate through widgetPlugins, appending KommanderPlugin::widgets() to features
}
-TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidget *parent, TQLayout* layout, const TQString &classNameArg )
+TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidget *parent, TQLayout* tqlayout, const TQString &classNameArg )
{
lastItem = 0;
TQDomElement n = e.firstChild().toElement();
@@ -515,10 +515,10 @@ TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidge
if ( colspan < 1 )
colspan = 1;
if ( !className.isEmpty() ) {
- if ( !layout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING )
+ if ( !tqlayout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING )
className = TQWIDGET_OBJECT_NAME_STRING;
- if ( layout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING ) {
- // hide layout widgets
+ if ( tqlayout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING ) {
+ // hide tqlayout widgets
w = parent;
} else {
obj = TQT_TQOBJECT(KommanderFactory::createWidget( className, parent, 0 ));
@@ -531,16 +531,16 @@ TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidge
toplevel = w;
if ( w->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) )
w = ( (TQMainWindow*)w )->centralWidget();
- if ( layout ) {
- switch( layoutType( layout ) ) {
+ if ( tqlayout ) {
+ switch( layoutType( tqlayout ) ) {
case HBox:
- ( (TQHBoxLayout*)layout )->addWidget( w );
+ ( (TQHBoxLayout*)tqlayout )->addWidget( w );
break;
case VBox:
- ( (TQVBoxLayout*)layout )->addWidget( w );
+ ( (TQVBoxLayout*)tqlayout )->addWidget( w );
break;
case Grid:
- ( (TQGridLayout*)layout )->addMultiCellWidget( w, row, row + rowspan - 1,
+ ( (TQGridLayout*)tqlayout )->addMultiCellWidget( w, row, row + rowspan - 1,
col, col + colspan - 1 );
break;
default:
@@ -548,7 +548,7 @@ TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidge
}
}
- layout = 0;
+ tqlayout = 0;
}
}
if (className == "Dialog")
@@ -556,43 +556,43 @@ TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidge
while ( !n.isNull() ) {
if ( n.tagName() == "spacer" ) {
- createSpacer( n, layout );
+ createSpacer( n, tqlayout );
} else if ( n.tagName() == "widget" ) {
TQMap< TQString, TQString> *oldDbControls = dbControls;
- createWidgetInternal( n, w, layout, n.attribute( "class", TQWIDGET_OBJECT_NAME_STRING ) );
+ createWidgetInternal( n, w, tqlayout, n.attribute( "class", TQWIDGET_OBJECT_NAME_STRING ) );
dbControls = oldDbControls;
} else if ( n.tagName() == "hbox" ) {
- TQLayout *parentLayout = layout;
- if ( layout && layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
- layout = createLayout( 0, 0, KommanderFactory::HBox );
+ TQLayout *parentLayout = tqlayout;
+ if ( tqlayout && tqlayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
+ tqlayout = createLayout( 0, 0, KommanderFactory::HBox );
else
- layout = createLayout( w, layout, KommanderFactory::HBox );
- obj = TQT_TQOBJECT(layout);
+ tqlayout = createLayout( w, tqlayout, KommanderFactory::HBox );
+ obj = TQT_TQOBJECT(tqlayout);
n = n.firstChild().toElement();
if ( parentLayout && parentLayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
- ( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row, row + rowspan - 1, col, col + colspan - 1 );
+ ( (TQGridLayout*)parentLayout )->addMultiCellLayout( tqlayout, row, row + rowspan - 1, col, col + colspan - 1 );
continue;
} else if ( n.tagName() == "grid" ) {
- TQLayout *parentLayout = layout;
- if ( layout && layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
- layout = createLayout( 0, 0, KommanderFactory::Grid );
+ TQLayout *parentLayout = tqlayout;
+ if ( tqlayout && tqlayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
+ tqlayout = createLayout( 0, 0, KommanderFactory::Grid );
else
- layout = createLayout( w, layout, KommanderFactory::Grid );
- obj = TQT_TQOBJECT(layout);
+ tqlayout = createLayout( w, tqlayout, KommanderFactory::Grid );
+ obj = TQT_TQOBJECT(tqlayout);
n = n.firstChild().toElement();
if ( parentLayout && parentLayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
- ( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row, row + rowspan - 1, col, col + colspan - 1 );
+ ( (TQGridLayout*)parentLayout )->addMultiCellLayout( tqlayout, row, row + rowspan - 1, col, col + colspan - 1 );
continue;
} else if ( n.tagName() == "vbox" ) {
- TQLayout *parentLayout = layout;
- if ( layout && layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
- layout = createLayout( 0, 0, KommanderFactory::VBox );
+ TQLayout *parentLayout = tqlayout;
+ if ( tqlayout && tqlayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
+ tqlayout = createLayout( 0, 0, KommanderFactory::VBox );
else
- layout = createLayout( w, layout, KommanderFactory::VBox );
- obj = TQT_TQOBJECT(layout);
+ tqlayout = createLayout( w, tqlayout, KommanderFactory::VBox );
+ obj = TQT_TQOBJECT(tqlayout);
n = n.firstChild().toElement();
if ( parentLayout && parentLayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
- ( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row, row + rowspan - 1, col, col + colspan - 1 );
+ ( (TQGridLayout*)parentLayout )->addMultiCellLayout( tqlayout, row, row + rowspan - 1, col, col + colspan - 1 );
continue;
} else if ( n.tagName() == "property" && obj ) {
setProperty( obj, n.attribute( "name" ), n.firstChild().toElement() );
@@ -622,60 +622,60 @@ TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidge
return w;
}
-TQLayout *KommanderFactory::createLayout( TQWidget *widget, TQLayout* layout, LayoutType type )
+TQLayout *KommanderFactory::createLayout( TQWidget *widget, TQLayout* tqlayout, LayoutType type )
{
int spacing = defSpacing;
int margin = defMargin;
- if ( !layout && widget && widget->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) )
+ if ( !tqlayout && widget && widget->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) )
widget = ((TQTabWidget*)widget)->currentPage();
- if ( !layout && widget && widget->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) )
+ if ( !tqlayout && widget && widget->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) )
widget = ((TQToolBox*)widget)->currentItem();
- if ( !layout && widget && widget->inherits( TQWIZARD_OBJECT_NAME_STRING ) )
+ if ( !tqlayout && widget && widget->inherits( TQWIZARD_OBJECT_NAME_STRING ) )
widget = ((TQWizard*)widget)->currentPage();
- if ( !layout && widget && widget->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) )
+ if ( !tqlayout && widget && widget->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) )
widget = ((TQWidgetStack*)widget)->visibleWidget();
- if ( !layout && widget && widget->inherits( TQGROUPBOX_OBJECT_NAME_STRING ) ) {
+ if ( !tqlayout && widget && widget->inherits( TQGROUPBOX_OBJECT_NAME_STRING ) ) {
TQGroupBox *gb = (TQGroupBox*)widget;
gb->setColumnLayout( 0, Qt::Vertical );
- gb->layout()->setMargin( 0 );
- gb->layout()->setSpacing( 0 );
+ gb->tqlayout()->setMargin( 0 );
+ gb->tqlayout()->setSpacing( 0 );
TQLayout *l;
switch ( type ) {
case HBox:
- l = new TQHBoxLayout( gb->layout() );
- l->setAlignment( TQt::AlignTop );
+ l = new TQHBoxLayout( gb->tqlayout() );
+ l->tqsetAlignment( TQt::AlignTop );
return l;
case VBox:
- l = new TQVBoxLayout( gb->layout(), spacing );
- l->setAlignment( TQt::AlignTop );
+ l = new TQVBoxLayout( gb->tqlayout(), spacing );
+ l->tqsetAlignment( TQt::AlignTop );
return l;
case Grid:
- l = new TQGridLayout( gb->layout() );
- l->setAlignment( TQt::AlignTop );
+ l = new TQGridLayout( gb->tqlayout() );
+ l->tqsetAlignment( TQt::AlignTop );
return l;
default:
return 0;
}
} else {
- if ( layout ) {
+ if ( tqlayout ) {
TQLayout *l;
switch ( type ) {
case HBox:
- l = new TQHBoxLayout( layout );
+ l = new TQHBoxLayout( tqlayout );
l->setSpacing( spacing );
l->setMargin( margin );
return l;
case VBox:
- l = new TQVBoxLayout( layout );
+ l = new TQVBoxLayout( tqlayout );
l->setSpacing( spacing );
l->setMargin( margin );
return l;
case Grid: {
- l = new TQGridLayout( layout );
+ l = new TQGridLayout( tqlayout );
l->setSpacing( spacing );
l->setMargin( margin );
return l;
@@ -715,20 +715,20 @@ TQLayout *KommanderFactory::createLayout( TQWidget *widget, TQLayout* layout, L
}
}
-KommanderFactory::LayoutType KommanderFactory::layoutType( TQLayout *layout ) const
+KommanderFactory::LayoutType KommanderFactory::layoutType( TQLayout *tqlayout ) const
{
- if ( layout->inherits( TQHBOXLAYOUT_OBJECT_NAME_STRING ) )
+ if ( tqlayout->inherits( TQHBOXLAYOUT_OBJECT_NAME_STRING ) )
return HBox;
- else if ( layout->inherits( TQVBOXLAYOUT_OBJECT_NAME_STRING ) )
+ else if ( tqlayout->inherits( TQVBOXLAYOUT_OBJECT_NAME_STRING ) )
return VBox;
- else if ( layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
+ else if ( tqlayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
return Grid;
return NoLayout;
}
void KommanderFactory::setProperty( TQObject* obj, const TQString &prop, const TQDomElement &e )
{
- const TQMetaProperty *p = obj->metaObject()->property( obj->metaObject()->findProperty( prop, true ), true );
+ const TQMetaProperty *p = obj->tqmetaObject()->property( obj->tqmetaObject()->findProperty( prop, true ), true );
TQVariant defVariant;
if ( e.tagName() == "font" ) {
@@ -840,7 +840,7 @@ void KommanderFactory::setProperty( TQObject* obj, const TQString &prop, const T
obj->setProperty( prop, v );
}
-void KommanderFactory::createSpacer( const TQDomElement &e, TQLayout *layout )
+void KommanderFactory::createSpacer( const TQDomElement &e, TQLayout *tqlayout )
{
TQDomElement n = e.firstChild().toElement();
int row = e.attribute( "row" ).toInt();
@@ -872,7 +872,7 @@ void KommanderFactory::createSpacer( const TQDomElement &e, TQLayout *layout )
sizeType = TQSizePolicy::MinimumExpanding;
else if ( n.firstChild().firstChild().toText().data() == "Expanding" )
sizeType = TQSizePolicy::Expanding;
- } else if ( prop == "sizeHint" ) {
+ } else if ( prop == "tqsizeHint" ) {
w = n.firstChild().firstChild().firstChild().toText().data().toInt();
h = n.firstChild().firstChild().nextSibling().firstChild().toText().data().toInt();
}
@@ -886,11 +886,11 @@ void KommanderFactory::createSpacer( const TQDomElement &e, TQLayout *layout )
colspan = 1;
TQSpacerItem *item = new TQSpacerItem( w, h, orient == Qt::Horizontal ? sizeType : TQSizePolicy::Minimum,
orient == Qt::Vertical ? sizeType : TQSizePolicy::Minimum );
- if ( layout ) {
- if ( layout->inherits( TQBOXLAYOUT_OBJECT_NAME_STRING ) )
- ( (TQBoxLayout*)layout )->addItem( item );
+ if ( tqlayout ) {
+ if ( tqlayout->inherits( TQBOXLAYOUT_OBJECT_NAME_STRING ) )
+ ( (TQBoxLayout*)tqlayout )->addItem( item );
else
- ( (TQGridLayout*)layout )->addMultiCell( item, row, row + rowspan - 1, col, col + colspan - 1,
+ ( (TQGridLayout*)tqlayout )->addMultiCell( item, row, row + rowspan - 1, col, col + colspan - 1,
orient == Qt::Horizontal ? TQt::AlignVCenter : TQt::AlignHCenter );
}
}
@@ -1093,16 +1093,16 @@ void KommanderFactory::loadConnections( const TQDomElement &e, TQObject *connect
if ( lang == "C++" ) {
TQString s = "2""%1";
- s = s.arg( conn.signal.data() );
+ s = s.tqarg( conn.signal.data() );
TQString s2 = "1""%1";
- s2 = s2.arg( conn.slot.data() );
+ s2 = s2.tqarg( conn.slot.data() );
- TQStrList signalList = sender->metaObject()->signalNames( true );
- TQStrList slotList = receiver->metaObject()->slotNames( true );
+ TQStrList signalList = sender->tqmetaObject()->signalNames( true );
+ TQStrList slotList = receiver->tqmetaObject()->slotNames( true );
// if this is a connection to a custom slot and we have a connector, try this as receiver
if ( slotList.find( conn.slot ) == -1 && TQT_BASE_OBJECT(receiver) == TQT_BASE_OBJECT(toplevel) && connector ) {
- slotList = connector->metaObject()->slotNames( true );
+ slotList = connector->tqmetaObject()->slotNames( true );
receiver = connector;
}