summaryrefslogtreecommitdiffstats
path: root/kspread/dialogs/kspread_dlg_paperlayout.cc
diff options
context:
space:
mode:
Diffstat (limited to 'kspread/dialogs/kspread_dlg_paperlayout.cc')
-rw-r--r--kspread/dialogs/kspread_dlg_paperlayout.cc182
1 files changed, 91 insertions, 91 deletions
diff --git a/kspread/dialogs/kspread_dlg_paperlayout.cc b/kspread/dialogs/kspread_dlg_paperlayout.cc
index 771cee5b..6c277be6 100644
--- a/kspread/dialogs/kspread_dlg_paperlayout.cc
+++ b/kspread/dialogs/kspread_dlg_paperlayout.cc
@@ -31,14 +31,14 @@
#include <kspread_view.h>
#include <selection.h>
-#include <qcheckbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qradiobutton.h>
-#include <qbuttongroup.h>
-#include <qcombobox.h>
-#include <qlayout.h>
-#include <qhgroupbox.h>
+#include <tqcheckbox.h>
+#include <tqlabel.h>
+#include <tqlineedit.h>
+#include <tqradiobutton.h>
+#include <tqbuttongroup.h>
+#include <tqcombobox.h>
+#include <tqlayout.h>
+#include <tqhgroupbox.h>
#include <kapplication.h>
#include <kdebug.h>
@@ -47,19 +47,19 @@
using namespace KSpread;
-PaperLayout::PaperLayout( QWidget * parent, const char * name,
- const KoPageLayout & layout,
+PaperLayout::PaperLayout( TQWidget * tqparent, const char * name,
+ const KoPageLayout & tqlayout,
const KoHeadFoot & headfoot,
int tabs, KoUnit::Unit unit,
Sheet * sheet, View * view)
- : KoPageLayoutDia( parent, name, layout, headfoot, tabs, unit, false /*no modal*/),
+ : KoPageLayoutDia( tqparent, name, tqlayout, headfoot, tabs, unit, false /*no modal*/),
m_pSheet( sheet ),
m_pView( view )
{
initTab();
- connect(view->selectionInfo(), SIGNAL(changed(const Region&)),
- this, SLOT(slotSelectionChanged()));
- qApp->installEventFilter( this );
+ connect(view->selectionInfo(), TQT_SIGNAL(changed(const Region&)),
+ this, TQT_SLOT(slotSelectionChanged()));
+ tqApp->installEventFilter( this );
m_focus= 0L;
}
@@ -67,10 +67,10 @@ void PaperLayout::initTab()
{
SheetPrint* print = m_pSheet->print();
- QWidget *tab = addPage(i18n( "Options" ));
- QVBoxLayout *vbox = new QVBoxLayout( tab, KDialog::marginHint(), KDialog::spacingHint() );
+ TQWidget *tab = addPage(i18n( "Options" ));
+ TQVBoxLayout *vbox = new TQVBoxLayout( tab, KDialog::marginHint(), KDialog::spacingHint() );
- pApplyToAll = new QCheckBox ( i18n( "&Apply to all sheets" ), tab );
+ pApplyToAll = new TQCheckBox ( i18n( "&Apply to all sheets" ), tab );
pApplyToAll->setChecked( print->printGrid() );
vbox->addWidget( pApplyToAll );
@@ -86,76 +86,76 @@ void PaperLayout::initTab()
vbox->addStretch( 1 );
}
-void PaperLayout::initGeneralOptions( QWidget * tab, QVBoxLayout * vbox )
+void PaperLayout::initGeneralOptions( TQWidget * tab, TQVBoxLayout * vbox )
{
SheetPrint* print = m_pSheet->print();
- QGroupBox *group = new QGroupBox( i18n("General Options"), tab );
- QGridLayout *l = new QGridLayout( group, 2, 3 );
+ TQGroupBox *group = new TQGroupBox( i18n("General Options"), tab );
+ TQGridLayout *l = new TQGridLayout( group, 2, 3 );
- pPrintGrid = new QCheckBox ( i18n("Print &grid"), group );
+ pPrintGrid = new TQCheckBox ( i18n("Print &grid"), group );
pPrintGrid->setChecked( print->printGrid() );
l->addWidget( pPrintGrid, 0, 0 );
- pPrintCommentIndicator = new QCheckBox ( i18n("Print &comment indicator"), group );
+ pPrintCommentIndicator = new TQCheckBox ( i18n("Print &comment indicator"), group );
pPrintCommentIndicator->setChecked( print->printCommentIndicator() );
l->addWidget( pPrintCommentIndicator, 0, 1 );
- pPrintFormulaIndicator = new QCheckBox ( i18n("Print &formula indicator"), group );
+ pPrintFormulaIndicator = new TQCheckBox ( i18n("Print &formula indicator"), group );
pPrintFormulaIndicator->setChecked( print->printFormulaIndicator() );
l->addWidget( pPrintFormulaIndicator, 0, 2 );
- pPrintObjects = new QCheckBox ( i18n("Print &objects"), group );
+ pPrintObjects = new TQCheckBox ( i18n("Print &objects"), group );
pPrintObjects->setChecked( print->printObjects() );
l->addWidget( pPrintObjects, 1, 0 );
- pPrintCharts = new QCheckBox ( i18n("Print &charts"), group );
+ pPrintCharts = new TQCheckBox ( i18n("Print &charts"), group );
pPrintCharts->setChecked( print->printCharts() );
l->addWidget( pPrintCharts, 1, 1 );
// Not used yet unless someone implement some kind of drawing object
-// pPrintGraphics = new QCheckBox ( i18n("Print &drawings"), group );
+// pPrintGraphics = new TQCheckBox ( i18n("Print &drawings"), group );
// pPrintGraphics->setChecked( print->printGraphics() );
// l->addWidget( pPrintGraphics, 1, 2 );
vbox->addWidget( group );
}
-void PaperLayout::initRanges( QWidget * tab, QVBoxLayout * vbox )
+void PaperLayout::initRanges( TQWidget * tab, TQVBoxLayout * vbox )
{
SheetPrint* print = m_pSheet->print();
- QGroupBox *rangeGroup = new QGroupBox( i18n("Ranges"), tab );
+ TQGroupBox *rangeGroup = new TQGroupBox( i18n("Ranges"), tab );
rangeGroup->setColumnLayout( 0, Qt::Vertical );
rangeGroup->setMargin( KDialog::marginHint() );
vbox->addWidget( rangeGroup );
- QGridLayout *grid = new QGridLayout( rangeGroup->layout(), 3, 2, KDialog::spacingHint() );
+ TQGridLayout *grid = new TQGridLayout( rangeGroup->tqlayout(), 3, 2, KDialog::spacingHint() );
- QLabel *pPrintRange = new QLabel ( i18n("Print range:"), rangeGroup );
+ TQLabel *pPrintRange = new TQLabel ( i18n("Print range:"), rangeGroup );
grid->addWidget( pPrintRange, 0, 0 );
- ePrintRange = new QLineEdit( rangeGroup );
+ ePrintRange = new TQLineEdit( rangeGroup );
ePrintRange->setText( util_rangeName( print->printRange() ) );
grid->addWidget( ePrintRange, 0, 1 );
- QLabel *pRepeatCols = new QLabel ( i18n("Repeat columns on each page:"), rangeGroup );
+ TQLabel *pRepeatCols = new TQLabel ( i18n("Repeat columns on each page:"), rangeGroup );
grid->addWidget( pRepeatCols, 1, 0 );
- eRepeatCols = new QLineEdit( rangeGroup );
+ eRepeatCols = new TQLineEdit( rangeGroup );
if ( print->printRepeatColumns().first != 0 )
eRepeatCols->setText( Cell::columnName( print->printRepeatColumns().first ) + ":" +
Cell::columnName( print->printRepeatColumns().second ) );
grid->addWidget( eRepeatCols, 1, 1 );
- QLabel *pRepeatRows = new QLabel ( i18n("Repeat rows on each page:"), rangeGroup );
+ TQLabel *pRepeatRows = new TQLabel ( i18n("Repeat rows on each page:"), rangeGroup );
grid->addWidget( pRepeatRows, 2, 0 );
- eRepeatRows = new QLineEdit( rangeGroup );
+ eRepeatRows = new TQLineEdit( rangeGroup );
if ( print->printRepeatRows().first != 0 )
- eRepeatRows->setText( QString().setNum( print->printRepeatRows().first ) +
+ eRepeatRows->setText( TQString().setNum( print->printRepeatRows().first ) +
":" +
- QString().setNum( print->printRepeatRows().second ) );
+ TQString().setNum( print->printRepeatRows().second ) );
grid->addWidget( eRepeatRows, 2, 1 );
grid->addColSpacing( 0, pPrintRange->width() );
@@ -173,65 +173,65 @@ void PaperLayout::initRanges( QWidget * tab, QVBoxLayout * vbox )
grid->addRowSpacing( 2, eRepeatCols->height() );
}
-void PaperLayout::initScaleOptions( QWidget * tab, QVBoxLayout * vbox )
+void PaperLayout::initScaleOptions( TQWidget * tab, TQVBoxLayout * vbox )
{
SheetPrint* print = m_pSheet->print();
- QButtonGroup *zoomGroup = new QButtonGroup( i18n("Scale Printout"), tab );
+ TQButtonGroup *zoomGroup = new TQButtonGroup( i18n("Scale Printout"), tab );
zoomGroup->setColumnLayout( 0, Qt::Vertical );
zoomGroup->setMargin( KDialog::marginHint() );
vbox->addWidget( zoomGroup );
- QGridLayout *grid = new QGridLayout( zoomGroup->layout(), 2, 6,
+ TQGridLayout *grid = new TQGridLayout( zoomGroup->tqlayout(), 2, 6,
KDialog::spacingHint() );
- m_rScalingZoom = new QRadioButton ( i18n("Zoom:"), zoomGroup );
+ m_rScalingZoom = new TQRadioButton ( i18n("Zoom:"), zoomGroup );
grid->addWidget( m_rScalingZoom, 0, 0 );
- m_cZoom = new QComboBox( true, zoomGroup, "Zoom" );
- grid->addMultiCellWidget( m_cZoom, 0, 0, 1, 5, Qt::AlignLeft );
+ m_cZoom = new TQComboBox( true, zoomGroup, "Zoom" );
+ grid->addMultiCellWidget( m_cZoom, 0, 0, 1, 5, TQt::AlignLeft );
- QStringList lst;
+ TQStringList lst;
for( int i = 5; i < 500; i += 5 )
{
- lst.append( QString( i18n( "%1%" ) ).arg( i ) );
- if( qRound( print->zoom() * 100 ) > i &&
- qRound( print->zoom() * 100 ) < i + 5 )
+ lst.append( TQString( i18n( "%1%" ) ).tqarg( i ) );
+ if( tqRound( print->zoom() * 100 ) > i &&
+ tqRound( print->zoom() * 100 ) < i + 5 )
{
- lst.append( QString( i18n( "%1%" ) ).arg( qRound( print->zoom() * 100 ) ) );
+ lst.append( TQString( i18n( "%1%" ) ).tqarg( tqRound( print->zoom() * 100 ) ) );
}
}
m_cZoom->insertStringList( lst );
int number_of_entries = m_cZoom->count();
- QString string = QString( i18n( "%1%" ) ).arg( qRound( print->zoom() * 100 ) );
+ TQString string = TQString( i18n( "%1%" ) ).tqarg( tqRound( print->zoom() * 100 ) );
for (int i = 0; i < number_of_entries ; i++)
{
- if ( string == (QString) m_cZoom->text(i) )
+ if ( string == (TQString) m_cZoom->text(i) )
{
m_cZoom->setCurrentItem( i );
break;
}
}
- m_rScalingLimitPages = new QRadioButton ( i18n("Limit pages:"), zoomGroup );
+ m_rScalingLimitPages = new TQRadioButton ( i18n("Limit pages:"), zoomGroup );
grid->addWidget( m_rScalingLimitPages, 1, 0 );
- QLabel *pLimitPagesX = new QLabel ( i18n("X:"), zoomGroup );
+ TQLabel *pLimitPagesX = new TQLabel ( i18n("X:"), zoomGroup );
grid->addWidget( pLimitPagesX, 1, 1 );
- m_cLimitPagesX = new QComboBox( true, zoomGroup, "pagesX" );
+ m_cLimitPagesX = new TQComboBox( true, zoomGroup, "pagesX" );
grid->addWidget( m_cLimitPagesX, 1, 2 );
- QStringList lstX;
+ TQStringList lstX;
lstX.append( i18n( "No Limit" ) );
for( int i = 1; i <= 20; i += 1 )
{
- lstX.append( QString( "%1" ).arg( i ) );
+ lstX.append( TQString( "%1" ).tqarg( i ) );
}
if( print->pageLimitX() > 20 )
{
- lstX.append( QString( "%1" ).arg( print->pageLimitX() ) );
+ lstX.append( TQString( "%1" ).tqarg( print->pageLimitX() ) );
}
m_cLimitPagesX->insertStringList( lstX );
@@ -240,21 +240,21 @@ void PaperLayout::initScaleOptions( QWidget * tab, QVBoxLayout * vbox )
else
m_cLimitPagesX->setCurrentItem( 21 );
- QLabel *pLimitPagesY = new QLabel ( i18n("Y:"), zoomGroup );
+ TQLabel *pLimitPagesY = new TQLabel ( i18n("Y:"), zoomGroup );
grid->addWidget( pLimitPagesY, 1, 3 );
- m_cLimitPagesY = new QComboBox( true, zoomGroup, "pagesY" );
+ m_cLimitPagesY = new TQComboBox( true, zoomGroup, "pagesY" );
grid->addWidget( m_cLimitPagesY, 1, 4 );
- QStringList lstY;
+ TQStringList lstY;
lstY.append( i18n( "No Limit" ) );
for( int i = 1; i <= 20; i += 1 )
{
- lstY.append( QString( "%1" ).arg( i ) );
+ lstY.append( TQString( "%1" ).tqarg( i ) );
}
if( print->pageLimitY() > 20 )
{
- lstY.append( QString( "%1" ).arg( print->pageLimitY() ) );
+ lstY.append( TQString( "%1" ).tqarg( print->pageLimitY() ) );
}
m_cLimitPagesY->insertStringList( lstY );
@@ -272,9 +272,9 @@ void PaperLayout::initScaleOptions( QWidget * tab, QVBoxLayout * vbox )
m_rScalingZoom->setChecked( true );
}
- connect( m_cZoom, SIGNAL( activated( int ) ), this, SLOT( slotChooseZoom( int ) ) );
- connect( m_cLimitPagesX, SIGNAL( activated( int ) ), this, SLOT( slotChoosePageLimit( int ) ) );
- connect( m_cLimitPagesY, SIGNAL( activated( int ) ), this, SLOT( slotChoosePageLimit( int ) ) );
+ connect( m_cZoom, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( slotChooseZoom( int ) ) );
+ connect( m_cLimitPagesX, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( slotChoosePageLimit( int ) ) );
+ connect( m_cLimitPagesY, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( slotChoosePageLimit( int ) ) );
}
void PaperLayout::slotChooseZoom( int /*index*/ )
@@ -312,7 +312,7 @@ void PaperLayout::slotOk()
{
SheetPrint *print = sheet->print();
- KoPageLayout pl = layout();
+ KoPageLayout pl = tqlayout();
KoHeadFoot hf = headFoot();
KoUnit::Unit unit = sheet->doc()->unit();
print->setPrintGrid( pPrintGrid->isChecked() );
@@ -321,17 +321,17 @@ void PaperLayout::slotOk()
print->setPrintObjects( pPrintObjects->isChecked() );
print->setPrintCharts( pPrintCharts->isChecked() );
// print->setPrintGraphics( pPrintGraphics->isChecked() );
- QString tmpPrintRange = ePrintRange->text();
- QString tmpRepeatCols = eRepeatCols->text();
- QString tmpRepeatRows = eRepeatRows->text();
+ TQString tmpPrintRange = ePrintRange->text();
+ TQString tmpRepeatCols = eRepeatCols->text();
+ TQString tmpRepeatRows = eRepeatRows->text();
if ( tmpPrintRange.isEmpty() )
{
- print->setPrintRange( QRect( QPoint( 1, 1 ), QPoint( KS_colMax, KS_rowMax ) ) );
+ print->setPrintRange( TQRect( TQPoint( 1, 1 ), TQPoint( KS_colMax, KS_rowMax ) ) );
}
else
{
bool error = true;
- int first = tmpPrintRange.find(":");
+ int first = tmpPrintRange.tqfind(":");
if ( ( first != -1 ) && ( (int)tmpPrintRange.length() > first ) )
{
Point point1 ( tmpPrintRange.left( first ) );
@@ -341,10 +341,10 @@ void PaperLayout::slotOk()
if ( point2.isValid() )
{
error = false;
- print->setPrintRange ( QRect( QPoint( QMIN( point1.pos().x(), point2.pos().x() ),
- QMIN( point1.pos().y(), point2.pos().y() ) ),
- QPoint( QMAX( point1.pos().x(), point2.pos().x() ),
- QMAX( point1.pos().y(), point2.pos().y() ) ) ) );
+ print->setPrintRange ( TQRect( TQPoint( TQMIN( point1.pos().x(), point2.pos().x() ),
+ TQMIN( point1.pos().y(), point2.pos().y() ) ),
+ TQPoint( TQMAX( point1.pos().x(), point2.pos().x() ),
+ TQMAX( point1.pos().y(), point2.pos().y() ) ) ) );
}
}
}
@@ -354,12 +354,12 @@ void PaperLayout::slotOk()
if ( tmpRepeatCols.isEmpty() )
{
- print->setPrintRepeatColumns( qMakePair( 0, 0 ) );
+ print->setPrintRepeatColumns( tqMakePair( 0, 0 ) );
}
else
{
bool error = true;
- int first = tmpRepeatCols.find(":");
+ int first = tmpRepeatCols.tqfind(":");
if ( ( first != -1 ) && ( (int)tmpRepeatCols.length() > first ) )
{
int col1 = util_decodeColumnLabelText( tmpRepeatCols.left( first ) );
@@ -369,7 +369,7 @@ void PaperLayout::slotOk()
if ( col2 > 0 && col2 <= KS_colMax )
{
error = false;
- print->setPrintRepeatColumns ( qMakePair( col1, col2 ) );
+ print->setPrintRepeatColumns ( tqMakePair( col1, col2 ) );
}
}
}
@@ -380,12 +380,12 @@ void PaperLayout::slotOk()
if ( tmpRepeatRows.isEmpty() )
{
- print->setPrintRepeatRows ( qMakePair( 0, 0 ) );
+ print->setPrintRepeatRows ( tqMakePair( 0, 0 ) );
}
else
{
bool error = true;
- int first = tmpRepeatRows.find(":");
+ int first = tmpRepeatRows.tqfind(":");
if ( ( first != -1 ) && ( (int)tmpRepeatRows.length() > first ) )
{
int row1 = tmpRepeatRows.left( first ).toInt();
@@ -395,7 +395,7 @@ void PaperLayout::slotOk()
if ( row2 > 0 && row2 <= KS_rowMax )
{
error = false;
- print->setPrintRepeatRows ( qMakePair( row1, row2 ) );
+ print->setPrintRepeatRows ( tqMakePair( row1, row2 ) );
}
}
}
@@ -407,11 +407,11 @@ void PaperLayout::slotOk()
if ( m_rScalingZoom->isChecked() )
{
kdDebug() << "Zoom is selected" << endl;
- if( QString( "%1%" ).arg( qRound( print->zoom() * 100 ) ) != m_cZoom->currentText() )
+ if( TQString( "%1%" ).tqarg( tqRound( print->zoom() * 100 ) ) != m_cZoom->currentText() )
{
kdDebug() << "New zoom is different than original: " << m_cZoom->currentText() << endl;
- QString zoomtext = m_cZoom->currentText();
- zoomtext.replace("%","");
+ TQString zoomtext = m_cZoom->currentText();
+ zoomtext.tqreplace("%","");
bool convertok = false;
double zoomvalue = zoomtext.toDouble(&convertok);
if (!convertok)
@@ -478,8 +478,8 @@ void PaperLayout::slotOk()
if ( pl.format == PG_CUSTOM )
{
- print->setPaperWidth( qRound( POINT_TO_MM( pl.ptWidth ) *1000 ) / 1000 );
- print->setPaperHeight( qRound( POINT_TO_MM( pl.ptHeight ) *1000 ) / 1000 );
+ print->setPaperWidth( tqRound( POINT_TO_MM( pl.ptWidth ) *1000 ) / 1000 );
+ print->setPaperHeight( tqRound( POINT_TO_MM( pl.ptHeight ) *1000 ) / 1000 );
}
print->setPaperLayout( POINT_TO_MM(pl.ptLeft), POINT_TO_MM(pl.ptTop),
@@ -505,7 +505,7 @@ void PaperLayout::slotOk()
accept();
}
-void PaperLayout::closeEvent ( QCloseEvent * )
+void PaperLayout::closeEvent ( TQCloseEvent * )
{
delete this;
}
@@ -516,7 +516,7 @@ void PaperLayout::slotSelectionChanged()
if (!m_pView->selectionInfo()->isValid())
return;
- QString area = util_rangeName( m_pView->selectionInfo()->lastRange() );
+ TQString area = util_rangeName( m_pView->selectionInfo()->lastRange() );
if ( m_focus )
{
if ( m_focus == ePrintRange )
@@ -536,13 +536,13 @@ void PaperLayout::slotCancel()
reject();
}
-bool PaperLayout::eventFilter( QObject* obj, QEvent* ev )
+bool PaperLayout::eventFilter( TQObject* obj, TQEvent* ev )
{
- if ( obj == ePrintRange && ev->type() == QEvent::FocusIn )
+ if ( TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(ePrintRange) && ev->type() == TQEvent::FocusIn )
m_focus = ePrintRange;
- else if ( obj == eRepeatCols && ev->type() == QEvent::FocusIn )
+ else if ( TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(eRepeatCols) && ev->type() == TQEvent::FocusIn )
m_focus = eRepeatCols;
- else if ( obj == eRepeatRows && ev->type() == QEvent::FocusIn )
+ else if ( TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(eRepeatRows) && ev->type() == TQEvent::FocusIn )
m_focus = eRepeatRows;
else
return false;