summaryrefslogtreecommitdiffstats
path: root/src/part/radialMap/map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/part/radialMap/map.cpp')
-rw-r--r--src/part/radialMap/map.cpp62
1 files changed, 31 insertions, 31 deletions
diff --git a/src/part/radialMap/map.cpp b/src/part/radialMap/map.cpp
index 8eb8f02..e106ed7 100644
--- a/src/part/radialMap/map.cpp
+++ b/src/part/radialMap/map.cpp
@@ -4,11 +4,11 @@
#include <kcursor.h> //make()
#include <kglobalsettings.h> //kdeColours
#include <kimageeffect.h> //desaturate()
-#include <qapplication.h> //make()
-#include <qimage.h> //make() & paint()
-#include <qfont.h> //ctor
-#include <qfontmetrics.h> //ctor
-#include <qpainter.h>
+#include <tqapplication.h> //make()
+#include <tqimage.h> //make() & paint()
+#include <tqfont.h> //ctor
+#include <tqfontmetrics.h> //ctor
+#include <tqpainter.h>
#include "builder.h"
#include "Config.h"
@@ -18,7 +18,7 @@
#include "sincos.h"
#include "widget.h"
-#define COLOR_GREY QColor( 0, 0, 140, QColor::Hsv )
+#define COLOR_GREY TQColor( 0, 0, 140, TQColor::Hsv )
RadialMap::Map::Map()
@@ -28,7 +28,7 @@ RadialMap::Map::Map()
, m_visibleDepth( DEFAULT_RING_DEPTH )
{
//FIXME this is all broken. No longer is a maximum depth!
- const int fmh = QFontMetrics( QFont() ).height();
+ const int fmh = TQFontMetrics( TQFont() ).height();
const int fmhD4 = fmh / 4;
MAP_2MARGIN = 2 * ( fmh - (fmhD4 - LABEL_MAP_SPACER) ); //margin is dependent on fitting in labels at top and bottom
}
@@ -39,7 +39,7 @@ RadialMap::Map::~Map()
}
void
-RadialMap::Map::invalidate( const bool desaturateTheImage )
+RadialMap::Map::tqinvalidate( const bool desaturateTheImage )
{
DEBUG_ANNOUNCE
@@ -48,7 +48,7 @@ RadialMap::Map::invalidate( const bool desaturateTheImage )
if( desaturateTheImage )
{
- QImage img = this->convertToImage();
+ TQImage img = this->convertToImage();
KImageEffect::desaturate( img, 0.7 );
KImageEffect::toGray( img, true );
@@ -69,7 +69,7 @@ RadialMap::Map::make( const Directory *tree, bool refresh )
// even if it makes it a lie?
//slow operation so set the wait cursor
- QApplication::setOverrideCursor( KCursor::waitCursor() );
+ TQApplication::setOverrideCursor( KCursor::waitCursor() );
{
//build a signature of visible components
@@ -94,7 +94,7 @@ RadialMap::Map::make( const Directory *tree, bool refresh )
//paint the pixmap
aaPaint();
- QApplication::restoreOverrideCursor();
+ TQApplication::restoreOverrideCursor();
}
void
@@ -114,7 +114,7 @@ RadialMap::Map::setRingBreadth()
}
bool
-RadialMap::Map::resize( const QRect &rect )
+RadialMap::Map::resize( const TQRect &rect )
{
DEBUG_ANNOUNCE
@@ -138,7 +138,7 @@ RadialMap::Map::resize( const QRect &rect )
if( size < minSize ) size = minSize;
- //this QRect is used by paint()
+ //this TQRect is used by paint()
m_rect.setRect( mD2, mD2, size, size );
}
@@ -173,12 +173,12 @@ RadialMap::Map::colorise()
{
DEBUG_ANNOUNCE
- QColor cp, cb;
+ TQColor cp, cb;
double darkness = 1;
double contrast = (double)Config::contrast / (double)100;
int h, s1, s2, v1, v2;
- QColor kdeColour[2] = { KGlobalSettings::inactiveTitleColor(), KGlobalSettings::activeTitleColor() };
+ TQColor kdeColour[2] = { KGlobalSettings::inactiveTitleColor(), KGlobalSettings::activeTitleColor() };
double deltaRed = (double)(kdeColour[0].red() - kdeColour[1].red()) / 2880; //2880 for semicircle
double deltaGreen = (double)(kdeColour[0].green() - kdeColour[1].green()) / 2880;
@@ -193,7 +193,7 @@ RadialMap::Map::colorise()
case 2000: //HACK for summary view
if( (*it)->file()->name() == "Used" ) {
- cb = QApplication::palette().active().color( QColorGroup::Highlight );
+ cb = TQApplication::tqpalette().active().color( TQColorGroup::Highlight );
cb.getHsv( &h, &s1, &v1 );
if( s1 > 80 )
@@ -206,8 +206,8 @@ RadialMap::Map::colorise()
cp.setHsv( h, s2, v2 );
}
else {
- cp = Qt::gray;
- cb = Qt::white;
+ cp = TQt::gray;
+ cb = TQt::white;
}
(*it)->setPalette( cp, cb );
@@ -272,7 +272,7 @@ RadialMap::Map::colorise()
//**** may be better to store KDE colours as H and S and vary V as others
//**** perhaps make saturation difference for s2 dependent on contrast too
//**** fake segments don't work with highContrast
- //**** may work better with cp = cb rather than Qt::white
+ //**** may work better with cp = cb rather than TQt::white
//**** you have to ensure the grey of files is sufficient, currently it works only with rainbow (perhaps use contrast there too)
//**** change v1,v2 to vp, vb etc.
//**** using percentages is not strictly correct as the eye doesn't work like that
@@ -286,9 +286,9 @@ RadialMap::Map::aaPaint()
{
//paint() is called during continuous processes
//aaPaint() is not and is slower so set overidecursor (make sets it too)
- QApplication::setOverrideCursor( KCursor::waitCursor() );
+ TQApplication::setOverrideCursor( KCursor::waitCursor() );
paint( Config::antiAliasFactor );
- QApplication::restoreOverrideCursor();
+ TQApplication::restoreOverrideCursor();
}
void
@@ -299,8 +299,8 @@ RadialMap::Map::paint( unsigned int scaleFactor )
if (scaleFactor == 0) //just in case
scaleFactor = 1;
- QPainter paint;
- QRect rect = m_rect;
+ TQPainter paint;
+ TQRect rect = m_rect;
int step = m_ringBreadth;
int excess = -1;
@@ -349,8 +349,8 @@ RadialMap::Map::paint( unsigned int scaleFactor )
if( (*it)->hasHiddenChildren() )
{
//draw arrow head to indicate undisplayed files/directories
- QPointArray pts( 3 );
- QPoint pos, cpos = rect.center();
+ TQPointArray pts( 3 );
+ TQPoint pos, cpos = rect.center();
int a[3] = { (*it)->start(), (*it)->length(), 0 };
a[2] = a[0] + (a[1] / 2); //assign to halfway between
@@ -385,11 +385,11 @@ RadialMap::Map::paint( unsigned int scaleFactor )
{
//**** code is bloated!
paint.save();
- QPen pen = paint.pen();
+ TQPen pen = paint.pen();
int width = 2 * scaleFactor;
pen.setWidth( width );
paint.setPen( pen );
- QRect rect2 = rect;
+ TQRect rect2 = rect;
width /= 2;
rect2.addCoords( width, width, -width, -width );
paint.drawArc( rect2, (*it)->start(), (*it)->length() );
@@ -409,7 +409,7 @@ RadialMap::Map::paint( unsigned int scaleFactor )
// if( excess > 0 ) rect.addCoords( excess, excess, 0, 0 ); //ugly
paint.setPen( COLOR_GREY );
- paint.setBrush( Qt::white );
+ paint.setBrush( TQt::white );
paint.drawEllipse( rect );
if( scaleFactor > 1 )
@@ -425,16 +425,16 @@ RadialMap::Map::paint( unsigned int scaleFactor )
y2 /= scaleFactor;
rect.setCoords( x1, y1, x2, y2 );
- QImage img = this->convertToImage();
+ TQImage img = this->convertToImage();
img = img.smoothScale( this->size() / (int)scaleFactor );
this->convertFromImage( img );
paint.begin( this );
paint.setPen( COLOR_GREY );
- paint.setBrush( Qt::white );
+ paint.setBrush( TQt::white );
}
- paint.drawText( rect, Qt::AlignCenter, m_centerText );
+ paint.drawText( rect, TQt::AlignCenter, m_centerText );
m_innerRadius = rect.width() / 2; //rect.width should be multiple of 2