summaryrefslogtreecommitdiffstats
path: root/kdgantt/KDGanttMinimizeSplitter.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-13 00:46:47 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-13 00:46:47 +0000
commit67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 (patch)
tree5f52a9eada2e9f3654fc327d7c14dfef570a6ecb /kdgantt/KDGanttMinimizeSplitter.cpp
parent2ee4bf4fd5eff93b2fbef0ff8e8063edffc5da5c (diff)
downloadtdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.tar.gz
tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.zip
Initial conversion of kdepim to TQt
This will probably require some tweaking before it will build under Qt4, however Qt3 builds are OK. Any alterations this commit makes to kdepim behaviour under Qt3 are unintentional and should be fixed. git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227832 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdgantt/KDGanttMinimizeSplitter.cpp')
-rw-r--r--kdgantt/KDGanttMinimizeSplitter.cpp210
1 files changed, 93 insertions, 117 deletions
diff --git a/kdgantt/KDGanttMinimizeSplitter.cpp b/kdgantt/KDGanttMinimizeSplitter.cpp
index 7f2df6e8..da6744c8 100644
--- a/kdgantt/KDGanttMinimizeSplitter.cpp
+++ b/kdgantt/KDGanttMinimizeSplitter.cpp
@@ -26,26 +26,19 @@
** licensing are not clear to you.
**
** As a special exception, permission is given to link this program
- ** with any edition of Qt, and distribute the resulting executable,
- ** without including the source code for Qt in the source distribution.
+ ** with any edition of TQt, and distribute the resulting executable,
+ ** without including the source code for TQt in the source distribution.
**
**********************************************************************/
#include "KDGanttMinimizeSplitter.h"
-#ifndef QT_NO_SPLITTER
+#ifndef TQT_NO_SPLITTER
#include "tqpainter.h"
#include "tqdrawutil.h"
#include "tqbitmap.h"
-#if QT_VERSION >= 300
#include "tqptrlist.h"
#include "tqmemarray.h"
-#else
-#include <tqlist.h>
-#include <tqarray.h>
-#define TQPtrList QList
-#define TQMemArray QArray
-#endif
#include "tqlayout.h"
#include "tqlayoutengine_p.h"
#include "tqobjectlist.h"
@@ -53,23 +46,20 @@
#include "tqapplication.h" //sendPostedEvents
#include <tqvaluelist.h>
#include <tqcursor.h>
-#ifndef KDGANTT_MASTER_CVS
-#include "KDGanttMinimizeSplitter.moc"
-#endif
+#include "KDGanttMinimizeSplitter.moc"
#ifndef DOXYGEN_SKIP_INTERNAL
-#if QT_VERSION >= 300
static int mouseOffset;
static int opaqueOldPos = -1; //### there's only one mouse, but this is a bit risky
KDGanttSplitterHandle::KDGanttSplitterHandle( Qt::Orientation o,
- KDGanttMinimizeSplitter *parent, const char * name )
- : TQWidget( parent, name ), _activeButton( 0 ), _collapsed( false )
+ KDGanttMinimizeSplitter *tqparent, const char * name )
+ : TQWidget( tqparent, name ), _activeButton( 0 ), _collapsed( false )
{
- s = parent;
+ s = tqparent;
setOrientation(o);
setMouseTracking( true );
}
@@ -82,7 +72,7 @@ TQSize KDGanttSplitterHandle::tqsizeHint() const
void KDGanttSplitterHandle::setOrientation( Qt::Orientation o )
{
orient = o;
-#ifndef QT_NO_CURSOR
+#ifndef TQT_NO_CURSOR
if ( o == KDGanttMinimizeSplitter::Horizontal )
setCursor( splitHCursor );
else
@@ -100,14 +90,14 @@ void KDGanttSplitterHandle::mouseMoveEvent( TQMouseEvent *e )
if ( _activeButton != 0)
return;
- QCOORD pos = s->pick(tqparentWidget()->mapFromGlobal(e->globalPos()))
+ TQCOORD pos = s->pick(tqparentWidget()->mapFromGlobal(e->globalPos()))
- mouseOffset;
if ( opaque() ) {
s->moveSplitter( pos, id() );
} else {
int min = pos; int max = pos;
s->getRange( id(), &min, &max );
- s->setRubberband( QMAX( min, QMIN(max, pos )));
+ s->setRubberband( TQMAX( min, TQMIN(max, pos )));
}
_collapsed = false;
}
@@ -169,7 +159,7 @@ void KDGanttSplitterHandle::mouseReleaseEvent( TQMouseEvent *e )
}
else {
if ( !opaque() && e->button() == LeftButton ) {
- QCOORD pos = s->pick(tqparentWidget()->mapFromGlobal(e->globalPos()))
+ TQCOORD pos = s->pick(tqparentWidget()->mapFromGlobal(e->globalPos()))
- mouseOffset;
s->setRubberband( -1 );
s->moveSplitter( pos, id() );
@@ -292,23 +282,22 @@ void KDGanttSplitterHandle::paintEvent( TQPaintEvent * )
}
bitBlt( this, 0, 0, &buffer );
}
-#endif
-class QSplitterLayoutStruct
+class TQSplitterLayoutStruct
{
public:
KDGanttMinimizeSplitter::ResizeMode mode;
- QCOORD sizer;
+ TQCOORD sizer;
bool isSplitter;
TQWidget *wid;
};
-class QSplitterData
+class TQSplitterData
{
public:
- QSplitterData() : opaque( FALSE ), firstShow( TRUE ) {}
+ TQSplitterData() : opaque( FALSE ), firstShow( TRUE ) {}
- TQPtrList<QSplitterLayoutStruct> list;
+ TQPtrList<TQSplitterLayoutStruct> list;
bool opaque;
bool firstShow;
};
@@ -323,34 +312,34 @@ void kdganttGeomCalc( TQMemArray<QLayoutStruct> &chain, int start, int count, in
\brief The KDGanttMinimizeSplitter class implements a splitter
widget with minimize buttons.
- This class (and its documentation) is largely a copy of Qt's
+ This class (and its documentation) is largely a copy of TQt's
TQSplitter; the copying was necessary because TQSplitter is not
extensible at all. TQSplitter and its documentation are licensed
- according to the GPL and the Qt Professional License (if you hold
+ according to the GPL and the TQt Professional License (if you hold
such a license) and are (C) Trolltech AS.
A splitter lets the user control the size of child widgets by
- dragging the boundary between the children. Any number of widgets
+ dragging the boundary between the tqchildren. Any number of widgets
may be controlled.
To show a TQListBox, a TQListView and a TQTextEdit side by side:
\code
- KDGanttMinimizeSplitter *split = new KDGanttMinimizeSplitter( parent );
+ KDGanttMinimizeSplitter *split = new KDGanttMinimizeSplitter( tqparent );
TQListBox *lb = new TQListBox( split );
TQListView *lv = new TQListView( split );
TQTextEdit *ed = new TQTextEdit( split );
\endcode
In KDGanttMinimizeSplitter, the boundary can be either horizontal or
- vertical. The default is horizontal (the children are side by side)
+ vertical. The default is horizontal (the tqchildren are side by side)
but you can use setOrientation( TQSplitter::Vertical ) to set it to
vertical.
Use setResizeMode() to specify
that a widget should keep its size when the splitter is resized.
- Although KDGanttMinimizeSplitter normally resizes the children only
+ Although KDGanttMinimizeSplitter normally resizes the tqchildren only
at the end of a resize operation, if you call setOpaqueResize( TRUE
) the widgets are resized as often as possible.
@@ -360,7 +349,7 @@ void kdganttGeomCalc( TQMemArray<QLayoutStruct> &chain, int start, int count, in
sizes set by the user.
If you hide() a child, its space will be distributed among the other
- children. It will be reinstated when you show() it again. It is also
+ tqchildren. It will be reinstated when you show() it again. It is also
possible to reorder the widgets within the splitter using
moveToFirst() and moveToLast().
*/
@@ -389,53 +378,45 @@ static TQSize minSizeHint( const TQWidget* w )
/*!
- Constructs a horizontal splitter with the \a parent and \a
+ Constructs a horizontal splitter with the \a tqparent and \a
name arguments being passed on to the TQFrame constructor.
*/
-KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( TQWidget *parent, const char *name )
- :TQFrame(parent,name,WPaintUnclipped)
+KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( TQWidget *tqparent, const char *name )
+ :TQFrame(tqparent,name,WPaintUnclipped)
{
-#if QT_VERSION >= 300
orient = Horizontal;
init();
-#endif
}
/*!
- Constructs a splitter with orientation \a o with the \a parent
+ Constructs a splitter with orientation \a o with the \a tqparent
and \a name arguments being passed on to the TQFrame constructor.
*/
-KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( Orientation o, TQWidget *parent, const char *name )
- :TQFrame(parent,name,WPaintUnclipped)
+KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( Qt::Orientation o, TQWidget *tqparent, const char *name )
+ :TQFrame(tqparent,name,WPaintUnclipped)
{
-#if QT_VERSION >= 300
orient = o;
init();
-#endif
}
/*!
- Destroys the splitter and any children.
+ Destroys the splitter and any tqchildren.
*/
KDGanttMinimizeSplitter::~KDGanttMinimizeSplitter()
{
-#if QT_VERSION >= 300
data->list.setAutoDelete( TRUE );
delete data;
-#endif
}
-#if QT_VERSION >= 300
void KDGanttMinimizeSplitter::init()
{
- data = new QSplitterData;
+ data = new TQSplitterData;
if ( orient == Horizontal )
tqsetSizePolicy( TQSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Minimum) );
else
tqsetSizePolicy( TQSizePolicy(TQSizePolicy::Minimum,TQSizePolicy::Expanding) );
}
-#endif
@@ -443,11 +424,10 @@ void KDGanttMinimizeSplitter::init()
\brief the orientation of the splitter
By default the orientation is horizontal (the widgets are side by side).
- The possible orientations are Qt:Vertical and Qt::Horizontal (the default).
+ The possible orientations are TQt:Vertical and TQt::Horizontal (the default).
*/
-void KDGanttMinimizeSplitter::setOrientation( Orientation o )
+void KDGanttMinimizeSplitter::setOrientation( Qt::Orientation o )
{
-#if QT_VERSION >= 300
if ( orient == o )
return;
orient = o;
@@ -457,18 +437,16 @@ void KDGanttMinimizeSplitter::setOrientation( Orientation o )
else
tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Expanding ) );
- QSplitterLayoutStruct *s = data->list.first();
+ TQSplitterLayoutStruct *s = data->list.first();
while ( s ) {
if ( s->isSplitter )
((KDGanttSplitterHandle*)s->wid)->setOrientation( o );
s = data->list.next(); // ### next at end of loop, no iterator
}
recalc( isVisible() );
-#endif
}
-#if QT_VERSION >= 300
/*!
Reimplemented from superclass.
*/
@@ -487,12 +465,12 @@ void KDGanttMinimizeSplitter::resizeEvent( TQResizeEvent * )
needed. (If \a first is TRUE, then recalcId is very probably
needed.)
*/
-QSplitterLayoutStruct *KDGanttMinimizeSplitter::addWidget( TQWidget *w, bool first )
+TQSplitterLayoutStruct *KDGanttMinimizeSplitter::addWidget( TQWidget *w, bool first )
{
- QSplitterLayoutStruct *s;
+ TQSplitterLayoutStruct *s;
KDGanttSplitterHandle *newHandle = 0;
if ( data->list.count() > 0 ) {
- s = new QSplitterLayoutStruct;
+ s = new TQSplitterLayoutStruct;
s->mode = KeepSize;
TQString tmp = "qt_splithandle_";
tmp += w->name();
@@ -506,7 +484,7 @@ QSplitterLayoutStruct *KDGanttMinimizeSplitter::addWidget( TQWidget *w, bool fir
else
data->list.append( s );
}
- s = new QSplitterLayoutStruct;
+ s = new TQSplitterLayoutStruct;
s->mode = Stretch;
s->wid = w;
if ( !testWState( WState_Resized ) && w->tqsizeHint().isValid() )
@@ -537,7 +515,7 @@ void KDGanttMinimizeSplitter::childEvent( TQChildEvent *c )
if ( ((TQWidget*)c->child())->testWFlags( WType_TopLevel ) )
return;
- QSplitterLayoutStruct *s = data->list.first();
+ TQSplitterLayoutStruct *s = data->list.first();
while ( s ) {
if ( s->wid == c->child() )
return;
@@ -547,10 +525,10 @@ void KDGanttMinimizeSplitter::childEvent( TQChildEvent *c )
recalc( isVisible() );
} else if ( c->type() == TQEvent::ChildRemoved ) {
- QSplitterLayoutStruct *p = 0;
+ TQSplitterLayoutStruct *p = 0;
if ( data->list.count() > 1 )
p = data->list.at(1); //remove handle _after_ first widget.
- QSplitterLayoutStruct *s = data->list.first();
+ TQSplitterLayoutStruct *s = data->list.first();
while ( s ) {
if ( s->wid == c->child() ) {
data->list.removeRef( s );
@@ -621,10 +599,10 @@ bool KDGanttMinimizeSplitter::event( TQEvent *e )
\sa TQStyle::drawPrimitive()
*/
void KDGanttMinimizeSplitter::drawSplitter( TQPainter *p,
- QCOORD x, QCOORD y, QCOORD w, QCOORD h )
+ TQCOORD x, TQCOORD y, TQCOORD w, TQCOORD h )
{
style().drawPrimitive(TQStyle::PE_Splitter, p, TQRect(x, y, w, h), tqcolorGroup(),
- (orientation() == Qt::Horizontal ?
+ (orientation() == TQt::Horizontal ?
TQStyle::Style_Horizontal : 0));
}
@@ -636,7 +614,7 @@ void KDGanttMinimizeSplitter::drawSplitter( TQPainter *p,
*/
int KDGanttMinimizeSplitter::idAfter( TQWidget* w ) const
{
- QSplitterLayoutStruct *s = data->list.first();
+ TQSplitterLayoutStruct *s = data->list.first();
bool seen_w = FALSE;
while ( s ) {
if ( s->isSplitter && seen_w )
@@ -661,11 +639,11 @@ int KDGanttMinimizeSplitter::idAfter( TQWidget* w ) const
\sa idAfter()
*/
-void KDGanttMinimizeSplitter::moveSplitter( QCOORD p, int id )
+void KDGanttMinimizeSplitter::moveSplitter( TQCOORD p, int id )
{
p = adjustPos( p, id );
- QSplitterLayoutStruct *s = data->list.at(id);
+ TQSplitterLayoutStruct *s = data->list.at(id);
int oldP = orient == Horizontal ? s->wid->x() : s->wid->y();
bool upLeft;
if ( TQApplication::reverseLayout() && orient == Horizontal ) {
@@ -701,7 +679,7 @@ void KDGanttMinimizeSplitter::moveBefore( int pos, int id, bool upLeft )
{
if( id < 0 )
return;
- QSplitterLayoutStruct *s = data->list.at(id);
+ TQSplitterLayoutStruct *s = data->list.at(id);
if ( !s )
return;
TQWidget *w = s->wid;
@@ -728,12 +706,12 @@ void KDGanttMinimizeSplitter::moveBefore( int pos, int id, bool upLeft )
int dd, newLeft, nextPos;
if( TQApplication::reverseLayout() && orient == Horizontal ) {
dd = w->tqgeometry().right() - pos;
- dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->tqmaximumSize())));
+ dd = TQMAX( pick(minSize(w)), TQMIN(dd, pick(w->tqmaximumSize())));
newLeft = pos+1;
nextPos = newLeft + dd;
} else {
dd = pos - pick( w->pos() ) + 1;
- dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->tqmaximumSize())));
+ dd = TQMAX( pick(minSize(w)), TQMIN(dd, pick(w->tqmaximumSize())));
newLeft = pos-dd+1;
nextPos = newLeft - 1;
}
@@ -750,7 +728,7 @@ void KDGanttMinimizeSplitter::moveBefore( int pos, int id, bool upLeft )
*/
void KDGanttMinimizeSplitter::moveAfter( int pos, int id, bool upLeft )
{
- QSplitterLayoutStruct *s = id < int(data->list.count()) ?
+ TQSplitterLayoutStruct *s = id < int(data->list.count()) ?
data->list.at(id) : 0;
if ( !s )
return;
@@ -782,13 +760,13 @@ void KDGanttMinimizeSplitter::moveAfter( int pos, int id, bool upLeft )
int right, dd,/* newRight,*/ newLeft, nextPos;
if ( TQApplication::reverseLayout() && orient == Horizontal ) {
dd = pos - left + 1;
- dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->tqmaximumSize())));
+ dd = TQMAX( pick(minSize(w)), TQMIN(dd, pick(w->tqmaximumSize())));
newLeft = pos-dd+1;
nextPos = newLeft - 1;
} else {
right = pick( w->tqgeometry().bottomRight() );
dd = right - pos + 1;
- dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->tqmaximumSize())));
+ dd = TQMAX( pick(minSize(w)), TQMIN(dd, pick(w->tqmaximumSize())));
/*newRight = pos+dd-1;*/
newLeft = pos;
nextPos = newLeft + dd;
@@ -802,7 +780,7 @@ void KDGanttMinimizeSplitter::moveAfter( int pos, int id, bool upLeft )
void KDGanttMinimizeSplitter::expandPos( int id, int* min, int* max )
{
- QSplitterLayoutStruct *s = data->list.at(id-1);
+ TQSplitterLayoutStruct *s = data->list.at(id-1);
TQWidget* w = s->wid;
*min = pick( w->mapToParent( TQPoint(0,0) ) );
@@ -810,7 +788,7 @@ void KDGanttMinimizeSplitter::expandPos( int id, int* min, int* max )
pick( size() );
}
else {
- QSplitterLayoutStruct *s = data->list.at(id+1);
+ TQSplitterLayoutStruct *s = data->list.at(id+1);
TQWidget* w = s->wid;
*max = pick( w->mapToParent( TQPoint( w->width(), w->height() ) ) ) -8;
}
@@ -834,7 +812,7 @@ void KDGanttMinimizeSplitter::getRange( int id, int *min, int *max )
return;
int i;
for ( i = 0; i < id; i++ ) {
- QSplitterLayoutStruct *s = data->list.at(i);
+ TQSplitterLayoutStruct *s = data->list.at(i);
if ( s->wid->isHidden() ) {
//ignore
} else if ( s->isSplitter ) {
@@ -846,7 +824,7 @@ void KDGanttMinimizeSplitter::getRange( int id, int *min, int *max )
}
}
for ( i = id; i < n; i++ ) {
- QSplitterLayoutStruct *s = data->list.at(i);
+ TQSplitterLayoutStruct *s = data->list.at(i);
if ( s->wid->isHidden() ) {
//ignore
} else if ( s->isSplitter ) {
@@ -861,14 +839,14 @@ void KDGanttMinimizeSplitter::getRange( int id, int *min, int *max )
if ( orient == Horizontal && TQApplication::reverseLayout() ) {
int splitterWidth = style().tqpixelMetric(TQStyle::PM_SplitterWidth, this);
if ( min )
- *min = pick(r.topRight()) - QMIN( maxB, pick(r.size())-minA ) - splitterWidth;
+ *min = pick(r.topRight()) - TQMIN( maxB, pick(r.size())-minA ) - splitterWidth;
if ( max )
- *max = pick(r.topRight()) - QMAX( minB, pick(r.size())-maxA ) - splitterWidth;
+ *max = pick(r.topRight()) - TQMAX( minB, pick(r.size())-maxA ) - splitterWidth;
} else {
if ( min )
- *min = pick(r.topLeft()) + QMAX( minB, pick(r.size())-maxA );
+ *min = pick(r.topLeft()) + TQMAX( minB, pick(r.size())-maxA );
if ( max )
- *max = pick(r.topLeft()) + QMIN( maxB, pick(r.size())-minA );
+ *max = pick(r.topLeft()) + TQMIN( maxB, pick(r.size())-minA );
}
}
@@ -884,7 +862,7 @@ int KDGanttMinimizeSplitter::adjustPos( int p, int id )
int min = 0;
int max = 0;
getRange( id, &min, &max );
- p = QMAX( min, QMIN( p, max ) );
+ p = TQMAX( min, TQMIN( p, max ) );
return p;
}
@@ -898,7 +876,7 @@ void KDGanttMinimizeSplitter::doResize()
TQMemArray<QLayoutStruct> a( n );
for ( i = 0; i< n; i++ ) {
a[i].init();
- QSplitterLayoutStruct *s = data->list.at(i);
+ TQSplitterLayoutStruct *s = data->list.at(i);
if ( s->wid->isHidden() ) {
a[i].stretch = 0;
a[i].tqsizeHint = a[i].tqminimumSize = 0;
@@ -929,7 +907,7 @@ void KDGanttMinimizeSplitter::doResize()
kdganttGeomCalc( a, 0, n, pick( r.topLeft() ), pick( r.size() ), 0 );
for ( i = 0; i< n; i++ ) {
- QSplitterLayoutStruct *s = data->list.at(i);
+ TQSplitterLayoutStruct *s = data->list.at(i);
setG( s->wid, a[i].pos, a[i].size );
}
@@ -941,7 +919,7 @@ void KDGanttMinimizeSplitter::recalc( bool update )
int fi = 2*frameWidth();
int maxl = fi;
int minl = fi;
- int maxt = QWIDGETSIZE_MAX;
+ int maxt = TQWIDGETSIZE_MAX;
int mint = fi;
int n = data->list.count();
bool first = TRUE;
@@ -951,9 +929,9 @@ void KDGanttMinimizeSplitter::recalc( bool update )
The splitter before any other visible widget is visible.
*/
for ( int i = 0; i< n; i++ ) {
- QSplitterLayoutStruct *s = data->list.at(i);
+ TQSplitterLayoutStruct *s = data->list.at(i);
if ( !s->isSplitter ) {
- QSplitterLayoutStruct *p = (i > 0) ? data->list.at( i-1 ) : 0;
+ TQSplitterLayoutStruct *p = (i > 0) ? data->list.at( i-1 ) : 0;
if ( p && p->isSplitter )
if ( first || s->wid->isHidden() )
p->wid->hide(); //may trigger new recalc
@@ -966,7 +944,7 @@ void KDGanttMinimizeSplitter::recalc( bool update )
bool empty=TRUE;
for ( int j = 0; j< n; j++ ) {
- QSplitterLayoutStruct *s = data->list.at(j);
+ TQSplitterLayoutStruct *s = data->list.at(j);
if ( !s->wid->isHidden() ) {
empty = FALSE;
if ( s->isSplitter ) {
@@ -976,10 +954,10 @@ void KDGanttMinimizeSplitter::recalc( bool update )
TQSize minS = minSize(s->wid);
minl += pick( minS );
maxl += pick( s->wid->tqmaximumSize() );
- mint = QMAX( mint, trans( minS ));
+ mint = TQMAX( mint, trans( minS ));
int tm = trans( s->wid->tqmaximumSize() );
if ( tm > 0 )
- maxt = QMIN( maxt, tm );
+ maxt = TQMIN( maxt, tm );
}
}
}
@@ -988,11 +966,11 @@ void KDGanttMinimizeSplitter::recalc( bool update )
// nested splitters; be nice
maxl = maxt = 0;
} else {
- // KDGanttMinimizeSplitter with no children yet
- maxl = QWIDGETSIZE_MAX;
+ // KDGanttMinimizeSplitter with no tqchildren yet
+ maxl = TQWIDGETSIZE_MAX;
}
} else {
- maxl = QMIN( maxl, QWIDGETSIZE_MAX );
+ maxl = TQMIN( maxl, TQWIDGETSIZE_MAX );
}
if ( maxt < mint )
maxt = mint;
@@ -1017,7 +995,7 @@ void KDGanttMinimizeSplitter::recalc( bool update )
void KDGanttMinimizeSplitter::setResizeMode( TQWidget *w, ResizeMode mode )
{
processChildEvents();
- QSplitterLayoutStruct *s = data->list.first();
+ TQSplitterLayoutStruct *s = data->list.first();
while ( s ) {
if ( s->wid == w ) {
s->mode = mode;
@@ -1064,11 +1042,11 @@ void KDGanttMinimizeSplitter::moveToFirst( TQWidget *w )
{
processChildEvents();
bool found = FALSE;
- QSplitterLayoutStruct *s = data->list.first();
+ TQSplitterLayoutStruct *s = data->list.first();
while ( s ) {
if ( s->wid == w ) {
found = TRUE;
- QSplitterLayoutStruct *p = data->list.prev();
+ TQSplitterLayoutStruct *p = data->list.prev();
if ( p ) { // not already at first place
data->list.take(); //take p
data->list.take(); // take s
@@ -1093,12 +1071,12 @@ void KDGanttMinimizeSplitter::moveToLast( TQWidget *w )
{
processChildEvents();
bool found = FALSE;
- QSplitterLayoutStruct *s = data->list.first();
+ TQSplitterLayoutStruct *s = data->list.first();
while ( s ) {
if ( s->wid == w ) {
found = TRUE;
data->list.take(); // take s
- QSplitterLayoutStruct *p = data->list.current();
+ TQSplitterLayoutStruct *p = data->list.current();
if ( p ) { // the splitter handle after s
data->list.take(); //take p
data->list.append( p );
@@ -1118,7 +1096,7 @@ void KDGanttMinimizeSplitter::recalcId()
{
int n = data->list.count();
for ( int i = 0; i < n; i++ ) {
- QSplitterLayoutStruct *s = data->list.at(i);
+ TQSplitterLayoutStruct *s = data->list.at(i);
if ( s->isSplitter )
((KDGanttSplitterHandle*)s->wid)->setId(i);
}
@@ -1132,8 +1110,8 @@ TQSize KDGanttMinimizeSplitter::tqsizeHint() const
constPolish();
int l = 0;
int t = 0;
- if ( children() ) {
- const TQObjectList * c = children();
+ if ( tqchildren() ) {
+ const TQObjectList * c = tqchildren();
TQObjectListIt it( *c );
TQObject * o;
@@ -1144,7 +1122,7 @@ TQSize KDGanttMinimizeSplitter::tqsizeHint() const
TQSize s = ((TQWidget*)o)->tqsizeHint();
if ( s.isValid() ) {
l += pick( s );
- t = QMAX( t, trans( s ) );
+ t = TQMAX( t, trans( s ) );
}
}
}
@@ -1162,8 +1140,8 @@ TQSize KDGanttMinimizeSplitter::tqminimumSizeHint() const
constPolish();
int l = 0;
int t = 0;
- if ( children() ) {
- const TQObjectList * c = children();
+ if ( tqchildren() ) {
+ const TQObjectList * c = tqchildren();
TQObjectListIt it( *c );
TQObject * o;
@@ -1174,7 +1152,7 @@ TQSize KDGanttMinimizeSplitter::tqminimumSizeHint() const
TQSize s = minSizeHint((TQWidget*)o);
if ( s.isValid() ) {
l += pick( s );
- t = QMAX( t, trans( s ) );
+ t = TQMAX( t, trans( s ) );
}
}
}
@@ -1189,7 +1167,7 @@ TQSize KDGanttMinimizeSplitter::tqminimumSizeHint() const
void KDGanttMinimizeSplitter::storeSizes()
{
- QSplitterLayoutStruct *s = data->list.first();
+ TQSplitterLayoutStruct *s = data->list.first();
while ( s ) {
if ( !s->isSplitter )
s->sizer = pick( s->wid->size() );
@@ -1214,7 +1192,7 @@ void KDGanttMinimizeSplitter::setHidden( TQWidget *w, bool hide )
} else if ( w == w2 ) {
w2show = !hide;
} else {
-#ifdef QT_CHECK_RANGE
+#ifdef TQT_CHECK_RANGE
qWarning( "KDGanttMinimizeSplitter::setHidden(), unknown widget" );
#endif
return;
@@ -1237,7 +1215,7 @@ bool KDGanttMinimizeSplitter::isHidden( TQWidget *w ) const
return !w1show;
else if ( w == w2 )
return !w2show;
-#ifdef QT_CHECK_RANGE
+#ifdef TQT_CHECK_RANGE
else
qWarning( "KDGanttMinimizeSplitter::isHidden(), unknown widget" );
#endif
@@ -1274,7 +1252,7 @@ TQValueList<int> KDGanttMinimizeSplitter::sizes() const
that->polish();
}
TQValueList<int> list;
- QSplitterLayoutStruct *s = data->list.first();
+ TQSplitterLayoutStruct *s = data->list.first();
while ( s ) {
if ( !s->isSplitter )
list.append( s->sizer );
@@ -1292,7 +1270,7 @@ TQValueList<int> KDGanttMinimizeSplitter::sizes() const
top to bottom.
Extra values in \a list are ignored.
- If \a list tqcontains too few values, the result is undefined
+ If \a list contains too few values, the result is undefined
but the program will still be well-behaved.
\sa sizes()
@@ -1302,7 +1280,7 @@ void KDGanttMinimizeSplitter::setSizes( TQValueList<int> list )
{
processChildEvents();
TQValueList<int>::Iterator it = list.begin();
- QSplitterLayoutStruct *s = data->list.first();
+ TQSplitterLayoutStruct *s = data->list.first();
while ( s && it != list.end() ) {
if ( !s->isSplitter ) {
s->sizer = *it;
@@ -1332,7 +1310,7 @@ void KDGanttMinimizeSplitter::processChildEvents()
void KDGanttMinimizeSplitter::styleChange( TQStyle& old )
{
int sw = style().tqpixelMetric(TQStyle::PM_SplitterWidth, this);
- QSplitterLayoutStruct *s = data->list.first();
+ TQSplitterLayoutStruct *s = data->list.first();
while ( s ) {
if ( s->isSplitter )
s->sizer = sw;
@@ -1342,8 +1320,6 @@ void KDGanttMinimizeSplitter::styleChange( TQStyle& old )
TQFrame::styleChange( old );
}
-#endif
-
/*!
Specifies the direction of the minimize buttons.
If the orientation of the splitter is horizontal then with
@@ -1408,7 +1384,7 @@ void kdganttGeomCalc( TQMemArray<QLayoutStruct> &chain, int start, int count, in
}
} else if ( space < cHint + spacerCount*spacer ) {
// Less space than tqsizeHint, but more than minimum.
- // Currently take space equally from each, like in Qt 2.x.
+ // Currently take space equally from each, like in TQt 2.x.
// Commented-out lines will give more space to stretchier items.
int n = count;
int space_left = space - spacerCount*spacer;
@@ -1555,7 +1531,7 @@ void kdganttGeomCalc( TQMemArray<QLayoutStruct> &chain, int start, int count, in
*/
/*!
- \fn Orientation KDGanttMinimizeSplitter::orientation() const
+ \fn Qt::Orientation KDGanttMinimizeSplitter::orientation() const
Returns the orientation of the splitter.
*/