summaryrefslogtreecommitdiffstats
path: root/kommander/editor/layout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kommander/editor/layout.cpp')
-rw-r--r--kommander/editor/layout.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/kommander/editor/layout.cpp b/kommander/editor/layout.cpp
index dca00c38..5ba769db 100644
--- a/kommander/editor/layout.cpp
+++ b/kommander/editor/layout.cpp
@@ -19,7 +19,7 @@
**********************************************************************/
#include "formwindow.h"
-#include "tqlayout.h"
+#include "layout.h"
#include "widgetdatabase.h"
#include "widgetfactory.h"
@@ -36,7 +36,7 @@ bool operator<( const TQGuardedPtr<TQWidget> &p1, const TQGuardedPtr<TQWidget> &
}
/*!
- \class Layout tqlayout.h
+ \class Layout layout.h
\brief Baseclass for layouting widgets in the Designer
Classes derived from this abstract base class are used for layouting
@@ -59,7 +59,7 @@ Layout::Layout( const TQWidgetList &wl, TQWidget *p, FormWindow *fw, TQWidget *l
widgets.setAutoDelete( false );
layoutBase = lb;
if ( !doSetup && layoutBase )
- oldGeometry = layoutBase->tqgeometry();
+ oldGeometry = layoutBase->geometry();
}
/*! The widget list we got in the constructor might contain too much
@@ -77,7 +77,7 @@ void Layout::setup()
TQWidget *w = 0;
// Go through all widgets of the list we got. As we can only
- // tqlayout widgets which have the same parent, we first do some
+ // layout widgets which have the same parent, we first do some
// sorting which means create a list for each parent containing
// its child here. After that we keep working on the list of
// childs which has the most entries.
@@ -112,7 +112,7 @@ void Layout::setup()
}
// If we found no list (because no widget did fit at all) or the
- // best list has only one entry and we do not tqlayout a container,
+ // best list has only one entry and we do not layout a container,
// we leave here.
if ( !lastList || ( lastList->count() < 2 &&
( !layoutBase ||
@@ -125,11 +125,11 @@ void Layout::setup()
}
// Now we have a new and clean widget list, which makes sense
- // to tqlayout
+ // to layout
widgets = *lastList;
// Also use the only correct parent later, so store it
parent = WidgetFactory::widgetOfContainer( widgets.first()->parentWidget() );
- // Now calculate the position where the tqlayout-meta-widget should
+ // Now calculate the position where the layout-meta-widget should
// be placed and connect to widgetDestroyed() signals of the
// widgets to get informed if one gets deleted to be able to
// handle that and do not crash in this case
@@ -141,7 +141,7 @@ void Layout::setup()
geometries.insert( w, TQRect( w->pos(), w->size() ) );
// Change the Z-order, as saving/loading uses the Z-order for
// writing/creating widgets and this has to be the same as in
- // the tqlayout. Else saving + loading will give different results
+ // the layout. Else saving + loading will give different results
w->raise();
}
}
@@ -174,7 +174,7 @@ bool Layout::prepareLayout( bool &needMove, bool &needReparent )
return true;
}
-void Layout::finishLayout( bool needMove, TQLayout *tqlayout )
+void Layout::finishLayout( bool needMove, TQLayout *layout )
{
if ( needMove )
layoutBase->move( startPoint );
@@ -185,7 +185,7 @@ void Layout::finishLayout( bool needMove, TQLayout *tqlayout )
layoutBase->setGeometry( oldGeometry );
oldGeometry = g;
layoutBase->show();
- tqlayout->activate();
+ layout->activate();
formWindow->insertWidget( layoutBase );
formWindow->selectWidget( TQT_TQOBJECT(layoutBase) );
TQString n = layoutBase->name();
@@ -228,7 +228,7 @@ void Layout::breakLayout()
if ( !widgets.isEmpty() ) {
TQWidget *w;
for ( w = widgets.first(); w; w = widgets.next() )
- rects.insert( w, w->tqgeometry() );
+ rects.insert( w, w->geometry() );
}
WidgetFactory::deleteLayout( layoutBase );
bool needReparent = qstrcmp( layoutBase->className(), TQLAYOUTWIDGET_OBJECT_NAME_STRING ) == 0 ||
@@ -303,16 +303,16 @@ void HorizontalLayout::doLayout()
if ( !prepareLayout( needMove, needReparent ) )
return;
- TQHBoxLayout *tqlayout = (TQHBoxLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::HBox );
+ TQHBoxLayout *layout = (TQHBoxLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::HBox );
for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) {
if ( needReparent && TQT_BASE_OBJECT(w->parent()) != TQT_BASE_OBJECT(layoutBase) )
w->reparent( layoutBase, 0, TQPoint( 0, 0 ), false );
if ( !useSplitter ) {
if ( qstrcmp( w->className(), "Spacer" ) == 0 )
- tqlayout->addWidget( w, 0, ( (Spacer*)w )->tqalignment() );
+ layout->addWidget( w, 0, ( (Spacer*)w )->alignment() );
else
- tqlayout->addWidget( w );
+ layout->addWidget( w );
if ( w->inherits( TQLAYOUTWIDGET_OBJECT_NAME_STRING ) )
( (TQLayoutWidget*)w )->updateSizePolicy();
}
@@ -322,7 +322,7 @@ void HorizontalLayout::doLayout()
if ( layoutBase->inherits( TQSPLITTER_OBJECT_NAME_STRING ) )
( (TQSplitter*)layoutBase )->setOrientation( Qt::Horizontal );
- finishLayout( needMove, tqlayout );
+ finishLayout( needMove, layout );
}
@@ -367,16 +367,16 @@ void VerticalLayout::doLayout()
if ( !prepareLayout( needMove, needReparent ) )
return;
- TQVBoxLayout *tqlayout = (TQVBoxLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::VBox );
+ TQVBoxLayout *layout = (TQVBoxLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::VBox );
for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) {
if ( needReparent && TQT_BASE_OBJECT(w->parent()) != TQT_BASE_OBJECT(layoutBase) )
w->reparent( layoutBase, 0, TQPoint( 0, 0 ), false );
if ( !useSplitter ) {
if ( qstrcmp( w->className(), "Spacer" ) == 0 )
- tqlayout->addWidget( w, 0, ( (Spacer*)w )->tqalignment() );
+ layout->addWidget( w, 0, ( (Spacer*)w )->alignment() );
else
- tqlayout->addWidget( w );
+ layout->addWidget( w );
if ( w->inherits( TQLAYOUTWIDGET_OBJECT_NAME_STRING ) )
( (TQLayoutWidget*)w )->updateSizePolicy();
}
@@ -386,7 +386,7 @@ void VerticalLayout::doLayout()
if ( layoutBase->inherits( TQSPLITTER_OBJECT_NAME_STRING ) )
( (TQSplitter*)layoutBase )->setOrientation( Qt::Vertical );
- finishLayout( needMove, tqlayout );
+ finishLayout( needMove, layout );
}
@@ -733,7 +733,7 @@ void GridLayout::doLayout()
if ( !prepareLayout( needMove, needReparent ) )
return;
- QDesignerGridLayout *tqlayout = (QDesignerGridLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::Grid );
+ QDesignerGridLayout *layout = (QDesignerGridLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::Grid );
if ( !grid )
buildGrid();
@@ -745,18 +745,18 @@ void GridLayout::doLayout()
if ( needReparent && TQT_BASE_OBJECT(w->parent()) != TQT_BASE_OBJECT(layoutBase) )
w->reparent( layoutBase, 0, TQPoint( 0, 0 ), false );
if ( rs * cs == 1 ) {
- tqlayout->addWidget( w, r, c, w->inherits( "Spacer" ) ? ( (Spacer*)w )->tqalignment() : 0 );
+ layout->addWidget( w, r, c, w->inherits( "Spacer" ) ? ( (Spacer*)w )->alignment() : 0 );
} else {
- tqlayout->addMultiCellWidget( w, r, r+rs-1, c, c+cs-1, w->inherits( "Spacer" ) ? ( (Spacer*)w )->tqalignment() : 0 );
+ layout->addMultiCellWidget( w, r, r+rs-1, c, c+cs-1, w->inherits( "Spacer" ) ? ( (Spacer*)w )->alignment() : 0 );
}
if ( w->inherits( TQLAYOUTWIDGET_OBJECT_NAME_STRING ) )
( (TQLayoutWidget*)w )->updateSizePolicy();
w->show();
} else {
- qWarning("ooops, widget '%s' does not fit in tqlayout", w->name() );
+ qWarning("ooops, widget '%s' does not fit in layout", w->name() );
}
}
- finishLayout( needMove, tqlayout );
+ finishLayout( needMove, layout );
}
void GridLayout::setup()
@@ -770,7 +770,7 @@ void GridLayout::buildGrid()
TQWidget* w;
TQRect br;
for ( w = widgets.first(); w; w = widgets.next() )
- br = br.unite( w->tqgeometry() );
+ br = br.unite( w->geometry() );
delete grid;
grid = new Grid( br.height() / resolution.height() + 1,
@@ -784,7 +784,7 @@ void GridLayout::buildGrid()
TQRect cr( p, resolution );
for ( w = widgets.first(); w; w = widgets.next() ) {
// check that the overlap is significant
- TQRect intersect = cr.intersect( w->tqgeometry() );
+ TQRect intersect = cr.intersect( w->geometry() );
if ( intersect.size().width() > resolution.width()/2 &&
intersect.size().height() > resolution.height()/2 ) {
grid->setCell( r, c, w );
@@ -874,30 +874,30 @@ void Spacer::setSizeType( SizeType t )
sizeP = TQSizePolicy( TQSizePolicy::Minimum, (TQSizePolicy::SizeType)t );
else
sizeP = TQSizePolicy( (TQSizePolicy::SizeType)t, TQSizePolicy::Minimum );
- tqsetSizePolicy( sizeP );
+ setSizePolicy( sizeP );
}
Spacer::SizeType Spacer::sizeType() const
{
if ( orient ==Qt::Vertical )
- return (SizeType)tqsizePolicy().verData();
- return (SizeType)tqsizePolicy().horData();
+ return (SizeType)sizePolicy().verData();
+ return (SizeType)sizePolicy().horData();
}
-int Spacer::tqalignment() const
+int Spacer::alignment() const
{
if ( orient ==Qt::Vertical )
return AlignHCenter;
return AlignVCenter;
}
-TQSize Spacer::tqminimumSize() const
+TQSize Spacer::minimumSize() const
{
return TQSize( 20, 20 );
}
-TQSize Spacer::tqsizeHint() const
+TQSize Spacer::sizeHint() const
{
TQSize s = sh.expandedTo( TQSize(0,0) );
if ( sizeType() == Expanding )
@@ -913,7 +913,7 @@ void Spacer::setSizeHint( const TQSize &s )
{
sh = s;
if ( !parentWidget() || WidgetFactory::layoutType( parentWidget() ) == WidgetFactory::NoLayout )
- resize( tqsizeHint() );
+ resize( sizeHint() );
updateGeometry();
}