diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kspread/dialogs/kspread_dlg_goalseek.cc | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kspread/dialogs/kspread_dlg_goalseek.cc')
-rw-r--r-- | kspread/dialogs/kspread_dlg_goalseek.cc | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/kspread/dialogs/kspread_dlg_goalseek.cc b/kspread/dialogs/kspread_dlg_goalseek.cc index a87ad3ef..beae8437 100644 --- a/kspread/dialogs/kspread_dlg_goalseek.cc +++ b/kspread/dialogs/kspread_dlg_goalseek.cc @@ -42,22 +42,22 @@ #include <kstdguiitem.h> #include <kpushbutton.h> -#include <qframe.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qlineedit.h> -#include <qtooltip.h> -#include <qvariant.h> -#include <qwhatsthis.h> +#include <tqframe.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqlineedit.h> +#include <tqtooltip.h> +#include <tqvariant.h> +#include <tqwhatsthis.h> #include <math.h> using namespace KSpread; -GoalSeekDialog::GoalSeekDialog( View * parent, QPoint const & marker, +GoalSeekDialog::GoalSeekDialog( View * tqparent, TQPoint const & marker, const char * name, bool, WFlags fl ) - : KDialog( parent, name, false, fl ), - m_pView( parent ), + : KDialog( tqparent, name, false, fl ), + m_pView( tqparent ), m_maxIter( 1000 ), m_restored( true ), m_focus(0), @@ -65,7 +65,7 @@ GoalSeekDialog::GoalSeekDialog( View * parent, QPoint const & marker, m_marker( m_pView->selectionInfo()->marker() ), m_selection( m_pView->selectionInfo()->selection() ) { - setWFlags( Qt::WDestructiveClose ); + setWFlags( TQt::WDestructiveClose ); if ( !name ) setName( "GoalSeekDialog" ); @@ -74,41 +74,41 @@ GoalSeekDialog::GoalSeekDialog( View * parent, QPoint const & marker, setCaption( i18n( "Goal Seek" ) ); setSizeGripEnabled( true ); - GoalSeekDialogLayout = new QGridLayout( this, 1, 1, 11, 6, "GoalSeekDialogLayout"); + GoalSeekDialogLayout = new TQGridLayout( this, 1, 1, 11, 6, "GoalSeekDialogLayout"); - m_startFrame = new QFrame( this, "m_startFrame" ); - m_startFrame->setFrameShape( QFrame::StyledPanel ); - m_startFrame->setFrameShadow( QFrame::Raised ); - m_startFrameLayout = new QGridLayout( m_startFrame, 1, 1, 11, 6, "m_startFrameLayout"); + m_startFrame = new TQFrame( this, "m_startFrame" ); + m_startFrame->setFrameShape( TQFrame::StyledPanel ); + m_startFrame->setFrameShadow( TQFrame::Raised ); + m_startFrameLayout = new TQGridLayout( m_startFrame, 1, 1, 11, 6, "m_startFrameLayout"); - QLabel * TextLabel4 = new QLabel( m_startFrame, "TextLabel4" ); + TQLabel * TextLabel4 = new TQLabel( m_startFrame, "TextLabel4" ); TextLabel4->setText( i18n( "To value:" ) ); m_startFrameLayout->addWidget( TextLabel4, 1, 0 ); - m_targetValueEdit = new QLineEdit( m_startFrame, "m_targetValueEdit" ); + m_targetValueEdit = new TQLineEdit( m_startFrame, "m_targetValueEdit" ); m_startFrameLayout->addWidget( m_targetValueEdit, 1, 1 ); - m_targetEdit = new QLineEdit( m_startFrame, "m_targetEdit" ); + m_targetEdit = new TQLineEdit( m_startFrame, "m_targetEdit" ); m_startFrameLayout->addWidget( m_targetEdit, 0, 1 ); m_targetEdit->setText( Cell::name( marker.x(), marker.y() ) ); - m_sourceEdit = new QLineEdit( m_startFrame, "m_sourceEdit" ); + m_sourceEdit = new TQLineEdit( m_startFrame, "m_sourceEdit" ); m_startFrameLayout->addWidget( m_sourceEdit, 2, 1 ); - QLabel * TextLabel5 = new QLabel( m_startFrame, "TextLabel5" ); + TQLabel * TextLabel5 = new TQLabel( m_startFrame, "TextLabel5" ); TextLabel5->setText( i18n( "By changing cell:" ) ); m_startFrameLayout->addWidget( TextLabel5, 2, 0 ); - QLabel * TextLabel3 = new QLabel( m_startFrame, "TextLabel3" ); + TQLabel * TextLabel3 = new TQLabel( m_startFrame, "TextLabel3" ); TextLabel3->setText( i18n( "Set cell:" ) ); m_startFrameLayout->addWidget( TextLabel3, 0, 0 ); GoalSeekDialogLayout->addWidget( m_startFrame, 0, 0 ); - QVBoxLayout * Layout5 = new QVBoxLayout( 0, 0, 6, "Layout5"); + TQVBoxLayout * Layout5 = new TQVBoxLayout( 0, 0, 6, "Layout5"); - m_buttonOk = new QPushButton( this, "m_buttonOk" ); + m_buttonOk = new TQPushButton( this, "m_buttonOk" ); m_buttonOk->setText( i18n( "&Start" ) ); m_buttonOk->setAccel( 276824143 ); m_buttonOk->setAutoDefault( TRUE ); @@ -119,40 +119,40 @@ GoalSeekDialog::GoalSeekDialog( View * parent, QPoint const & marker, m_buttonCancel->setAccel( 276824131 ); m_buttonCancel->setAutoDefault( TRUE ); Layout5->addWidget( m_buttonCancel ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); + TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); Layout5->addItem( spacer ); GoalSeekDialogLayout->addMultiCellLayout( Layout5, 0, 1, 1, 1 ); - m_resultFrame = new QFrame( this, "m_resultFrame" ); - m_resultFrame->setFrameShape( QFrame::StyledPanel ); - m_resultFrame->setFrameShadow( QFrame::Raised ); + m_resultFrame = new TQFrame( this, "m_resultFrame" ); + m_resultFrame->setFrameShape( TQFrame::StyledPanel ); + m_resultFrame->setFrameShadow( TQFrame::Raised ); m_resultFrame->setMinimumWidth( 350 ); - m_resultFrameLayout = new QGridLayout( m_resultFrame, 1, 1, 11, 6, "m_resultFrameLayout"); + m_resultFrameLayout = new TQGridLayout( m_resultFrame, 1, 1, 11, 6, "m_resultFrameLayout"); - m_currentValueLabel = new QLabel( m_resultFrame, "m_currentValueLabel" ); + m_currentValueLabel = new TQLabel( m_resultFrame, "m_currentValueLabel" ); m_currentValueLabel->setText( i18n( "Current value:" ) ); m_resultFrameLayout->addWidget( m_currentValueLabel, 2, 0 ); - m_newValueDesc = new QLabel( m_resultFrame, "m_newValueDesc" ); + m_newValueDesc = new TQLabel( m_resultFrame, "m_newValueDesc" ); m_newValueDesc->setText( i18n( "New value:" ) ); m_resultFrameLayout->addWidget( m_newValueDesc, 1, 0 ); - m_newValue = new QLabel( m_resultFrame, "m_newValue" ); + m_newValue = new TQLabel( m_resultFrame, "m_newValue" ); m_newValue->setText( "m_targetValueEdit" ); m_resultFrameLayout->addWidget( m_newValue, 1, 1 ); - m_currentValue = new QLabel( m_resultFrame, "m_currentValue" ); + m_currentValue = new TQLabel( m_resultFrame, "m_currentValue" ); m_currentValue->setText( "m_currentValue" ); m_resultFrameLayout->addWidget( m_currentValue, 2, 1 ); - m_resultText = new QLabel( m_resultFrame, "m_resultText" ); + m_resultText = new TQLabel( m_resultFrame, "m_resultText" ); m_resultText->setText( "Goal seeking with cell <cell> found <a | no> solution:" ); - m_resultText->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) ); + m_resultText->tqsetAlignment( int( TQLabel::WordBreak | TQLabel::AlignVCenter ) ); m_resultFrameLayout->addMultiCellWidget( m_resultText, 0, 0, 0, 1 ); @@ -165,14 +165,14 @@ GoalSeekDialog::GoalSeekDialog( View * parent, QPoint const & marker, // Allow the user to select cells on the spreadsheet. m_pView->canvasWidget()->startChoose(); - qApp->installEventFilter( this ); + tqApp->installEventFilter( this ); // signals and slots connections - connect( m_buttonOk, SIGNAL( clicked() ), this, SLOT( buttonOkClicked() ) ); - connect( m_buttonCancel, SIGNAL( clicked() ), this, SLOT( buttonCancelClicked() ) ); + connect( m_buttonOk, TQT_SIGNAL( clicked() ), this, TQT_SLOT( buttonOkClicked() ) ); + connect( m_buttonCancel, TQT_SIGNAL( clicked() ), this, TQT_SLOT( buttonCancelClicked() ) ); - connect( m_pView->choice(), SIGNAL(changed(const Region&)), - this, SLOT(slotSelectionChanged())); + connect( m_pView->choice(), TQT_SIGNAL(changed(const Region&)), + this, TQT_SLOT(slotSelectionChanged())); // tab order setTabOrder( m_targetEdit, m_targetValueEdit ); @@ -195,13 +195,13 @@ GoalSeekDialog::~GoalSeekDialog() } } -bool GoalSeekDialog::eventFilter( QObject* obj, QEvent* ev ) +bool GoalSeekDialog::eventFilter( TQObject* obj, TQEvent* ev ) { - if ( obj == m_targetValueEdit && ev->type() == QEvent::FocusIn ) + if ( TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(m_targetValueEdit) && ev->type() == TQEvent::FocusIn ) m_focus = m_targetValueEdit; - else if ( obj == m_targetEdit && ev->type() == QEvent::FocusIn ) + else if ( TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(m_targetEdit) && ev->type() == TQEvent::FocusIn ) m_focus = m_targetEdit; - else if ( obj == m_sourceEdit && ev->type() == QEvent::FocusIn ) + else if ( TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(m_sourceEdit) && ev->type() == TQEvent::FocusIn ) m_focus = m_sourceEdit; else return FALSE; @@ -212,7 +212,7 @@ bool GoalSeekDialog::eventFilter( QObject* obj, QEvent* ev ) return FALSE; } -void GoalSeekDialog::closeEvent ( QCloseEvent * e ) +void GoalSeekDialog::closeEvent ( TQCloseEvent * e ) { e->accept(); } @@ -224,7 +224,7 @@ void GoalSeekDialog::slotSelectionChanged() if (m_pView->choice()->isValid()) { - QString area = m_pView->choice()->name(); + TQString area = m_pView->choice()->name(); m_focus->setText( area ); } } @@ -315,7 +315,7 @@ void GoalSeekDialog::buttonOkClicked() if ( !pDoc->undoLocked() ) { UndoSetText * undo - = new UndoSetText( pDoc, m_pView->activeSheet(), QString::number(m_oldSource), + = new UndoSetText( pDoc, m_pView->activeSheet(), TQString::number(m_oldSource), m_sourceCell->column(), m_sourceCell->row(), m_sourceCell->formatType() ); @@ -363,7 +363,7 @@ void GoalSeekDialog::chooseCleanup() sheet = m_pView->activeSheet(); // Revert the marker to its original position - m_pView->selectionInfo()->initialize(QRect(m_marker, m_anchor));//, sheet ); + m_pView->selectionInfo()->initialize(TQRect(m_marker, m_anchor));//, sheet ); } @@ -447,7 +447,7 @@ void GoalSeekDialog::startCalc(double _start, double _goal) --m_maxIter; if ( m_maxIter % 20 == 0 ) - m_newValue->setText( QString::number(m_maxIter) ); + m_newValue->setText( TQString::number(m_maxIter) ); } m_newValueDesc->setText( i18n( "New value:" ) ); @@ -459,7 +459,7 @@ void GoalSeekDialog::startCalc(double _start, double _goal) // m_targetCell->setCalcDirtyFlag(); m_targetCell->calc( false ); - m_resultText->setText( i18n( "Goal seeking with cell %1 found a solution:" ).arg( m_sourceEdit->text() ) ); + m_resultText->setText( i18n( "Goal seeking with cell %1 found a solution:" ).tqarg( m_sourceEdit->text() ) ); m_newValue->setText( m_pView->doc()->locale()->formatNumber( startA ) ); m_currentValue->setText( m_pView->doc()->locale()->formatNumber( m_oldSource ) ); m_restored = false; @@ -471,7 +471,7 @@ void GoalSeekDialog::startCalc(double _start, double _goal) m_targetCell->setCalcDirtyFlag(); m_sourceCell->sheet()->setRegionPaintDirty(m_sourceCell->cellRect()); m_targetCell->calc( false ); - m_resultText->setText( i18n( "Goal seeking with cell %1 has found NO solution." ).arg( m_sourceEdit->text() ) ); + m_resultText->setText( i18n( "Goal seeking with cell %1 has found NO solution." ).tqarg( m_sourceEdit->text() ) ); m_newValue->setText( "" ); m_currentValue->setText( m_pView->doc()->locale()->formatNumber( m_oldSource ) ); m_restored = true; |