summaryrefslogtreecommitdiffstats
path: root/karbon/widgets/vgradienttabwidget.cc
diff options
context:
space:
mode:
Diffstat (limited to 'karbon/widgets/vgradienttabwidget.cc')
-rw-r--r--karbon/widgets/vgradienttabwidget.cc104
1 files changed, 52 insertions, 52 deletions
diff --git a/karbon/widgets/vgradienttabwidget.cc b/karbon/widgets/vgradienttabwidget.cc
index 44bb53bc..b8f955d8 100644
--- a/karbon/widgets/vgradienttabwidget.cc
+++ b/karbon/widgets/vgradienttabwidget.cc
@@ -17,13 +17,13 @@
* Boston, MA 02110-1301, USA.
*/
-#include <qlabel.h>
-#include <qpainter.h>
-#include <qlayout.h>
-#include <qgroupbox.h>
-#include <qpushbutton.h>
-#include <qfileinfo.h>
-#include <qpixmap.h>
+#include <tqlabel.h>
+#include <tqpainter.h>
+#include <tqlayout.h>
+#include <tqgroupbox.h>
+#include <tqpushbutton.h>
+#include <tqfileinfo.h>
+#include <tqpixmap.h>
#include <knuminput.h>
#include <kcombobox.h>
@@ -37,14 +37,14 @@
#include "vkopainter.h"
#include "vfill.h"
-VGradientListItem::VGradientListItem( const VGradient& gradient, QString filename )
- : QListBoxItem( 0L ), m_filename( filename )
+VGradientListItem::VGradientListItem( const VGradient& gradient, TQString filename )
+ : TQListBoxItem( 0L ), m_filename( filename )
{
m_gradient = new VGradient( gradient );
m_pixmap.resize( 200, 16 );
- VKoPainter gp( &m_pixmap, m_pixmap.width(), m_pixmap.height() );
- gp.setRasterOp( Qt::XorROP );
+ VKoPainter gp( TQT_TQPAINTDEVICE(&m_pixmap), m_pixmap.width(), m_pixmap.height() );
+ gp.setRasterOp( TQt::XorROP );
gp.newPath();
VGradient grad( *m_gradient );
grad.setOrigin( KoPoint( 0, 0 ) );
@@ -62,11 +62,11 @@ VGradientListItem::VGradientListItem( const VGradient& gradient, QString filenam
gp.fillPath();
gp.end();
- m_delete = QFileInfo( filename ).isWritable();
+ m_delete = TQFileInfo( filename ).isWritable();
} // VGradientListItem::VGradientListItem
VGradientListItem::VGradientListItem( const VGradientListItem& gradient )
- : QListBoxItem( 0L )
+ : TQListBoxItem( 0L )
{
m_pixmap = gradient.m_pixmap;
m_delete = gradient.m_delete;
@@ -79,31 +79,31 @@ VGradientListItem::~VGradientListItem()
delete m_gradient;
} // VGradientListItem::~VGradientListItem
-int VGradientListItem::width( const QListBox* lb ) const
+int VGradientListItem::width( const TQListBox* lb ) const
{
return lb->width() - 25;
} // VGradientListItem::width
-void VGradientListItem::paint( QPainter* painter )
+void VGradientListItem::paint( TQPainter* painter )
{
painter->save();
- painter->setRasterOp( Qt::CopyROP );
- QRect r ( 0, 0, width( listBox() ), height( listBox() ) );
+ painter->setRasterOp( TQt::CopyROP );
+ TQRect r ( 0, 0, width( listBox() ), height( listBox() ) );
painter->scale( ( (float)( width( listBox() ) ) ) / 200., 1. );
painter->drawPixmap( 0, 0, m_pixmap );
painter->restore();
if ( isSelected() )
- painter->setPen( listBox()->colorGroup().highlightedText() );
+ painter->setPen( listBox()->tqcolorGroup().highlightedText() );
else
- painter->setPen( listBox()->colorGroup().base() );
+ painter->setPen( listBox()->tqcolorGroup().base() );
painter->drawRect( r );
painter->flush();
} // VGradientListItem::paint
-VGradientPreview::VGradientPreview( VGradient& gradient, double& opacity, QWidget* parent, const char* name )
- : QWidget( parent, name ), m_gradient( &gradient ), m_opacity( &opacity )
+VGradientPreview::VGradientPreview( VGradient& gradient, double& opacity, TQWidget* tqparent, const char* name )
+ : TQWidget( tqparent, name ), m_gradient( &gradient ), m_opacity( &opacity )
{
- setBackgroundMode( Qt::NoBackground );
+ setBackgroundMode( TQt::NoBackground );
setMinimumSize( 70, 70 );
} // VGradientPreview::VGradientPreview
@@ -111,11 +111,11 @@ VGradientPreview::~VGradientPreview()
{
} // VGradientPreview::~VGradientPreview
-void VGradientPreview::paintEvent( QPaintEvent* )
+void VGradientPreview::paintEvent( TQPaintEvent* )
{
- QPixmap pixmap( width(), height() );
- VKoPainter gp( &pixmap, width(), height() );
- gp.setRasterOp( Qt::XorROP );
+ TQPixmap pixmap( width(), height() );
+ VKoPainter gp( TQT_TQPAINTDEVICE(&pixmap), width(), height() );
+ gp.setRasterOp( TQt::XorROP );
gp.newPath();
VGradient gradient( *m_gradient );
if( gradient.type() == VGradient::radial || gradient.type() == VGradient::conic )
@@ -149,15 +149,15 @@ void VGradientPreview::paintEvent( QPaintEvent* )
gp.fillPath();
gp.end();
- QPainter p( &pixmap );
+ TQPainter p( &pixmap );
- p.setPen( colorGroup().light() );
+ p.setPen( tqcolorGroup().light() );
p.moveTo( 1, height() - 1 );
p.lineTo( 1, 1 );
p.lineTo( width() - 1, 1 );
p.lineTo( width() - 1, height() - 1 );
p.lineTo( 1, height() - 1 );
- p.setPen( colorGroup().dark() );
+ p.setPen( tqcolorGroup().dark() );
p.moveTo( 0, height() - 1 );
p.lineTo( 0, 0 );
p.lineTo( width() - 1, 0 );
@@ -167,8 +167,8 @@ void VGradientPreview::paintEvent( QPaintEvent* )
bitBlt( this, 0, 0, &pixmap, 0, 0, width(), height() );
} // VGradientPreview::paintEvent
-VGradientTabWidget::VGradientTabWidget( VGradient& gradient, KarbonResourceServer* server, QWidget* parent, const char* name )
- : QTabWidget( parent, name ), m_gradient( gradient ), m_resourceServer( server )
+VGradientTabWidget::VGradientTabWidget( VGradient& gradient, KarbonResourceServer* server, TQWidget* tqparent, const char* name )
+ : TQTabWidget( tqparent, name ), m_gradient( gradient ), m_resourceServer( server )
{
setupUI();
setupConnections();
@@ -181,15 +181,15 @@ VGradientTabWidget::~VGradientTabWidget()
void VGradientTabWidget::setupUI()
{
- m_editGroup = new QGroupBox( i18n( "Edit Gradient" ) );
- QGridLayout* editLayout = new QGridLayout( m_editGroup, 7, 3 );
+ m_editGroup = new TQGroupBox( i18n( "Edit Gradient" ) );
+ TQGridLayout* editLayout = new TQGridLayout( m_editGroup, 7, 3 );
editLayout->setSpacing( 3 );
editLayout->setMargin( 6 );
editLayout->addRowSpacing( 0, 12 );
editLayout->addMultiCellWidget( m_gradientPreview = new VGradientPreview( m_gradient, m_gradOpacity, m_editGroup ), 1, 3, 0, 0 );
- editLayout->addWidget( new QLabel( i18n( "Type:" ), m_editGroup ), 1, 1 );
- editLayout->addWidget( new QLabel( i18n( "Repeat:" ), m_editGroup ), 2, 1 );
- editLayout->addWidget( new QLabel( i18n( "Target:" ), m_editGroup ), 3, 1 );
+ editLayout->addWidget( new TQLabel( i18n( "Type:" ), m_editGroup ), 1, 1 );
+ editLayout->addWidget( new TQLabel( i18n( "Repeat:" ), m_editGroup ), 2, 1 );
+ editLayout->addWidget( new TQLabel( i18n( "Target:" ), m_editGroup ), 3, 1 );
editLayout->addWidget( m_gradientType = new KComboBox( false, m_editGroup ), 1, 2 );
m_gradientType->insertItem( i18n( "Linear" ), 0 );
m_gradientType->insertItem( i18n( "Radial" ), 1 );
@@ -201,36 +201,36 @@ void VGradientTabWidget::setupUI()
editLayout->addWidget( m_gradientTarget = new KComboBox( false, m_editGroup ), 3, 2 );
m_gradientTarget->insertItem( i18n( "Stroke" ), 0 );
m_gradientTarget->insertItem( i18n( "Fill" ), 1 );
- editLayout->addMultiCellWidget( m_addToPredefs = new QPushButton( i18n( "&Add to Predefined Gradients" ), m_editGroup ), 6, 6, 0, 2 );
+ editLayout->addMultiCellWidget( m_addToPredefs = new TQPushButton( i18n( "&Add to Predefined Gradients" ), m_editGroup ), 6, 6, 0, 2 );
editLayout->addMultiCellWidget( m_gradientWidget = new VGradientWidget( m_gradient, m_editGroup ), 4, 4, 0, 2 );
- editLayout->addWidget( new QLabel( i18n( "Overall opacity:" ), m_editGroup ), 5, 0 );
+ editLayout->addWidget( new TQLabel( i18n( "Overall opacity:" ), m_editGroup ), 5, 0 );
m_opacity = new KIntNumInput( 100, m_editGroup );
m_opacity->setRange( 0, 100, 1, true );
m_opacity->setValue( 100 );
editLayout->addMultiCellWidget( m_opacity, 5, 5, 1, 2 );
addTab( m_editGroup, i18n( "Edit" ) );
- QGroupBox* predefGroup = new QGroupBox( i18n( "Predefined Gradients" ) );
- QGridLayout* predefLayout = new QGridLayout( predefGroup, 3, 2 );
+ TQGroupBox* predefGroup = new TQGroupBox( i18n( "Predefined Gradients" ) );
+ TQGridLayout* predefLayout = new TQGridLayout( predefGroup, 3, 2 );
predefLayout->setSpacing( 3 );
predefLayout->setMargin( 6 );
predefLayout->addRowSpacing( 0, 12 );
predefLayout->addMultiCellWidget( m_predefGradientsView = new KListBox( predefGroup ), 1, 1, 0, 2 );
- predefLayout->addWidget( m_predefDelete = new QPushButton( i18n( "&Delete" ), predefGroup ), 2, 0 );
- predefLayout->addWidget( m_predefImport = new QPushButton( i18n( "&Import" ), predefGroup ), 2, 1 );
+ predefLayout->addWidget( m_predefDelete = new TQPushButton( i18n( "&Delete" ), predefGroup ), 2, 0 );
+ predefLayout->addWidget( m_predefImport = new TQPushButton( i18n( "&Import" ), predefGroup ), 2, 1 );
m_predefImport->setEnabled( false );
addTab( predefGroup, i18n( "Predefined" ) );
} // VGradientTabWidget::setupUI
void VGradientTabWidget::setupConnections()
{
- connect( m_gradientType, SIGNAL( activated( int ) ), this, SLOT( combosChange( int ) ) );
- connect( m_gradientRepeat, SIGNAL( activated( int ) ), this, SLOT( combosChange( int ) ) );
- connect( m_gradientWidget, SIGNAL( changed() ), m_gradientPreview, SLOT( update() ) );
- connect( m_addToPredefs, SIGNAL( clicked() ), this, SLOT( addGradientToPredefs() ) );
- connect( m_predefGradientsView, SIGNAL( doubleClicked( QListBoxItem *, const QPoint & ) ), this, SLOT( changeToPredef( QListBoxItem* ) ) );
- connect( m_predefDelete, SIGNAL( clicked() ), this, SLOT( deletePredef() ) );
- connect( m_opacity, SIGNAL( valueChanged( int ) ), this, SLOT( opacityChanged( int ) ) );
+ connect( m_gradientType, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( combosChange( int ) ) );
+ connect( m_gradientRepeat, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( combosChange( int ) ) );
+ connect( m_gradientWidget, TQT_SIGNAL( changed() ), m_gradientPreview, TQT_SLOT( update() ) );
+ connect( m_addToPredefs, TQT_SIGNAL( clicked() ), this, TQT_SLOT( addGradientToPredefs() ) );
+ connect( m_predefGradientsView, TQT_SIGNAL( doubleClicked( TQListBoxItem *, const TQPoint & ) ), this, TQT_SLOT( changeToPredef( TQListBoxItem* ) ) );
+ connect( m_predefDelete, TQT_SIGNAL( clicked() ), this, TQT_SLOT( deletePredef() ) );
+ connect( m_opacity, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( opacityChanged( int ) ) );
} // VGradientTabWidget::setupConnection
void VGradientTabWidget::initUI()
@@ -241,7 +241,7 @@ void VGradientTabWidget::initUI()
m_opacity->setValue( 100 );
m_predefGradientsView->clear();
- QPtrList<VGradientListItem>* gradientList = m_resourceServer->gradients();
+ TQPtrList<VGradientListItem>* gradientList = m_resourceServer->gradients();
if( gradientList->count() > 0 )
for( VGradientListItem* g = gradientList->first(); g != NULL; g = gradientList->next() )
m_predefGradientsView->insertItem( new VGradientListItem( *g ) );
@@ -306,7 +306,7 @@ void VGradientTabWidget::addGradientToPredefs()
m_predefGradientsView->insertItem( item );
} // VGradientTabWidget::addGradientToPredefs()
-void VGradientTabWidget::predefSelected( QListBoxItem* item )
+void VGradientTabWidget::predefSelected( TQListBoxItem* item )
{
if( item )
{
@@ -315,7 +315,7 @@ void VGradientTabWidget::predefSelected( QListBoxItem* item )
}
} // VGradientTabWidget::predefSelected
-void VGradientTabWidget::changeToPredef( QListBoxItem* item )
+void VGradientTabWidget::changeToPredef( TQListBoxItem* item )
{
if( item )
{