|
|
|
@ -44,7 +44,7 @@ LabelUtils::~LabelUtils()
|
|
|
|
|
|
|
|
|
|
double LabelUtils::pixelToMm( double pixel, const TQPaintDevice* device, int mode )
|
|
|
|
|
{
|
|
|
|
|
TQPaintDeviceMetrics pdm( device ? device : TQT_TQPAINTDEVICE(KApplication::desktop()) );
|
|
|
|
|
TQPaintDeviceMetrics pdm( device ? device : TQT_TQPAINTDEVICE(TDEApplication::desktop()) );
|
|
|
|
|
if( mode == DpiX )
|
|
|
|
|
return (pixel * CONVERSION_FACTOR) / (double)pdm.logicalDpiX();
|
|
|
|
|
else
|
|
|
|
@ -59,7 +59,7 @@ double LabelUtils::mmToPixel( double mm, const TQPaintDevice* device, int mode )
|
|
|
|
|
// We don't get valid metrics from the printer - and we want a better resolution
|
|
|
|
|
// anyway (it's the PS driver that takes care of the printer resolution).
|
|
|
|
|
|
|
|
|
|
TQPaintDeviceMetrics pdm( device ? device : TQT_TQPAINTDEVICE(KApplication::desktop()) );
|
|
|
|
|
TQPaintDeviceMetrics pdm( device ? device : TQT_TQPAINTDEVICE(TDEApplication::desktop()) );
|
|
|
|
|
|
|
|
|
|
// tqDebug("DpiX=%i", pdm.logicalDpiX());
|
|
|
|
|
// tqDebug("DpiY=%i", pdm.logicalDpiY());
|
|
|
|
@ -100,7 +100,7 @@ const TQString LabelUtils::getModeFromCaption( const TQString & cap )
|
|
|
|
|
|
|
|
|
|
TQSize LabelUtils::stringSize( const TQString & t )
|
|
|
|
|
{
|
|
|
|
|
TQSimpleRichText srt( t, KApplication::font() );
|
|
|
|
|
TQSimpleRichText srt( t, TDEApplication::font() );
|
|
|
|
|
TQSize s;
|
|
|
|
|
s.setWidth( srt.widthUsed() );
|
|
|
|
|
s.setHeight( srt.height() );
|
|
|
|
@ -111,7 +111,7 @@ TQSize LabelUtils::stringSize( const TQString & t )
|
|
|
|
|
void LabelUtils::renderString( TQPainter* painter, const TQString & t, const TQRect & rect, double scalex, double scaley )
|
|
|
|
|
{
|
|
|
|
|
// DSRichText cannot calculate the width on its own
|
|
|
|
|
TQSimpleRichText srt( t, KApplication::font() );
|
|
|
|
|
TQSimpleRichText srt( t, TDEApplication::font() );
|
|
|
|
|
int width = (rect.width() > 0) ? rect.width() : srt.widthUsed();
|
|
|
|
|
int height = (rect.height() > 0) ? rect.height() : srt.height();
|
|
|
|
|
|
|
|
|
@ -126,7 +126,7 @@ void LabelUtils::renderString( TQPainter* painter, const TQString & t, const TQR
|
|
|
|
|
|
|
|
|
|
TQPixmap* LabelUtils::drawString( const TQString & t, int w, int h, double rot )
|
|
|
|
|
{
|
|
|
|
|
TQSimpleRichText srt( t, KApplication::font() );
|
|
|
|
|
TQSimpleRichText srt( t, TDEApplication::font() );
|
|
|
|
|
|
|
|
|
|
int width = (w > 0) ? w : srt.widthUsed();
|
|
|
|
|
int height = (h > 0) ? h : srt.height();
|
|
|
|
|