@ -756,7 +756,7 @@ TreeMapItem::TreeMapItem(TreeMapItem* parent, double value)
_parent = parent ;
_sum = 0 ;
_ tq children = 0 ;
_ children = 0 ;
_widget = 0 ;
_index = - 1 ;
_depth = - 1 ; // not set
@ -789,7 +789,7 @@ TreeMapItem::TreeMapItem(TreeMapItem* parent, double value,
setText ( 0 , text1 ) ;
_sum = 0 ;
_ tq children = 0 ;
_ children = 0 ;
_widget = 0 ;
_index = - 1 ;
_depth = - 1 ; // not set
@ -801,7 +801,7 @@ TreeMapItem::TreeMapItem(TreeMapItem* parent, double value,
TreeMapItem : : ~ TreeMapItem ( )
{
if ( _ tq children) delete _ tq children;
if ( _ children) delete _ children;
if ( _freeRects ) delete _freeRects ;
// finally, notify widget about deletion
@ -842,18 +842,18 @@ void TreeMapItem::redraw()
void TreeMapItem : : clear ( )
{
if ( _ tq children) {
if ( _ children) {
// delete selected items below this item from selection
if ( _widget ) _widget - > clearSelection ( this ) ;
delete _ tq children;
_ tq children = 0 ;
delete _ children;
_ children = 0 ;
}
}
// invalidates current tq children and forces redraw
// this is only usefull when tq children are created on demand in items()
// invalidates current children and forces redraw
// this is only usefull when children are created on demand in items()
void TreeMapItem : : refresh ( )
{
clear ( ) ;
@ -887,9 +887,9 @@ int TreeMapItem::depth() const
bool TreeMapItem : : initialized ( )
{
if ( ! _ tq children) {
_ tq children = new TreeMapItemList ;
_ tq children- > setAutoDelete ( true ) ;
if ( ! _ children) {
_ children = new TreeMapItemList ;
_ children- > setAutoDelete ( true ) ;
return false ;
}
return true ;
@ -899,16 +899,16 @@ void TreeMapItem::addItem(TreeMapItem* i)
{
if ( ! i ) return ;
if ( ! _ tq children) {
_ tq children = new TreeMapItemList ;
_ tq children- > setAutoDelete ( true ) ;
if ( ! _ children) {
_ children = new TreeMapItemList ;
_ children- > setAutoDelete ( true ) ;
}
i - > setParent ( this ) ;
if ( sorting ( 0 ) = = - 1 )
_ tq children- > append ( i ) ; // preserve insertion order
_ children- > append ( i ) ; // preserve insertion order
else
_ tq children- > inSort ( i ) ;
_ children- > inSort ( i ) ;
}
@ -974,17 +974,17 @@ void TreeMapItem::setSorting(int textNo, bool ascending)
_sortAscending = ascending ;
_sortTextNo = textNo ;
if ( _ tq children & & _sortTextNo ! = - 1 ) _ tq children- > sort ( ) ;
if ( _ children & & _sortTextNo ! = - 1 ) _ children- > sort ( ) ;
}
void TreeMapItem : : resort ( bool recursive )
{
if ( ! _ tq children) return ;
if ( ! _ children) return ;
if ( _sortTextNo ! = - 1 ) _ tq children- > sort ( ) ;
if ( _sortTextNo ! = - 1 ) _ children- > sort ( ) ;
if ( recursive )
for ( TreeMapItem * i = _ tq children- > first ( ) ; i ; i = _ tq children- > next ( ) )
for ( TreeMapItem * i = _ children- > first ( ) ; i ; i = _ children- > next ( ) )
i - > resort ( recursive ) ;
}
@ -1002,13 +1002,13 @@ int TreeMapItem::rtti() const
return 0 ;
}
TreeMapItemList * TreeMapItem : : tq children( )
TreeMapItemList * TreeMapItem : : children( )
{
if ( ! _ tq children) {
_ tq children = new TreeMapItemList ;
_ tq children- > setAutoDelete ( true ) ;
if ( ! _ children) {
_ children = new TreeMapItemList ;
_ children- > setAutoDelete ( true ) ;
}
return _ tq children;
return _ children;
}
void TreeMapItem : : clearItemRect ( )
@ -1252,7 +1252,7 @@ void TreeMapWidget::setMaxDrawingDepth(int d)
TQString TreeMapWidget : : defaultFieldType ( int f ) const
{
return i18n ( " Text %1 " ) . tq arg( f + 1 ) ;
return i18n ( " Text %1 " ) . arg( f + 1 ) ;
}
TQString TreeMapWidget : : defaultFieldStop ( int ) const
@ -1482,7 +1482,7 @@ TreeMapItem* TreeMapWidget::item(int x, int y) const
if ( DEBUG_DRAWING ) kdDebug ( 90100 ) < < " item( " < < x < < " , " < < y < < " ): " < < endl ;
while ( 1 ) {
TreeMapItemList * list = p - > tq children( ) ;
TreeMapItemList * list = p - > children( ) ;
if ( ! list )
i = 0 ;
else {
@ -1546,12 +1546,12 @@ TreeMapItem* TreeMapWidget::visibleItem(TreeMapItem* i) const
( i - > itemRect ( ) . height ( ) < 1 ) ) ) {
TreeMapItem * p = i - > parent ( ) ;
if ( ! p ) break ;
int idx = p - > tq children( ) - > findRef ( i ) ;
int idx = p - > children( ) - > findRef ( i ) ;
idx - - ;
if ( idx < 0 )
i = p ;
else
i = p - > tq children( ) - > at ( idx ) ;
i = p - > children( ) - > at ( idx ) ;
}
}
return i ;
@ -1745,7 +1745,7 @@ TreeMapItem* TreeMapWidget::setTmpRangeSelection(TreeMapItem* i1,
i2 = i2 - > parent ( ) ;
if ( ! i2 ) return changed ;
TreeMapItemList * list = commonParent - > tq children( ) ;
TreeMapItemList * list = commonParent - > children( ) ;
if ( ! list ) return changed ;
TreeMapItem * i = list - > first ( ) ;
@ -1768,7 +1768,7 @@ void TreeMapWidget::contextMenuEvent( TQContextMenuEvent* e )
{
//kdDebug(90100) << "TreeMapWidget::contextMenuEvent" << endl;
if ( tq receivers( TQT_SIGNAL ( contextMenuRequested ( TreeMapItem * , const TQPoint & ) ) ) )
if ( receivers( TQT_SIGNAL ( contextMenuRequested ( TreeMapItem * , const TQPoint & ) ) ) )
e - > accept ( ) ;
if ( e - > reason ( ) = = TQContextMenuEvent : : Keyboard ) {
@ -1938,12 +1938,12 @@ int nextVisible(TreeMapItem* i)
TreeMapItem * p = i - > parent ( ) ;
if ( ! p | | p - > itemRect ( ) . isEmpty ( ) ) return - 1 ;
int idx = p - > tq children( ) - > findRef ( i ) ;
int idx = p - > children( ) - > findRef ( i ) ;
if ( idx < 0 ) return - 1 ;
while ( idx < ( int ) p - > tq children( ) - > count ( ) - 1 ) {
while ( idx < ( int ) p - > children( ) - > count ( ) - 1 ) {
idx + + ;
TQRect r = p - > tq children( ) - > at ( idx ) - > itemRect ( ) ;
TQRect r = p - > children( ) - > at ( idx ) - > itemRect ( ) ;
if ( r . width ( ) > 1 & & r . height ( ) > 1 )
return idx ;
}
@ -1956,12 +1956,12 @@ int prevVisible(TreeMapItem* i)
TreeMapItem * p = i - > parent ( ) ;
if ( ! p | | p - > itemRect ( ) . isEmpty ( ) ) return - 1 ;
int idx = p - > tq children( ) - > findRef ( i ) ;
int idx = p - > children( ) - > findRef ( i ) ;
if ( idx < 0 ) return - 1 ;
while ( idx > 0 ) {
idx - - ;
TQRect r = p - > tq children( ) - > at ( idx ) - > itemRect ( ) ;
TQRect r = p - > children( ) - > at ( idx ) - > itemRect ( ) ;
if ( r . width ( ) > 1 & & r . height ( ) > 1 )
return idx ;
}
@ -2042,24 +2042,24 @@ void TreeMapWidget::keyPressEvent( TQKeyEvent* e )
int newIdx = goBack ? nextVisible ( _current ) : prevVisible ( _current ) ;
if ( p & & newIdx > = 0 ) {
p - > setIndex ( newIdx ) ;
setCurrent ( p - > tq children( ) - > at ( newIdx ) , true ) ;
setCurrent ( p - > children( ) - > at ( newIdx ) , true ) ;
}
}
else if ( e - > key ( ) = = Key_Right ) {
int newIdx = goBack ? prevVisible ( _current ) : nextVisible ( _current ) ;
if ( p & & newIdx > = 0 ) {
p - > setIndex ( newIdx ) ;
setCurrent ( p - > tq children( ) - > at ( newIdx ) , true ) ;
setCurrent ( p - > children( ) - > at ( newIdx ) , true ) ;
}
}
else if ( e - > key ( ) = = Key_Down ) {
if ( _current - > tq children( ) & & _current - > tq children( ) - > count ( ) > 0 ) {
if ( _current - > children( ) & & _current - > children( ) - > count ( ) > 0 ) {
int newIdx = _current - > index ( ) ;
if ( newIdx < 0 )
newIdx = goBack ? ( _current - > tq children( ) - > count ( ) - 1 ) : 0 ;
if ( newIdx > = ( int ) _current - > tq children( ) - > count ( ) )
newIdx = _current - > tq children( ) - > count ( ) - 1 ;
newItem = visibleItem ( _current - > tq children( ) - > at ( newIdx ) ) ;
newIdx = goBack ? ( _current - > children( ) - > count ( ) - 1 ) : 0 ;
if ( newIdx > = ( int ) _current - > children( ) - > count ( ) )
newIdx = _current - > children( ) - > count ( ) - 1 ;
newItem = visibleItem ( _current - > children( ) - > at ( newIdx ) ) ;
setCurrent ( newItem , true ) ;
}
}
@ -2245,12 +2245,12 @@ void TreeMapWidget::drawItems(TQPainter* p,
TQRect r = TQRect ( origRect . x ( ) + bw , origRect . y ( ) + bw ,
origRect . width ( ) - 2 * bw , origRect . height ( ) - 2 * bw ) ;
TreeMapItemList * list = item - > tq children( ) ;
TreeMapItemList * list = item - > children( ) ;
TreeMapItem * i ;
bool stopDrawing = false ;
// only subdivide if there are tq children
// only subdivide if there are children
if ( ! list | | list - > count ( ) = = 0 )
stopDrawing = true ;
@ -2283,7 +2283,7 @@ void TreeMapWidget::drawItems(TQPainter* p,
if ( stopDrawing ) {
if ( list ) {
// tq invalidate rects
// invalidate rects
for ( i = list - > first ( ) ; i ; i = list - > next ( ) )
i - > clearItemRect ( ) ;
}
@ -2399,7 +2399,7 @@ void TreeMapWidget::drawItems(TQPainter* p,
r . setRect ( r . x ( ) , r . y ( ) + sr . height ( ) , r . width ( ) , r . height ( ) - sr . height ( ) ) ;
}
// set selfRect (not occupied by tq children) for tooltip
// set selfRect (not occupied by children) for tooltip
item - > addFreeRect ( sr ) ;
if ( 0 ) kdDebug ( 90100 ) < < " Item " < < item - > path ( 0 ) . join ( " / " ) < < " : SelfR "
@ -2537,7 +2537,7 @@ void TreeMapWidget::drawItems(TQPainter* p,
kdDebug ( 90100 ) < < " -drawItems( " < < item - > path ( 0 ) . join ( " / " ) < < " ) " < < endl ;
}
// fills area with a pattern if to small to draw tq children
// fills area with a pattern if to small to draw children
void TreeMapWidget : : drawFill ( TreeMapItem * i , TQPainter * p , TQRect & r )
{
p - > setBrush ( TQt : : Dense4Pattern ) ;
@ -2546,7 +2546,7 @@ void TreeMapWidget::drawFill(TreeMapItem* i, TQPainter* p, TQRect& r)
i - > addFreeRect ( r ) ;
}
// fills area with a pattern if to small to draw tq children
// fills area with a pattern if to small to draw children
void TreeMapWidget : : drawFill ( TreeMapItem * i , TQPainter * p , TQRect & r ,
TreeMapItemListIterator it , int len , bool goBack )
{
@ -2845,10 +2845,10 @@ void TreeMapWidget::addVisualizationItems(TQPopupMenu* popup, int id)
popup - > insertItem ( i18n ( " Border " ) , bpopup , id + 1 ) ;
bpopup - > insertItem ( i18n ( " Correct Borders Only " ) , id + 2 ) ;
bpopup - > insertSeparator ( ) ;
bpopup - > insertItem ( i18n ( " Width %1 " ) . tq arg( 0 ) , id + 3 ) ;
bpopup - > insertItem ( i18n ( " Width %1 " ) . tq arg( 1 ) , id + 4 ) ;
bpopup - > insertItem ( i18n ( " Width %1 " ) . tq arg( 2 ) , id + 5 ) ;
bpopup - > insertItem ( i18n ( " Width %1 " ) . tq arg( 3 ) , id + 6 ) ;
bpopup - > insertItem ( i18n ( " Width %1 " ) . arg( 0 ) , id + 3 ) ;
bpopup - > insertItem ( i18n ( " Width %1 " ) . arg( 1 ) , id + 4 ) ;
bpopup - > insertItem ( i18n ( " Width %1 " ) . arg( 2 ) , id + 5 ) ;
bpopup - > insertItem ( i18n ( " Width %1 " ) . arg( 3 ) , id + 6 ) ;
bpopup - > setItemChecked ( id + 2 , skipIncorrectBorder ( ) ) ;
bpopup - > setItemChecked ( id + 3 , borderWidth ( ) = = 0 ) ;
bpopup - > setItemChecked ( id + 4 , borderWidth ( ) = = 1 ) ;
@ -2955,7 +2955,7 @@ void TreeMapWidget::addFieldStopItems(TQPopupMenu* popup,
connect ( popup , TQT_SIGNAL ( activated ( int ) ) ,
this , TQT_SLOT ( fieldStopActivated ( int ) ) ) ;
popup - > insertItem ( i18n ( " No %1 Limit " ) . tq arg( fieldType ( 0 ) ) , id ) ;
popup - > insertItem ( i18n ( " No %1 Limit " ) . arg( fieldType ( 0 ) ) , id ) ;
popup - > setItemChecked ( id , fieldStop ( 0 ) . isEmpty ( ) ) ;
_menuItem = i ;
bool foundFieldStop = false ;
@ -3014,7 +3014,7 @@ void TreeMapWidget::addAreaStopItems(TQPopupMenu* popup,
int area = i - > width ( ) * i - > height ( ) ;
popup - > insertSeparator ( ) ;
popup - > insertItem ( i18n ( " Area of '%1' (%2) " )
. tq arg( i - > text ( 0 ) ) . tq arg( area ) , id + 1 ) ;
. arg( i - > text ( 0 ) ) . arg( area ) , id + 1 ) ;
if ( area = = minimalArea ( ) ) {
popup - > setItemChecked ( id + 1 , true ) ;
foundArea = true ;
@ -3040,9 +3040,9 @@ void TreeMapWidget::addAreaStopItems(TQPopupMenu* popup,
}
popup - > insertItem ( i18n ( " Double Area Limit (to %1) " )
. tq arg( minimalArea ( ) * 2 ) , id + 5 ) ;
. arg( minimalArea ( ) * 2 ) , id + 5 ) ;
popup - > insertItem ( i18n ( " Halve Area Limit (to %1) " )
. tq arg( minimalArea ( ) / 2 ) , id + 6 ) ;
. arg( minimalArea ( ) / 2 ) , id + 6 ) ;
}
}
@ -3079,7 +3079,7 @@ void TreeMapWidget::addDepthStopItems(TQPopupMenu* popup,
int d = i - > depth ( ) ;
popup - > insertSeparator ( ) ;
popup - > insertItem ( i18n ( " Depth of '%1' (%2) " )
. tq arg( i - > text ( 0 ) ) . tq arg( d ) , id + 1 ) ;
. arg( i - > text ( 0 ) ) . arg( d ) , id + 1 ) ;
if ( d = = maxDrawingDepth ( ) ) {
popup - > setItemChecked ( id + 1 , true ) ;
foundDepth = true ;
@ -3089,7 +3089,7 @@ void TreeMapWidget::addDepthStopItems(TQPopupMenu* popup,
popup - > insertSeparator ( ) ;
int depth = 2 , count ;
for ( count = 0 ; count < 3 ; count + + ) {
popup - > insertItem ( i18n ( " Depth %1 " ) . tq arg( depth ) , id + 4 + count ) ;
popup - > insertItem ( i18n ( " Depth %1 " ) . arg( depth ) , id + 4 + count ) ;
if ( depth = = maxDrawingDepth ( ) ) {
popup - > setItemChecked ( id + 4 + count , true ) ;
foundDepth = true ;
@ -3100,14 +3100,14 @@ void TreeMapWidget::addDepthStopItems(TQPopupMenu* popup,
if ( maxDrawingDepth ( ) > 1 ) {
popup - > insertSeparator ( ) ;
if ( ! foundDepth ) {
popup - > insertItem ( i18n ( " Depth %1 " ) . tq arg( maxDrawingDepth ( ) ) , id + 10 ) ;
popup - > insertItem ( i18n ( " Depth %1 " ) . arg( maxDrawingDepth ( ) ) , id + 10 ) ;
popup - > setItemChecked ( id + 10 , true ) ;
}
popup - > insertItem ( i18n ( " Decrement (to %1) " )
. tq arg( maxDrawingDepth ( ) - 1 ) , id + 2 ) ;
. arg( maxDrawingDepth ( ) - 1 ) , id + 2 ) ;
popup - > insertItem ( i18n ( " Increment (to %1) " )
. tq arg( maxDrawingDepth ( ) + 1 ) , id + 3 ) ;
. arg( maxDrawingDepth ( ) + 1 ) , id + 3 ) ;
}
}
@ -3130,13 +3130,13 @@ void TreeMapWidget::saveOptions(KConfigGroup* config, TQString prefix)
int f , fCount = _attr . size ( ) ;
config - > writeEntry ( prefix + " FieldCount " , fCount ) ;
for ( f = 0 ; f < fCount ; f + + ) {
config - > writeEntry ( TQString ( prefix + " FieldVisible%1 " ) . tq arg( f ) ,
config - > writeEntry ( TQString ( prefix + " FieldVisible%1 " ) . arg( f ) ,
_attr [ f ] . visible ) ;
config - > writeEntry ( TQString ( prefix + " FieldForced%1 " ) . tq arg( f ) ,
config - > writeEntry ( TQString ( prefix + " FieldForced%1 " ) . arg( f ) ,
_attr [ f ] . forced ) ;
config - > writeEntry ( TQString ( prefix + " FieldStop%1 " ) . tq arg( f ) ,
config - > writeEntry ( TQString ( prefix + " FieldStop%1 " ) . arg( f ) ,
_attr [ f ] . stop ) ;
config - > writeEntry ( TQString ( prefix + " FieldPosition%1 " ) . tq arg( f ) ,
config - > writeEntry ( TQString ( prefix + " FieldPosition%1 " ) . arg( f ) ,
fieldPositionString ( f ) ) ;
}
}
@ -3180,18 +3180,18 @@ void TreeMapWidget::restoreOptions(KConfigGroup* config, TQString prefix)
int f ;
for ( f = 0 ; f < num ; f + + ) {
str = TQString ( prefix + " FieldVisible%1 " ) . tq arg( f ) ;
str = TQString ( prefix + " FieldVisible%1 " ) . arg( f ) ;
if ( config - > hasKey ( str ) )
setFieldVisible ( f , config - > readBoolEntry ( str ) ) ;
str = TQString ( prefix + " FieldForced%1 " ) . tq arg( f ) ;
str = TQString ( prefix + " FieldForced%1 " ) . arg( f ) ;
if ( config - > hasKey ( str ) )
setFieldForced ( f , config - > readBoolEntry ( str ) ) ;
str = config - > readEntry ( TQString ( prefix + " FieldStop%1 " ) . tq arg( f ) ) ;
str = config - > readEntry ( TQString ( prefix + " FieldStop%1 " ) . arg( f ) ) ;
setFieldStop ( f , str ) ;
str = config - > readEntry ( TQString ( prefix + " FieldPosition%1 " ) . tq arg( f ) ) ;
str = config - > readEntry ( TQString ( prefix + " FieldPosition%1 " ) . arg( f ) ) ;
if ( ! str . isEmpty ( ) ) setFieldPosition ( f , str ) ;
}
}