summaryrefslogtreecommitdiffstats
path: root/karbon/widgets/vstrokefillpreview.cc
diff options
context:
space:
mode:
Diffstat (limited to 'karbon/widgets/vstrokefillpreview.cc')
-rw-r--r--karbon/widgets/vstrokefillpreview.cc60
1 files changed, 28 insertions, 32 deletions
diff --git a/karbon/widgets/vstrokefillpreview.cc b/karbon/widgets/vstrokefillpreview.cc
index 40dbe4d6..93392d9b 100644
--- a/karbon/widgets/vstrokefillpreview.cc
+++ b/karbon/widgets/vstrokefillpreview.cc
@@ -17,7 +17,7 @@
* Boston, MA 02110-1301, USA.
*/
-#include <qcolor.h>
+#include <tqcolor.h>
#include <kdebug.h>
#include <KoPoint.h>
@@ -52,21 +52,17 @@
VStrokeFillPreview::VStrokeFillPreview(
- KarbonPart *part, QWidget* parent, const char* name )
- : QFrame( parent, name ), m_part( part )
+ KarbonPart *part, TQWidget* tqparent, const char* name )
+ : TQFrame( tqparent, name ), m_part( part )
{
m_strokeWidget = false;
- setFocusPolicy( QWidget::NoFocus );
+ setFocusPolicy( TQ_NoFocus );
-#if QT_VERSION < 0x030100
- setFrameStyle( QFrame::Panel | QFrame::Sunken );
-#else
- setFrameStyle( QFrame::GroupBoxPanel | QFrame::Sunken );
-#endif
+ setFrameStyle( TQFrame::GroupBoxPanel | TQFrame::Sunken );
installEventFilter( this );
m_pixmap.resize( int( PANEL_SIZEX ), int( PANEL_SIZEY ) );
- m_painter = new VKoPainter( &m_pixmap, uint( PANEL_SIZEX ), uint( PANEL_SIZEY ) );
+ m_painter = new VKoPainter( TQT_TQPAINTDEVICE(&m_pixmap), uint( PANEL_SIZEX ), uint( PANEL_SIZEY ) );
}
VStrokeFillPreview::~VStrokeFillPreview()
@@ -75,25 +71,25 @@ VStrokeFillPreview::~VStrokeFillPreview()
}
void
-VStrokeFillPreview::paintEvent( QPaintEvent* event )
+VStrokeFillPreview::paintEvent( TQPaintEvent* event )
{
bitBlt( this,
(int)( width() - PANEL_SIZEX ) / 2, (int)( height() - PANEL_SIZEY ) / 2,
&m_pixmap,
0, 0, (int)PANEL_SIZEX, (int)PANEL_SIZEY );
- QFrame::paintEvent( event );
+ TQFrame::paintEvent( event );
}
bool
-VStrokeFillPreview::eventFilter( QObject *, QEvent *event )
+VStrokeFillPreview::eventFilter( TQObject *, TQEvent *event )
{
- QMouseEvent* e = static_cast<QMouseEvent *>( event );
+ TQMouseEvent* e = TQT_TQMOUSEEVENT( event );
int ex = e->x() - int( ( width() - PANEL_SIZEX ) / 2 );
int ey = e->y() - int( ( height() - PANEL_SIZEY ) / 2 );
- if( event && event->type() == QEvent::MouseButtonPress )
+ if( event && event->type() == TQEvent::MouseButtonPress )
{
if ( m_strokeWidget )
{
@@ -132,14 +128,14 @@ VStrokeFillPreview::eventFilter( QObject *, QEvent *event )
update( m_stroke, m_fill );
}
- if( event && event->type() == QEvent::MouseButtonDblClick )
+ if( event && event->type() == TQEvent::MouseButtonDblClick )
{
if(
ex >= FILL_TOPX && ex <= FILL_BOTTOMX &&
ey >= FILL_TOPY && ey <= FILL_BOTTOMY )
{
VColorDlg* dialog = new VColorDlg( m_fill.color(), this );
- if( dialog->exec() == QDialog::Accepted )
+ if( dialog->exec() == TQDialog::Accepted )
{
if( m_part && m_part->document().selection() ) m_part->addCommand( new VFillCmd( &m_part->document(), VFill( dialog->Color() ) ), true );
}
@@ -150,7 +146,7 @@ VStrokeFillPreview::eventFilter( QObject *, QEvent *event )
&& ey >= STROKE_TOPY && ey <= STROKE_BOTTOMY )
{
VColorDlg* dialog = new VColorDlg( m_stroke.color(), this );
- if( dialog->exec() == QDialog::Accepted )
+ if( dialog->exec() == TQDialog::Accepted )
{
if( m_part && m_part->document().selection() ) m_part->addCommand( new VStrokeCmd( &m_part->document(), dialog->Color() ), true );
}
@@ -176,12 +172,12 @@ VStrokeFillPreview::update( const VStroke &s, const VFill &f )
// draw checkerboard
VFill fill;
- m_painter->setPen( Qt::NoPen );
+ m_painter->setPen( TQt::NoPen );
for( unsigned char y = 0; y < PANEL_SIZEY; y += 10 )
for( unsigned char x = 0; x < PANEL_SIZEX; x += 10 )
{
- fill.setColor( ( ( ( x + y ) % 20 ) == 0 ) ? QColor( 180, 180, 180 ) : QColor( 100, 100, 100 ) );
+ fill.setColor( ( ( ( x + y ) % 20 ) == 0 ) ? TQColor( 180, 180, 180 ) : TQColor( 100, 100, 100 ) );
m_painter->setBrush( fill );
m_painter->drawRect( x, y, 10, 10 );
}
@@ -199,7 +195,7 @@ VStrokeFillPreview::update( const VStroke &s, const VFill &f )
m_painter->end();
- repaint();
+ tqrepaint();
}
void
@@ -241,15 +237,15 @@ VStrokeFillPreview::drawFill( const VFill &f )
}
else
m_painter->setBrush( f );
- m_painter->setPen( Qt::NoPen );
+ m_painter->setPen( TQt::NoPen );
m_painter->drawRect( KoRect( FILL_TOPX, FILL_TOPY, FILL_BOTTOMX - FILL_TOPX, FILL_BOTTOMY - FILL_TOPY ) );
}
else
{
VFill fill;
- fill.setColor( Qt::white );
+ fill.setColor( TQt::white );
m_painter->setBrush( fill );
- m_painter->setPen( Qt::NoPen );
+ m_painter->setPen( TQt::NoPen );
m_painter->drawRect( KoRect( FILL_TOPX, FILL_TOPY,
FILL_BOTTOMX - FILL_TOPX,
@@ -259,7 +255,7 @@ VStrokeFillPreview::drawFill( const VFill &f )
// show 3D outline of fill part
VColor color;
- m_painter->setBrush( Qt::NoBrush );
+ m_painter->setBrush( TQt::NoBrush );
color.set( 1.0, 1.0, 1.0 );
stroke.setColor( color );
m_painter->setPen( stroke );
@@ -282,7 +278,7 @@ VStrokeFillPreview::drawFill( const VFill &f )
if( f.type() == VFill::none )
{
- stroke.setColor( Qt::red );
+ stroke.setColor( TQt::red );
m_painter->setPen( stroke );
m_painter->newPath();
m_painter->moveTo( KoPoint( FILL_BOTTOMX, FILL_TOPY ) );
@@ -297,7 +293,7 @@ VStrokeFillPreview::drawStroke( const VStroke &s )
VStroke stroke;
stroke.setLineWidth( 2.0 );
- m_painter->setPen( Qt::NoPen );
+ m_painter->setPen( TQt::NoPen );
if( s.type() != VStroke::none )
{
@@ -357,10 +353,10 @@ VStrokeFillPreview::drawStroke( const VStroke &s )
{
VFill fill;
m_painter->setFillRule( evenOdd );
- fill.setColor( Qt::white );
+ fill.setColor( TQt::white );
m_painter->setBrush( fill );
- m_painter->setPen( Qt::NoPen );
+ m_painter->setPen( TQt::NoPen );
m_painter->newPath();
m_painter->moveTo( KoPoint( STROKE_TOPX, STROKE_TOPY ) );
@@ -382,7 +378,7 @@ VStrokeFillPreview::drawStroke( const VStroke &s )
color.set( 1.0, 1.0, 1.0 );
stroke.setColor( color );
- m_painter->setBrush( Qt::NoBrush );
+ m_painter->setBrush( TQt::NoBrush );
m_painter->setPen( stroke );
m_painter->newPath();
@@ -401,7 +397,7 @@ VStrokeFillPreview::drawStroke( const VStroke &s )
m_painter->lineTo( KoPoint( STROKE_TOPX - 1, STROKE_BOTTOMY + 1 ) );
m_painter->strokePath();
- //stroke.setColor( Qt::black.rgb() );
+ //stroke.setColor( TQt::black.rgb() );
//m_painter->setPen( stroke );
m_painter->newPath();
m_painter->moveTo( KoPoint( STROKE_BOTTOMX_INNER - 1, STROKE_TOPY_INNER + 1 ) );
@@ -421,7 +417,7 @@ VStrokeFillPreview::drawStroke( const VStroke &s )
if( s.type() == VStroke::none )
{
- stroke.setColor( Qt::red );
+ stroke.setColor( TQt::red );
m_painter->setPen( stroke );
m_painter->newPath();