summaryrefslogtreecommitdiffstats
path: root/kdevdesigner/designer/layout.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-15 15:51:21 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-15 15:51:21 -0600
commitb6ba5d642f3fc7d320e3d6f4650eb259a3a52b04 (patch)
tree76f49820693d443128d3720322ff1605e9bcd558 /kdevdesigner/designer/layout.cpp
parent247f828db1b8dcdc9346c1568d81cfa00db99c9e (diff)
downloadtdevelop-b6ba5d642f3fc7d320e3d6f4650eb259a3a52b04.tar.gz
tdevelop-b6ba5d642f3fc7d320e3d6f4650eb259a3a52b04.zip
Rename a number of old tq methods that are no longer tq specific
Diffstat (limited to 'kdevdesigner/designer/layout.cpp')
-rw-r--r--kdevdesigner/designer/layout.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/kdevdesigner/designer/layout.cpp b/kdevdesigner/designer/layout.cpp
index f908dd4b..89dfe821 100644
--- a/kdevdesigner/designer/layout.cpp
+++ b/kdevdesigner/designer/layout.cpp
@@ -25,11 +25,11 @@
**********************************************************************/
#include "formwindow.h"
-#include "tqlayout.h"
+#include "layout.h"
#include <widgetdatabase.h>
#include "widgetfactory.h"
-#include <tqlayout.h>
+#include <layout.h>
#include <tqevent.h>
#include <tqpainter.h>
#include <tqpen.h>
@@ -44,7 +44,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
@@ -67,7 +67,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
@@ -85,7 +85,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.
@@ -120,7 +120,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 ||
@@ -133,11 +133,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
@@ -149,7 +149,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();
}
}
@@ -182,7 +182,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 );
@@ -193,7 +193,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();
@@ -236,7 +236,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 ||
@@ -311,16 +311,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 ( ::tqqt_cast<TQLayoutWidget*>(w) )
( (TQLayoutWidget*)w )->updateSizePolicy();
}
@@ -330,7 +330,7 @@ void HorizontalLayout::doLayout()
if ( ::tqqt_cast<TQSplitter*>(layoutBase) )
( (TQSplitter*)layoutBase )->setOrientation( Qt::Horizontal );
- finishLayout( needMove, tqlayout );
+ finishLayout( needMove, layout );
}
@@ -375,16 +375,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 ( ::tqqt_cast<TQLayoutWidget*>(w) )
( (TQLayoutWidget*)w )->updateSizePolicy();
}
@@ -394,7 +394,7 @@ void VerticalLayout::doLayout()
if ( ::tqqt_cast<TQSplitter*>(layoutBase) )
( (TQSplitter*)layoutBase )->setOrientation( Qt::Vertical );
- finishLayout( needMove, tqlayout );
+ finishLayout( needMove, layout );
}
@@ -747,7 +747,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();
@@ -759,18 +759,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, ::tqqt_cast<Spacer*>(w) ? ( (Spacer*)w )->tqalignment() : 0 );
+ layout->addWidget( w, r, c, ::tqqt_cast<Spacer*>(w) ? ( (Spacer*)w )->alignment() : 0 );
} else {
- tqlayout->addMultiCellWidget( w, r, r+rs-1, c, c+cs-1, ::tqqt_cast<Spacer*>(w) ? ( (Spacer*)w )->tqalignment() : 0 );
+ layout->addMultiCellWidget( w, r, r+rs-1, c, c+cs-1, ::tqqt_cast<Spacer*>(w) ? ( (Spacer*)w )->alignment() : 0 );
}
if ( ::tqqt_cast<TQLayoutWidget*>(w) )
( (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()
@@ -787,7 +787,7 @@ void GridLayout::buildGrid()
// Pixel to cell conversion:
// By keeping a list of start'n'stop values (x & y) for each widget,
// it is possible to create a very small grid of cells to represent
- // the widget tqlayout.
+ // the widget layout.
// -----------------------------------------------------------------
// We need a list of both start and stop values for x- & y-axis
@@ -798,7 +798,7 @@ void GridLayout::buildGrid()
int index = 0;
TQWidget* w = 0;
for ( w = widgets.first(); w; w = widgets.next() ) {
- TQRect widgetPos = w->tqgeometry();
+ TQRect widgetPos = w->geometry();
x[index] = widgetPos.left();
x[index+1] = widgetPos.right();
y[index] = widgetPos.top();
@@ -829,7 +829,7 @@ void GridLayout::buildGrid()
current++;
}
- // Create the smallest grid possible to represent the current tqlayout
+ // Create the smallest grid possible to represent the current layout
// Since no widget will be placed in the last row and column, we'll
// skip them to increase speed even further
delete grid;
@@ -837,7 +837,7 @@ void GridLayout::buildGrid()
// Mark the cells in the grid that contains a widget
for ( w = widgets.first(); w; w = widgets.next() ) {
- TQRect c(0,0,0,0), widgetPos = w->tqgeometry();
+ TQRect c(0,0,0,0), widgetPos = w->geometry();
// From left til right (not including)
for (uint cw=0; cw<x.size(); cw++) {
if ( x[cw] == widgetPos.left() )
@@ -936,25 +936,25 @@ 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
{
TQSize s = TQSize( 20,20 );
if ( sizeType() == Expanding )
@@ -965,7 +965,7 @@ TQSize Spacer::tqminimumSize() const
return s;
}
-TQSize Spacer::tqsizeHint() const
+TQSize Spacer::sizeHint() const
{
return sh;
}
@@ -975,7 +975,7 @@ void Spacer::setSizeHint( const TQSize &s )
{
sh = s;
if ( !parentWidget() || WidgetFactory::layoutType( parentWidget() ) == WidgetFactory::NoLayout )
- resize( tqsizeHint() );
+ resize( sizeHint() );
updateGeometry();
}