summaryrefslogtreecommitdiffstats
path: root/kommander/editor/widgetfactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kommander/editor/widgetfactory.cpp')
-rw-r--r--kommander/editor/widgetfactory.cpp88
1 files changed, 44 insertions, 44 deletions
diff --git a/kommander/editor/widgetfactory.cpp b/kommander/editor/widgetfactory.cpp
index 815c9f89..9e7f14a8 100644
--- a/kommander/editor/widgetfactory.cpp
+++ b/kommander/editor/widgetfactory.cpp
@@ -668,11 +668,11 @@ TQWidget *WidgetFactory::create( int id, TQWidget *parent, const char *name, boo
return w;
}
-/*! Creates a tqlayout on the widget \a widget of the type \a type
+/*! Creates a layout on the widget \a widget of the type \a type
which can be \c HBox, \c VBox or \c Grid.
*/
-TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *tqlayout, LayoutType type )
+TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, LayoutType type )
{
int spacing = MainWindow::self->currentLayoutDefaultSpacing();
int margin = 0;
@@ -682,46 +682,46 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *tqlayout, Lay
widget && widget->parentWidget() && widget->parentWidget()->inherits( "FormWindow" ) ) )
margin = MainWindow::self->currentLayoutDefaultMargin();
- if ( !tqlayout && widget && widget->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) )
+ if ( !layout && widget && widget->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) )
widget = ((TQTabWidget*)widget)->currentPage();
- if ( !tqlayout && widget && widget->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) )
+ if ( !layout && widget && widget->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) )
widget = ((TQToolBox*)widget)->currentItem();
- if ( !tqlayout && widget && widget->inherits( TQWIZARD_OBJECT_NAME_STRING ) )
+ if ( !layout && widget && widget->inherits( TQWIZARD_OBJECT_NAME_STRING ) )
widget = ((TQWizard*)widget)->currentPage();
- if ( !tqlayout && widget && widget->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) )
+ if ( !layout && widget && widget->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) )
widget = ((TQMainWindow*)widget)->centralWidget();
- if ( !tqlayout && widget && widget->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) )
+ if ( !layout && widget && widget->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) )
widget = ((TQWidgetStack*)widget)->visibleWidget();
MetaDataBase::addEntry( TQT_TQOBJECT(widget) );
- if ( !tqlayout && widget && widget->inherits( TQGROUPBOX_OBJECT_NAME_STRING ) ) {
+ if ( !layout && widget && widget->inherits( TQGROUPBOX_OBJECT_NAME_STRING ) ) {
TQGroupBox *gb = (TQGroupBox*)widget;
gb->setColumnLayout( 0, Qt::Vertical );
- gb->tqlayout()->setMargin( 0 );
- gb->tqlayout()->setSpacing( 0 );
+ gb->layout()->setMargin( 0 );
+ gb->layout()->setSpacing( 0 );
TQLayout *l;
switch ( type ) {
case HBox:
- l = new TQHBoxLayout( gb->tqlayout() );
+ l = new TQHBoxLayout( gb->layout() );
MetaDataBase::setMargin( TQT_TQOBJECT(gb), margin );
MetaDataBase::setSpacing( TQT_TQOBJECT(gb), spacing );
l->setAlignment( AlignTop );
MetaDataBase::addEntry( TQT_TQOBJECT(l) );
return l;
case VBox:
- l = new TQVBoxLayout( gb->tqlayout(), spacing );
+ l = new TQVBoxLayout( gb->layout(), spacing );
MetaDataBase::setMargin( TQT_TQOBJECT(gb), margin );
MetaDataBase::setSpacing( TQT_TQOBJECT(gb), spacing );
l->setAlignment( AlignTop );
MetaDataBase::addEntry( TQT_TQOBJECT(l) );
return l;
case Grid:
- l = new QDesignerGridLayout( gb->tqlayout() );
+ l = new QDesignerGridLayout( gb->layout() );
MetaDataBase::setMargin( TQT_TQOBJECT(gb), margin );
MetaDataBase::setSpacing( TQT_TQOBJECT(gb), spacing );
l->setAlignment( AlignTop );
@@ -731,25 +731,25 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *tqlayout, Lay
return 0;
}
} else {
- if ( tqlayout ) {
+ if ( layout ) {
TQLayout *l;
switch ( type ) {
case HBox:
- l = new TQHBoxLayout( tqlayout );
+ l = new TQHBoxLayout( layout );
MetaDataBase::addEntry( TQT_TQOBJECT(l) );
l->setSpacing( spacing );
l->setMargin( margin );
MetaDataBase::addEntry( TQT_TQOBJECT(l) );
return l;
case VBox:
- l = new TQVBoxLayout( tqlayout );
+ l = new TQVBoxLayout( layout );
MetaDataBase::addEntry( TQT_TQOBJECT(l) );
l->setSpacing( spacing );
l->setMargin( margin );
MetaDataBase::addEntry( TQT_TQOBJECT(l) );
return l;
case Grid: {
- l = new QDesignerGridLayout( tqlayout );
+ l = new QDesignerGridLayout( layout );
MetaDataBase::addEntry( TQT_TQOBJECT(l) );
l->setSpacing( spacing );
l->setMargin( margin );
@@ -819,7 +819,7 @@ void WidgetFactory::deleteLayout( TQWidget *widget )
widget = ((TQMainWindow*)widget)->centralWidget();
if ( widget->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) )
widget = ((TQWidgetStack*)widget)->visibleWidget();
- delete widget->tqlayout();
+ delete widget->layout();
}
/*! Factory functions for creating a widget of the type \a className
@@ -1257,14 +1257,14 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
-/*! Find out which type the tqlayout of the widget is. Returns \c HBox,
- \c VBox, \c Grid or \c NoLayout. \a tqlayout points to this
- TQWidget::tqlayout() of \a w or to 0 after the function call.
+/*! Find out which type the layout of the widget is. Returns \c HBox,
+ \c VBox, \c Grid or \c NoLayout. \a layout points to this
+ TQWidget::layout() of \a w or to 0 after the function call.
*/
-WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&tqlayout )
+WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&layout )
{
- tqlayout = 0;
+ layout = 0;
if ( w && w->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) )
w = ((TQTabWidget*)w)->currentPage();
@@ -1280,9 +1280,9 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&tql
if ( w && w->inherits( TQSPLITTER_OBJECT_NAME_STRING ) )
return ( (TQSplitter*)w )->orientation() ==Qt::Horizontal ? HBox : VBox;
- if ( !w || !w->tqlayout() )
+ if ( !w || !w->layout() )
return NoLayout;
- TQLayout *lay = w->tqlayout();
+ TQLayout *lay = w->layout();
if ( w->inherits( TQGROUPBOX_OBJECT_NAME_STRING ) ) {
TQObjectList *l = TQT_TQOBJECT(lay)->queryList( TQLAYOUT_OBJECT_NAME_STRING );
@@ -1290,7 +1290,7 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&tql
lay = (TQLayout*)l->first();
delete l;
}
- tqlayout = lay;
+ layout = lay;
if ( lay->inherits( TQHBOXLAYOUT_OBJECT_NAME_STRING ) )
return HBox;
@@ -1304,13 +1304,13 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&tql
/*!
\overload
*/
-WidgetFactory::LayoutType WidgetFactory::layoutType( TQLayout *tqlayout )
+WidgetFactory::LayoutType WidgetFactory::layoutType( TQLayout *layout )
{
- if ( tqlayout->inherits( TQHBOXLAYOUT_OBJECT_NAME_STRING ) )
+ if ( layout->inherits( TQHBOXLAYOUT_OBJECT_NAME_STRING ) )
return HBox;
- else if ( tqlayout->inherits( TQVBOXLAYOUT_OBJECT_NAME_STRING ) )
+ else if ( layout->inherits( TQVBOXLAYOUT_OBJECT_NAME_STRING ) )
return VBox;
- else if ( tqlayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
+ else if ( layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
return Grid;
return NoLayout;
}
@@ -1325,9 +1325,9 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w )
}
-TQWidget *WidgetFactory::layoutParent( TQLayout *tqlayout )
+TQWidget *WidgetFactory::layoutParent( TQLayout *layout )
{
- TQObject *o = TQT_TQOBJECT(tqlayout);
+ TQObject *o = TQT_TQOBJECT(layout);
while ( o ) {
if ( o->isWidgetType() )
return (TQWidget*)o;
@@ -1793,7 +1793,7 @@ bool TQLayoutWidget::event( TQEvent *e )
/*
This function must be called on TQLayoutWidget creation and whenever
- the TQLayoutWidget's parent tqlayout changes (e.g., from a TQHBoxLayout
+ the TQLayoutWidget's parent layout changes (e.g., from a TQHBoxLayout
to a TQVBoxLayout), because of the (illogical) way layouting works.
*/
void TQLayoutWidget::updateSizePolicy()
@@ -1817,14 +1817,14 @@ void TQLayoutWidget::updateSizePolicy()
int ht = (int) TQSizePolicy::Preferred;
int vt = (int) TQSizePolicy::Preferred;
- if ( tqlayout() ) {
+ if ( layout() ) {
/*
- parentLayout is set to the parent tqlayout if there is one and if it is
+ parentLayout is set to the parent layout if there is one and if it is
top level, in which case layouting is illogical.
*/
TQLayout *parentLayout = 0;
if ( parent() && parent()->isWidgetType() ) {
- parentLayout = ((TQWidget *)parent())->tqlayout();
+ parentLayout = ((TQWidget *)parent())->layout();
if ( parentLayout && parentLayout->mainWidget()->inherits(TQLAYOUTWIDGET_OBJECT_NAME_STRING) )
parentLayout = 0;
}
@@ -1832,7 +1832,7 @@ void TQLayoutWidget::updateSizePolicy()
TQObjectListIt it( childrenListObject() );
TQObject *o;
- if ( tqlayout()->inherits(TQVBOXLAYOUT_OBJECT_NAME_STRING) ) {
+ if ( layout()->inherits(TQVBOXLAYOUT_OBJECT_NAME_STRING) ) {
if ( parentLayout && parentLayout->inherits(TQHBOXLAYOUT_OBJECT_NAME_STRING) )
vt = TQSizePolicy::Minimum;
else
@@ -1853,7 +1853,7 @@ void TQLayoutWidget::updateSizePolicy()
if ( w->sizePolicy().mayShrinkVertically() )
vt |= TQSizePolicy::Maximum;
}
- } else if ( tqlayout()->inherits(TQHBOXLAYOUT_OBJECT_NAME_STRING) ) {
+ } else if ( layout()->inherits(TQHBOXLAYOUT_OBJECT_NAME_STRING) ) {
if ( parentLayout && parentLayout->inherits(TQVBOXLAYOUT_OBJECT_NAME_STRING) )
ht = TQSizePolicy::Minimum;
else
@@ -1874,7 +1874,7 @@ void TQLayoutWidget::updateSizePolicy()
if ( !w->sizePolicy().mayShrinkVertically() )
vt &= ~TQSizePolicy::Maximum;
}
- } else if ( tqlayout()->inherits(TQGRIDLAYOUT_OBJECT_NAME_STRING) ) {
+ } else if ( layout()->inherits(TQGRIDLAYOUT_OBJECT_NAME_STRING) ) {
ht = TQSizePolicy::Fixed;
vt = TQSizePolicy::Fixed;
if ( parentLayout ) {
@@ -1901,18 +1901,18 @@ void TQLayoutWidget::updateSizePolicy()
}
}
#ifdef USE_QT4
- if ( tqlayout()->expanding() & TQSizePolicy::Horizontally )
+ if ( layout()->expanding() & TQSizePolicy::Horizontally )
ht = TQSizePolicy::Expanding;
- if ( tqlayout()->expanding() & TQSizePolicy::Vertically )
+ if ( layout()->expanding() & TQSizePolicy::Vertically )
vt = TQSizePolicy::Expanding;
#else // USE_QT4
- if ( tqlayout()->expanding() & TQSizePolicy::Horizontally )
+ if ( layout()->expanding() & TQSizePolicy::Horizontally )
ht = TQSizePolicy::Expanding;
- if ( tqlayout()->expanding() & TQSizePolicy::Vertically )
+ if ( layout()->expanding() & TQSizePolicy::Vertically )
vt = TQSizePolicy::Expanding;
#endif // USE_QT4
- tqlayout()->invalidate();
+ layout()->invalidate();
}
sp = TQSizePolicy( (TQSizePolicy::SizeType) ht, (TQSizePolicy::SizeType) vt );