summaryrefslogtreecommitdiffstats
path: root/kword/KWTableTemplateSelector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kword/KWTableTemplateSelector.cpp')
-rw-r--r--kword/KWTableTemplateSelector.cpp112
1 files changed, 56 insertions, 56 deletions
diff --git a/kword/KWTableTemplateSelector.cpp b/kword/KWTableTemplateSelector.cpp
index e80c5bba9..fe4cb1c50 100644
--- a/kword/KWTableTemplateSelector.cpp
+++ b/kword/KWTableTemplateSelector.cpp
@@ -33,15 +33,15 @@
#include <kstandarddirs.h>
#include <kdebug.h>
-#include <qlabel.h>
-#include <qbuttongroup.h>
-#include <qcheckbox.h>
-#include <qcombobox.h>
-#include <qfile.h>
-#include <qdom.h>
-#include <qrect.h>
-#include <qptrlist.h>
-#include <qlayout.h>
+#include <tqlabel.h>
+#include <tqbuttongroup.h>
+#include <tqcheckbox.h>
+#include <tqcombobox.h>
+#include <tqfile.h>
+#include <tqdom.h>
+#include <tqrect.h>
+#include <tqptrlist.h>
+#include <tqlayout.h>
#include <stdlib.h>
#include <math.h>
@@ -50,8 +50,8 @@
/* Class: KWTableTemplatePreview */
/******************************************************************/
-KWTableTemplatePreview::KWTableTemplatePreview( const QString& title, KWTableStyle *_emptyStyle, QWidget* parent, const char* name )
- : QGroupBox( title, parent, name )
+KWTableTemplatePreview::KWTableTemplatePreview( const TQString& title, KWTableStyle *_emptyStyle, TQWidget* tqparent, const char* name )
+ : TQGroupBox( title, tqparent, name )
{
m_emptyStyle = _emptyStyle;
m_zoomHandler = new KoTextZoomHandler;
@@ -141,12 +141,12 @@ int KWTableTemplatePreview::rightBorder(const int rows, const int cols, const in
return 0;
}
-void KWTableTemplatePreview::drawCell( QPainter *p, const KWTableStyle *ts, const QRect globalRect,
- const int rows, int cols, int rowpos, int colpos, const QString & txt)
+void KWTableTemplatePreview::drawCell( TQPainter *p, const KWTableStyle *ts, const TQRect globalRect,
+ const int rows, int cols, int rowpos, int colpos, const TQString & txt)
{
if (!ts) return;
- QRect insRect;
+ TQRect insRect;
p->resetXForm();
p->setClipping( false );
@@ -172,7 +172,7 @@ void KWTableTemplatePreview::drawCell( QPainter *p, const KWTableStyle *ts, cons
if (bb==0)
bb = bottomBorder(rows,cols,rowpos-1,colpos-1);
- p->fillRect( QRect( colpos*wid + globalRect.x() + ( (rb <= ts->frameStyle()->rightBorder().width()) ? int(ts->frameStyle()->rightBorder().width()) : rb ),
+ p->fillRect( TQRect( colpos*wid + globalRect.x() + ( (rb <= ts->frameStyle()->rightBorder().width()) ? int(ts->frameStyle()->rightBorder().width()) : rb ),
rowpos*hei + globalRect.y() + ( (bb <= ts->frameStyle()->topBorder().width()) ? int(ts->frameStyle()->topBorder().width()) : bb ),
wid + ( ( (wrb > ts->frameStyle()->rightBorder().width()) && ((rb > ts->frameStyle()->rightBorder().width()) || ((rb==0) && (ts->frameStyle()->rightBorder().width()==0) ) ) && ((wrb-rb)>0) ) ? wrb : 0 ),
hei + ( ( (hbb > ts->frameStyle()->bottomBorder().width()) && ((bb > ts->frameStyle()->topBorder().width()) || ((bb==0) && (ts->frameStyle()->topBorder().width()==0) ) ) && ((hbb-bb)>0) ) ? hbb : 0 )),
@@ -190,15 +190,15 @@ void KWTableTemplatePreview::drawCell( QPainter *p, const KWTableStyle *ts, cons
{
// For centering to work, and to even get word wrapping when the thing is too big :)
m_textdoc->setWidth( widthLU );
- parag->invalidate(0);
+ parag->tqinvalidate(0);
}
double x_add = ( (rb < ts->frameStyle()->rightBorder().width()) ?
ts->frameStyle()->rightBorder().width() : rb ) +1;
double y_add = ( (bb < ts->frameStyle()->topBorder().width()) ?
ts->frameStyle()->topBorder().width() : bb ) + 1;
- QRect textRect = parag->pixelRect( m_zoomHandler );
- textRect.moveTopLeft( QPoint( insRect.x() + static_cast<int>(x_add),
+ TQRect textRect = parag->pixelRect( m_zoomHandler );
+ textRect.moveTopLeft( TQPoint( insRect.x() + static_cast<int>(x_add),
insRect.y() + static_cast<int>(y_add)) );
@@ -207,8 +207,8 @@ void KWTableTemplatePreview::drawCell( QPainter *p, const KWTableStyle *ts, cons
p->setClipRect( textRect.intersect( globalRect ) );
p->translate( textRect.x(), textRect.y() );
- QColorGroup cg = QApplication::palette().active();
- cg.setBrush( QColorGroup::Base, ts->frameStyle()->backgroundColor() );
+ TQColorGroup cg = TQApplication::tqpalette().active();
+ cg.setBrush( TQColorGroup::Base, ts->frameStyle()->backgroundColor() );
m_textdoc->drawWYSIWYG( p, 1, 0, textRect.width() - 1, textRect.height(), cg, m_zoomHandler );
@@ -216,7 +216,7 @@ void KWTableTemplatePreview::drawCell( QPainter *p, const KWTableStyle *ts, cons
p->resetXForm();
p->setClipping( false );
- QRect cell(globalRect.x(), globalRect.y(),
+ TQRect cell(globalRect.x(), globalRect.y(),
int( globalRect.width() + ts->frameStyle()->rightBorder().width() ),
int( globalRect.height() + ts->frameStyle()->bottomBorder().width() ));
p->setClipRect( insRect.intersect( cell ) );
@@ -254,10 +254,10 @@ void KWTableTemplatePreview::drawCell( QPainter *p, const KWTableStyle *ts, cons
}
-void KWTableTemplatePreview::drawPreviewTable( QPainter *p, int rows, int cols, QRect globalRect )
+void KWTableTemplatePreview::drawPreviewTable( TQPainter *p, int rows, int cols, TQRect globalRect )
{
KWTableStyle *cell = 0L;
- QString txt;
+ TQString txt;
for ( int i = 0; i < rows; i++ )
{
@@ -299,25 +299,25 @@ void KWTableTemplatePreview::drawPreviewTable( QPainter *p, int rows, int cols,
if ( ( j==0 ) && ( i>0 ) )
txt = m_contents[1][i];
else
- txt = QString::number(i) + QString::number(j);
+ txt = TQString::number(i) + TQString::number(j);
drawCell( p, cell, globalRect, rows, cols, i, j, txt );
}
}
}
-void KWTableTemplatePreview::drawContents( QPainter *p )
+void KWTableTemplatePreview::drawContents( TQPainter *p )
{
p->save();
- QRect r = contentsRect();
+ TQRect r = contentsRect();
// 1. Draw fake document white background
- p->fillRect( QRect( 10, 20, r.width() - 20, r.height() - 20 ), QColor("white") );
+ p->fillRect( TQRect( 10, 20, r.width() - 20, r.height() - 20 ), TQColor("white") );
// 2. Draw preview table
if (tableTemplate) {
- QRect tableRect;
+ TQRect tableRect;
int x,y;
// x
@@ -403,7 +403,7 @@ void KWTableTemplatePreview::setTableTemplate( KWTableTemplate *_tableTemplate )
setSpecialCells(_tableTemplate);
- repaint( true );
+ tqrepaint( true );
}
void KWTableTemplatePreview::fillContents()
@@ -447,7 +447,7 @@ void KWTableTemplatePreview::cbFirstRowChanged( bool enable )
if ( (!enable) && ( origTableTemplate->pTopRightCorner()==origTableTemplate->pFirstRow() ) )
tableTemplate->setTopRightCorner( tableTemplate->pBodyCell() );
if ( !m_disableRepaint )
- repaint( true );
+ tqrepaint( true );
}
void KWTableTemplatePreview::cbFirstColChanged( bool enable )
@@ -470,7 +470,7 @@ void KWTableTemplatePreview::cbFirstColChanged( bool enable )
tableTemplate->setBottomLeftCorner( tableTemplate->pBodyCell() );
if ( !m_disableRepaint )
- repaint( true );
+ tqrepaint( true );
}
void KWTableTemplatePreview::cbLastRowChanged( bool enable )
@@ -493,7 +493,7 @@ void KWTableTemplatePreview::cbLastRowChanged( bool enable )
tableTemplate->setBottomLeftCorner( tableTemplate->pBodyCell() );
if ( !m_disableRepaint )
- repaint( true );
+ tqrepaint( true );
}
void KWTableTemplatePreview::cbLastColChanged( bool enable )
@@ -516,7 +516,7 @@ void KWTableTemplatePreview::cbLastColChanged( bool enable )
tableTemplate->setBottomRightCorner( tableTemplate->pBodyCell() );
if ( !m_disableRepaint )
- repaint( true );
+ tqrepaint( true );
}
void KWTableTemplatePreview::cbBodyChanged( bool enable )
@@ -533,7 +533,7 @@ void KWTableTemplatePreview::cbBodyChanged( bool enable )
delete oldTemplate;
if ( !m_disableRepaint )
- repaint( true );
+ tqrepaint( true );
}
@@ -542,19 +542,19 @@ void KWTableTemplatePreview::cbBodyChanged( bool enable )
/* Class: KWTableTemplateSelector */
/******************************************************************/
-KWTableTemplateSelector::KWTableTemplateSelector( KWDocument *_doc, QWidget *_parent, const QString & _tableTemplate, int _type,const char *_name)
- : QWidget( _parent, _name )
+KWTableTemplateSelector::KWTableTemplateSelector( KWDocument *_doc, TQWidget *_parent, const TQString & _tableTemplate, int _type,const char *_name)
+ : TQWidget( _parent, _name )
{
m_doc = _doc;
- QGridLayout *grid = new QGridLayout( this, 3, 2, 0, KDialog::spacingHint() );
+ TQGridLayout *grid = new TQGridLayout( this, 3, 2, 0, KDialog::spacingHint() );
- QWidget *innerHolder = new QWidget( this );
- QGridLayout *innerGrid = new QGridLayout( innerHolder, 2, 1, 0, KDialog::spacingHint() );
+ TQWidget *innerHolder = new TQWidget( this );
+ TQGridLayout *innerGrid = new TQGridLayout( innerHolder, 2, 1, 0, KDialog::spacingHint() );
- lbTemplates = new QListBox( innerHolder );
+ lbTemplates = new TQListBox( innerHolder );
- QPtrListIterator<KWTableTemplate> it( m_doc->tableTemplateCollection()->tableTemplateList() );
+ TQPtrListIterator<KWTableTemplate> it( m_doc->tableTemplateCollection()->tableTemplateList() );
for ( ; it.current() ; ++it )
{
lbTemplates->insertItem( it.current()->displayName() );
@@ -562,7 +562,7 @@ KWTableTemplateSelector::KWTableTemplateSelector( KWDocument *_doc, QWidget *_pa
innerGrid->addWidget( lbTemplates, 0, 0 );
- pbCustomize = new QPushButton( i18n( "&Customize" ), innerHolder );
+ pbCustomize = new TQPushButton( i18n( "&Customize" ), innerHolder );
pbCustomize->setEnabled(false);
pbCustomize->hide();
innerGrid->addWidget( pbCustomize, 1, 0 );
@@ -572,13 +572,13 @@ KWTableTemplateSelector::KWTableTemplateSelector( KWDocument *_doc, QWidget *_pa
preview = new KWTableTemplatePreview( i18n( "Preview" ), m_doc->tableStyleCollection()->findStyle("Plain"), this );
grid->addWidget( preview, 0, 1 );
- bgCustomize = new QButtonGroup( 3, Horizontal, i18n( "Apply To" ), this );
+ bgCustomize = new TQButtonGroup( 3,Qt::Horizontal, i18n( "Apply To" ), this );
- cbFirstRow = new QCheckBox( i18n( "First row" ), bgCustomize );
- cbLastRow = new QCheckBox( i18n( "Last row" ), bgCustomize );
- cbBody = new QCheckBox( i18n( "Body" ), bgCustomize );
- cbFirstCol = new QCheckBox( i18n( "First column" ), bgCustomize );
- cbLastCol = new QCheckBox( i18n( "Last column" ), bgCustomize );
+ cbFirstRow = new TQCheckBox( i18n( "First row" ), bgCustomize );
+ cbLastRow = new TQCheckBox( i18n( "Last row" ), bgCustomize );
+ cbBody = new TQCheckBox( i18n( "Body" ), bgCustomize );
+ cbFirstCol = new TQCheckBox( i18n( "First column" ), bgCustomize );
+ cbLastCol = new TQCheckBox( i18n( "Last column" ), bgCustomize );
grid->addWidget( bgCustomize, 1, 1 );
@@ -589,14 +589,14 @@ KWTableTemplateSelector::KWTableTemplateSelector( KWDocument *_doc, QWidget *_pa
grid->setColStretch( 1, 1 );
grid->activate();
- connect( cbFirstRow, SIGNAL( toggled( bool ) ), preview, SLOT( cbFirstRowChanged( bool ) ) );
- connect( cbFirstCol, SIGNAL( toggled( bool ) ), preview, SLOT( cbFirstColChanged( bool ) ) );
- connect( cbLastRow, SIGNAL( toggled( bool ) ), preview, SLOT( cbLastRowChanged( bool ) ) );
- connect( cbLastCol, SIGNAL( toggled( bool ) ), preview, SLOT( cbLastColChanged( bool ) ) );
- connect( cbBody, SIGNAL( toggled( bool ) ), preview, SLOT( cbBodyChanged( bool ) ) );
+ connect( cbFirstRow, TQT_SIGNAL( toggled( bool ) ), preview, TQT_SLOT( cbFirstRowChanged( bool ) ) );
+ connect( cbFirstCol, TQT_SIGNAL( toggled( bool ) ), preview, TQT_SLOT( cbFirstColChanged( bool ) ) );
+ connect( cbLastRow, TQT_SIGNAL( toggled( bool ) ), preview, TQT_SLOT( cbLastRowChanged( bool ) ) );
+ connect( cbLastCol, TQT_SIGNAL( toggled( bool ) ), preview, TQT_SLOT( cbLastColChanged( bool ) ) );
+ connect( cbBody, TQT_SIGNAL( toggled( bool ) ), preview, TQT_SLOT( cbBodyChanged( bool ) ) );
- connect( lbTemplates, SIGNAL( selectionChanged () ), this, SLOT( changeTableTemplate() ) );
- QListBoxItem * item = lbTemplates->findItem( _tableTemplate );
+ connect( lbTemplates, TQT_SIGNAL( selectionChanged () ), this, TQT_SLOT( changeTableTemplate() ) );
+ TQListBoxItem * item = lbTemplates->tqfindItem( _tableTemplate );
int index = 0;
if ( item )
index = lbTemplates->index ( item );
@@ -648,7 +648,7 @@ void KWTableTemplateSelector::initPreview()
preview->cbLastColChanged( cbLastCol->isChecked() );
preview->cbBodyChanged( cbBody->isChecked() );
preview->disableRepaint(false);
- preview->repaint();
+ preview->tqrepaint();
}
int KWTableTemplateSelector::getFormatType() const