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/plugins | |
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/plugins')
29 files changed, 878 insertions, 870 deletions
diff --git a/kspread/plugins/calculator/configdlg.cpp b/kspread/plugins/calculator/configdlg.cpp index 9273b91a..545ddcb5 100644 --- a/kspread/plugins/calculator/configdlg.cpp +++ b/kspread/plugins/calculator/configdlg.cpp @@ -29,7 +29,7 @@ #include <klocale.h> #include <kdialog.h> -#include <qlayout.h> +#include <tqlayout.h> // Undefine HAVE_LONG_DOUBLE for Beta 4 since RedHat 5.0 comes with a borken // glibc @@ -38,21 +38,21 @@ #undef HAVE_LONG_DOUBLE #endif -ConfigDlg::ConfigDlg(QWidget *parent, const char *name, DefStruct *defstruct) - : QDialog(parent, name) +ConfigDlg::ConfigDlg(TQWidget *tqparent, const char *name, DefStruct *defstruct) + : TQDialog(tqparent, name) { defst = defstruct; - QVBoxLayout *lay1 = new QVBoxLayout( this ); + TQVBoxLayout *lay1 = new TQVBoxLayout( this ); lay1->setMargin( KDialog::marginHint() ); lay1->setSpacing( KDialog::spacingHint() ); - box = new QGroupBox(0, Qt::Vertical, i18n("Defaults"), this, "box"); - box->layout()->setSpacing(KDialog::spacingHint()); - box->layout()->setMargin(KDialog::marginHint()); + box = new TQGroupBox(0, Qt::Vertical, i18n("Defaults"), this, "box"); + box->tqlayout()->setSpacing(KDialog::spacingHint()); + box->tqlayout()->setMargin(KDialog::marginHint()); - QGridLayout *grid1 = new QGridLayout(box->layout(),8,2); - label1 = new QLabel(box); + TQGridLayout *grid1 = new TQGridLayout(box->tqlayout(),8,2); + label1 = new TQLabel(box); label1->setText(i18n("Foreground color:")); grid1->addWidget(label1,0,0); @@ -60,10 +60,10 @@ ConfigDlg::ConfigDlg(QWidget *parent, const char *name, DefStruct *defstruct) grid1->addWidget(button1,0,1); button1->setColor( defst->forecolor ); - connect(button1 , SIGNAL( changed( const QColor & ) ), - this, SLOT( set_fore_color( const QColor & ) ) ); + connect(button1 , TQT_SIGNAL( changed( const TQColor & ) ), + this, TQT_SLOT( set_fore_color( const TQColor & ) ) ); - label2 = new QLabel(box); + label2 = new TQLabel(box); grid1->addWidget(label2,1,0); label2->setText(i18n("Background color:")); @@ -71,14 +71,14 @@ ConfigDlg::ConfigDlg(QWidget *parent, const char *name, DefStruct *defstruct) grid1->addWidget(button2,1,1); button2->setColor( defst->backcolor ); - connect(button2 , SIGNAL( changed( const QColor & ) ), - this, SLOT( set_background_color( const QColor & ) ) ); + connect(button2 , TQT_SIGNAL( changed( const TQColor & ) ), + this, TQT_SLOT( set_background_color( const TQColor & ) ) ); - // connect(button2,SIGNAL(clicked()),this,SLOT(set_background_color())); + // connect(button2,TQT_SIGNAL(clicked()),this,TQT_SLOT(set_background_color())); - label5 = new QLabel(box); + label5 = new TQLabel(box); grid1->addWidget(label5,2,0); label5->setText(i18n("Precision:")); @@ -89,7 +89,7 @@ ConfigDlg::ConfigDlg(QWidget *parent, const char *name, DefStruct *defstruct) maxprec = 12 ; #endif - precspin = new QSpinBox( box ); + precspin = new TQSpinBox( box ); precspin->setRange( 0, maxprec ); grid1->addWidget(precspin,2,1); @@ -99,7 +99,7 @@ ConfigDlg::ConfigDlg(QWidget *parent, const char *name, DefStruct *defstruct) precspin->setValue(maxprec); - cb = new QCheckBox(box); + cb = new TQCheckBox(box); grid1->addWidget(cb,3,0); cb->setText(i18n("Set fixed precision at:")); if(defst->fixed) @@ -112,7 +112,7 @@ ConfigDlg::ConfigDlg(QWidget *parent, const char *name, DefStruct *defstruct) fixprec = 10 ; #endif - precspin2 = new QSpinBox( box ); + precspin2 = new TQSpinBox( box ); precspin2->setRange(0,fixprec); grid1->addWidget(precspin2,3,1); @@ -123,42 +123,42 @@ ConfigDlg::ConfigDlg(QWidget *parent, const char *name, DefStruct *defstruct) - cb2 = new QCheckBox(box); + cb2 = new TQCheckBox(box); grid1->addWidget(cb2,4,0); cb2->setText(i18n("Beep on error")); if(defst->beep) cb2->setChecked(true); - stylegroup = new QButtonGroup(box,"stylegroup"); + stylegroup = new TQButtonGroup(box,"stylegroup"); grid1->addMultiCellWidget(stylegroup,5,7,0,1); - stylegroup->setFrameStyle(QFrame::NoFrame); + stylegroup->setFrameStyle(TQFrame::NoFrame); - QGridLayout *grid2 = new QGridLayout(stylegroup,2,2,KDialog::marginHint(), KDialog::spacingHint()); + TQGridLayout *grid2 = new TQGridLayout(stylegroup,2,2,KDialog::marginHint(), KDialog::spacingHint()); - trigstyle = new QRadioButton(i18n("Trigonometry mode"),stylegroup,"trigstyle"); + trigstyle = new TQRadioButton(i18n("Trigonometry mode"),stylegroup,"trigstyle"); grid2->addWidget(trigstyle,0,0); trigstyle->adjustSize(); trigstyle->setChecked(defst->style == 0 ); - statstyle = new QRadioButton(i18n("Statistical mode"),stylegroup,"Stats"); + statstyle = new TQRadioButton(i18n("Statistical mode"),stylegroup,"Stats"); grid2->addWidget(statstyle,1,0); statstyle->adjustSize(); statstyle->setChecked(defst->style == 1 ); - sheetstyle = new QRadioButton(i18n("Sheet mode"),stylegroup,"Sheet"); + sheetstyle = new TQRadioButton(i18n("Sheet mode"),stylegroup,"Sheet"); grid2->addWidget(sheetstyle,2,0); sheetstyle->adjustSize(); sheetstyle->setChecked(defst->style == 2 ); - button3 = new QPushButton(stylegroup); + button3 = new TQPushButton(stylegroup); grid2->addWidget(button3,0,1); button3->setText(i18n("Help")); - connect(button3,SIGNAL(clicked()),this,SLOT(help())); + connect(button3,TQT_SIGNAL(clicked()),this,TQT_SLOT(help())); lay1->addWidget(box); - connect(parent,SIGNAL(applyButtonPressed()),SLOT(okButton())); + connect(tqparent,TQT_SIGNAL(applyButtonPressed()),TQT_SLOT(okButton())); } void ConfigDlg::help() @@ -186,12 +186,12 @@ void ConfigDlg::cancelbutton() reject(); } -void ConfigDlg::set_fore_color(const QColor &_color) +void ConfigDlg::set_fore_color(const TQColor &_color) { defst->forecolor=_color; } -void ConfigDlg::set_background_color( const QColor &_color ) +void ConfigDlg::set_background_color( const TQColor &_color ) { defst->backcolor=_color; } diff --git a/kspread/plugins/calculator/configdlg.h b/kspread/plugins/calculator/configdlg.h index 0de8262e..7462f028 100644 --- a/kspread/plugins/calculator/configdlg.h +++ b/kspread/plugins/calculator/configdlg.h @@ -31,42 +31,43 @@ #ifndef _CONFIG_DLG_H_ #define _CONFIG_DLG_H_ -#include <qgroupbox.h> -#include <qcheckbox.h> -#include <qdialog.h> -#include <qlineedit.h> -#include <qpushbutton.h> -#include <qpainter.h> -#include <qlabel.h> -#include <qframe.h> -#include <qspinbox.h> +#include <tqgroupbox.h> +#include <tqcheckbox.h> +#include <tqdialog.h> +#include <tqlineedit.h> +#include <tqpushbutton.h> +#include <tqpainter.h> +#include <tqlabel.h> +#include <tqframe.h> +#include <tqspinbox.h> #include <kcolorbutton.h> #include "kcalc.h" -class ConfigDlg : public QDialog { +class ConfigDlg : public TQDialog { Q_OBJECT + TQ_OBJECT public: - ConfigDlg(QWidget *parent=0, const char *name=0, DefStruct *defstruct=NULL); + ConfigDlg(TQWidget *tqparent=0, const char *name=0, DefStruct *defstruct=NULL); ~ConfigDlg() {} DefStruct *defst ; - QLineEdit *mail; - QLineEdit *print; + TQLineEdit *mail; + TQLineEdit *print; private slots: void okButton(); void cancelbutton(); - void set_fore_color(const QColor &); - void set_background_color(const QColor &); + void set_fore_color(const TQColor &); + void set_background_color(const TQColor &); void help(); signals: @@ -78,34 +79,34 @@ public: private: - QGroupBox *box; + TQGroupBox *box; - QPushButton *ok; - QPushButton *cancel; + TQPushButton *ok; + TQPushButton *cancel; - QLabel *label1; + TQLabel *label1; KColorButton *button1; - QLabel *label2; + TQLabel *label2; KColorButton *button2; - QLabel *label3; - QPushButton *button3; - QLabel *label5; - - QGroupBox *gbox; - QCheckBox *cb; - QCheckBox *cb2; - QSpinBox* precspin; - QSpinBox* precspin2; - QCheckBox *mybox; - QCheckBox *frame3d; - - QButtonGroup *stylegroup; - QLabel *stylelabel; - QRadioButton *trigstyle; - QRadioButton *statstyle; - QRadioButton *sheetstyle; + TQLabel *label3; + TQPushButton *button3; + TQLabel *label5; + + TQGroupBox *gbox; + TQCheckBox *cb; + TQCheckBox *cb2; + TQSpinBox* precspin; + TQSpinBox* precspin2; + TQCheckBox *mybox; + TQCheckBox *frame3d; + + TQButtonGroup *stylegroup; + TQLabel *stylelabel; + TQRadioButton *trigstyle; + TQRadioButton *statstyle; + TQRadioButton *sheetstyle; }; #endif diff --git a/kspread/plugins/calculator/dlabel.cpp b/kspread/plugins/calculator/dlabel.cpp index b35f2666..011642c5 100644 --- a/kspread/plugins/calculator/dlabel.cpp +++ b/kspread/plugins/calculator/dlabel.cpp @@ -2,7 +2,7 @@ $Id: dlabel.cpp 466447 2005-10-02 17:54:10Z zander $ KCalc, a scientific calculator for the X window system using the - Qt widget libraries, available at no cost at http://www.troll.no + TQt widget libraries, available at no cost at http://www.troll.no Copyright (C) 1996 Bernd Johannes Wuebben wuebben@math.cornell.edu @@ -26,14 +26,14 @@ #include "dlabel.h" -DLabel::DLabel(QWidget *parent, const char *name) - :QLabel(parent,name){ +DLabel::DLabel(TQWidget *tqparent, const char *name) + :TQLabel(tqparent,name){ button = 0; lit = false; } -void DLabel::mousePressEvent(QMouseEvent *e){ +void DLabel::mousePressEvent(TQMouseEvent *e){ if(e->button() == LeftButton){ lit = !lit; diff --git a/kspread/plugins/calculator/dlabel.h b/kspread/plugins/calculator/dlabel.h index 9222e990..1ed80096 100644 --- a/kspread/plugins/calculator/dlabel.h +++ b/kspread/plugins/calculator/dlabel.h @@ -29,22 +29,23 @@ #ifndef _D_LABEL_H_ #define _D_LABEL_H_ -#include <qlabel.h> +#include <tqlabel.h> -class DLabel : public QLabel { +class DLabel : public TQLabel { Q_OBJECT + TQ_OBJECT public: -DLabel(QWidget *parent=0, const char *name=0); +DLabel(TQWidget *tqparent=0, const char *name=0); ~DLabel() {} protected: - void mousePressEvent ( QMouseEvent *); + void mousePressEvent ( TQMouseEvent *); public: bool isLit(); diff --git a/kspread/plugins/calculator/kcalc.cpp b/kspread/plugins/calculator/kcalc.cpp index 1726653b..a8cdc22a 100644 --- a/kspread/plugins/calculator/kcalc.cpp +++ b/kspread/plugins/calculator/kcalc.cpp @@ -26,12 +26,12 @@ #include "version.h" #include <klocale.h> #include <knotifyclient.h> -#include <qlayout.h> -#include <qobjectlist.h> -#include <qpushbutton.h> +#include <tqlayout.h> +#include <tqobjectlist.h> +#include <tqpushbutton.h> #include <kapplication.h> #include <kglobalsettings.h> -#include <qstyle.h> +#include <tqstyle.h> #include <kdialog.h> #include <kconfig.h> #include <kglobal.h> @@ -41,91 +41,91 @@ extern last_input_type last_input; extern item_contents display_data; extern num_base current_base; -QPtrList<CALCAMNT> temp_stack; +TQPtrList<CALCAMNT> temp_stack; -QtCalculator :: QtCalculator( Calculator *_corba, QWidget *parent, const char *name ) - : QDialog( parent, name ) +TQtCalculator :: TQtCalculator( Calculator *_corba, TQWidget *tqparent, const char *name ) + : TQDialog( tqparent, name ) { corba = _corba; mInternalSpacing=4; key_pressed = false; - selection_timer = new QTimer; - status_timer = new QTimer; + selection_timer = new TQTimer; + status_timer = new TQTimer; - connect(status_timer,SIGNAL(timeout()),this,SLOT(clear_status_label())); - connect(selection_timer,SIGNAL(timeout()),this,SLOT(selection_timed_out())); + connect(status_timer,TQT_SIGNAL(timeout()),this,TQT_SLOT(clear_status_label())); + connect(selection_timer,TQT_SIGNAL(timeout()),this,TQT_SLOT(selection_timed_out())); readSettings(); - QFont buttonfont( KGlobalSettings::generalFont() ); - buttonfont.setStyleStrategy( QFont::PreferAntialias ); + TQFont buttonfont( KGlobalSettings::generalFont() ); + buttonfont.setStyleStrategy( TQFont::PreferAntialias ); // Set the window caption/title - // connect(kapp,SIGNAL(kdisplayPaletteChanged()),this,SLOT(set_colors())); + // connect(kapp,TQT_SIGNAL(kdisplayPaletteChanged()),this,TQT_SLOT(set_colors())); // setCaption( kapp->caption() ); // create help button - QPushButton *pb; + TQPushButton *pb; - pb = new QPushButton( this, "helpbutton" ); + pb = new TQPushButton( this, "helpbutton" ); pb->setText( "kCalc" ); - pb->setFont( QFont("times",12,QFont::Bold,FALSE) ); - QToolTip::add( pb, i18n("KCalc Setup/Help") ); + pb->setFont( TQFont("times",12,TQFont::Bold,FALSE) ); + TQToolTip::add( pb, i18n("KCalc Setup/Help") ); - connect( pb, SIGNAL(clicked()), SLOT(configclicked()) ); + connect( pb, TQT_SIGNAL(clicked()), TQT_SLOT(configclicked()) ); // Create the display calc_display = new DLabel( this, "display" ); - calc_display->setFrameStyle( QFrame::WinPanel | QFrame::Sunken ); - calc_display->setAlignment( AlignRight|AlignVCenter ); + calc_display->setFrameStyle( TQFrame::WinPanel | TQFrame::Sunken ); + calc_display->tqsetAlignment( AlignRight|AlignVCenter ); calc_display->setFocus(); - calc_display->setFocusPolicy( QWidget::StrongFocus ); + calc_display->setFocusPolicy( TQ_StrongFocus ); - connect(calc_display,SIGNAL(clicked()),this,SLOT(display_selected())); + connect(calc_display,TQT_SIGNAL(clicked()),this,TQT_SLOT(display_selected())); - statusINVLabel = new QLabel( this, "INV" ); + statusINVLabel = new TQLabel( this, "INV" ); Q_CHECK_PTR( statusINVLabel ); - statusINVLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); - statusINVLabel->setAlignment( AlignCenter ); + statusINVLabel->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); + statusINVLabel->tqsetAlignment( AlignCenter ); statusINVLabel->setText("NORM"); - statusHYPLabel = new QLabel( this, "HYP" ); + statusHYPLabel = new TQLabel( this, "HYP" ); Q_CHECK_PTR( statusHYPLabel ); - statusHYPLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); - statusHYPLabel->setAlignment( AlignCenter ); + statusHYPLabel->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); + statusHYPLabel->tqsetAlignment( AlignCenter ); - statusERRORLabel = new QLabel( this, "ERROR" ); + statusERRORLabel = new TQLabel( this, "ERROR" ); Q_CHECK_PTR( statusERRORLabel ); - statusERRORLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); - statusERRORLabel->setAlignment( AlignLeft|AlignVCenter ); + statusERRORLabel->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); + statusERRORLabel->tqsetAlignment( AlignLeft|AlignVCenter ); // create angle button group - QAccel *accel = new QAccel( this ); + TQAccel *accel = new TQAccel( this ); - QButtonGroup *angle_group = new QButtonGroup( 3, Horizontal,this, "AngleButtons" ); + TQButtonGroup *angle_group = new TQButtonGroup( 3,Qt::Horizontal,this, "AngleButtons" ); angle_group->setTitle(i18n( "Angle") ); - anglebutton[0] = new QRadioButton( angle_group ); + anglebutton[0] = new TQRadioButton( angle_group ); anglebutton[0]->setText( "&Deg" ) ; anglebutton[0]->setChecked( TRUE); accel->connectItem( accel->insertItem(Key_D + ALT), this , - SLOT(Deg_Selected()) ); + TQT_SLOT(Deg_Selected()) ); - anglebutton[1] = new QRadioButton( angle_group ); + anglebutton[1] = new TQRadioButton( angle_group ); anglebutton[1]->setText( "&Rad" ); accel->connectItem( accel->insertItem(Key_R + ALT), this , - SLOT(Rad_Selected()) ); + TQT_SLOT(Rad_Selected()) ); - anglebutton[2] = new QRadioButton( angle_group ); + anglebutton[2] = new TQRadioButton( angle_group ); anglebutton[2]->setText( "&Gra" ); accel->connectItem( accel->insertItem(Key_G + ALT), this , - SLOT(Gra_Selected()) ); + TQT_SLOT(Gra_Selected()) ); - connect( angle_group, SIGNAL(clicked(int)), SLOT(angle_selected(int)) ); + connect( angle_group, TQT_SIGNAL(clicked(int)), TQT_SLOT(angle_selected(int)) ); ////////////////////////////////////////////////////////////////////// @@ -135,31 +135,31 @@ QtCalculator :: QtCalculator( Calculator *_corba, QWidget *parent, const char *n - QButtonGroup *base_group = new QButtonGroup( 4, Horizontal,this, "BaseButtons" ); + TQButtonGroup *base_group = new TQButtonGroup( 4,Qt::Horizontal,this, "BaseButtons" ); base_group->setTitle( i18n("Base") ); - basebutton[0] = new QRadioButton( base_group ); + basebutton[0] = new TQRadioButton( base_group ); basebutton[0]->setText( "&Hex" ); accel->connectItem( accel->insertItem(Key_H + ALT), this , - SLOT(Hex_Selected()) ); + TQT_SLOT(Hex_Selected()) ); - basebutton[1] = new QRadioButton( base_group ); + basebutton[1] = new TQRadioButton( base_group ); basebutton[1]->setText( "D&ec" ); basebutton[1]->setChecked(TRUE); accel->connectItem( accel->insertItem(Key_E + ALT), this , - SLOT(Dec_Selected()) ); + TQT_SLOT(Dec_Selected()) ); - basebutton[2] = new QRadioButton( base_group ); + basebutton[2] = new TQRadioButton( base_group ); basebutton[2]->setText( "&Oct" ); accel->connectItem( accel->insertItem(Key_O + ALT), this , - SLOT(Oct_Selected()) ); + TQT_SLOT(Oct_Selected()) ); - basebutton[3] = new QRadioButton( base_group); + basebutton[3] = new TQRadioButton( base_group); basebutton[3]->setText( "&Bin" ); accel->connectItem( accel->insertItem(Key_B + ALT), this , - SLOT(Bin_Selected()) ); + TQT_SLOT(Bin_Selected()) ); - connect( base_group, SIGNAL(clicked(int)), SLOT(base_selected(int)) ); + connect( base_group, TQT_SIGNAL(clicked(int)), TQT_SLOT(base_selected(int)) ); //////////////////////////////////////////////////////////////////////// // @@ -167,222 +167,222 @@ QtCalculator :: QtCalculator( Calculator *_corba, QWidget *parent, const char *n // - // First the widgets that are the parents of the buttons - mSmallPage = new QWidget(this); - mLargePage = new QWidget(this); + // First the widgets that are the tqparents of the buttons + mSmallPage = new TQWidget(this); + mLargePage = new TQWidget(this); - pbhyp = new QPushButton("Hyp", mSmallPage, "hypbutton" ); - connect( pbhyp, SIGNAL(toggled(bool)), SLOT(pbhyptoggled(bool))); + pbhyp = new TQPushButton("Hyp", mSmallPage, "hypbutton" ); + connect( pbhyp, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbhyptoggled(bool))); pbhyp->setToggleButton(TRUE); - pbinv = new QPushButton( "Inv", mSmallPage, "InverseButton" ); - connect( pbinv, SIGNAL(toggled(bool)), SLOT(pbinvtoggled(bool))); + pbinv = new TQPushButton( "Inv", mSmallPage, "InverseButton" ); + connect( pbinv, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbinvtoggled(bool))); pbinv->setToggleButton(TRUE); - pbA = new QPushButton("A",mSmallPage, "Abutton" ); - connect( pbA, SIGNAL(toggled(bool)), SLOT(pbAtoggled(bool))); + pbA = new TQPushButton("A",mSmallPage, "Abutton" ); + connect( pbA, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbAtoggled(bool))); pbA->setToggleButton(TRUE); - pbSin = new QPushButton("Sin",mSmallPage, "Sinbutton" ); - connect( pbSin, SIGNAL(toggled(bool)), SLOT(pbSintoggled(bool))); + pbSin = new TQPushButton("Sin",mSmallPage, "Sinbutton" ); + connect( pbSin, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbSintoggled(bool))); pbSin->setToggleButton(TRUE); - pbplusminus = new QPushButton( "+/-", mSmallPage, "plusminusbutton" ); - connect( pbplusminus, SIGNAL(toggled(bool)), SLOT(pbplusminustoggled(bool))); + pbplusminus = new TQPushButton( "+/-", mSmallPage, "plusminusbutton" ); + connect( pbplusminus, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbplusminustoggled(bool))); pbplusminus->setToggleButton(TRUE); pbplusminus->setFont(buttonfont); - pbB = new QPushButton("B", mSmallPage, "Bbutton" ); - connect( pbB, SIGNAL(toggled(bool)), SLOT(pbBtoggled(bool))); + pbB = new TQPushButton("B", mSmallPage, "Bbutton" ); + connect( pbB, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbBtoggled(bool))); pbB->setToggleButton(TRUE); - pbCos = new QPushButton("Cos",mSmallPage, "Cosbutton" ); + pbCos = new TQPushButton("Cos",mSmallPage, "Cosbutton" ); pbCos->setText( "Cos" ); - connect( pbCos, SIGNAL(toggled(bool)), SLOT(pbCostoggled(bool))); + connect( pbCos, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbCostoggled(bool))); pbCos->setToggleButton(TRUE); - pbreci = new QPushButton("1/x",mSmallPage, "recibutton" ); - connect( pbreci, SIGNAL(toggled(bool)), SLOT(pbrecitoggled(bool))); + pbreci = new TQPushButton("1/x",mSmallPage, "recibutton" ); + connect( pbreci, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbrecitoggled(bool))); pbreci->setToggleButton(TRUE); - pbC = new QPushButton( "C", mSmallPage, "Cbutton" ); - connect( pbC, SIGNAL(toggled(bool)), SLOT(pbCtoggled(bool))); + pbC = new TQPushButton( "C", mSmallPage, "Cbutton" ); + connect( pbC, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbCtoggled(bool))); pbC->setToggleButton(TRUE); - pbTan = new QPushButton("Tan" ,mSmallPage, "Tanbutton" ); - connect( pbTan, SIGNAL(toggled(bool)), SLOT(pbTantoggled(bool))); + pbTan = new TQPushButton("Tan" ,mSmallPage, "Tanbutton" ); + connect( pbTan, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbTantoggled(bool))); pbTan->setToggleButton(TRUE); - pbfactorial = new QPushButton("x!",mSmallPage, "factorialbutton" ); - connect( pbfactorial, SIGNAL(toggled(bool)), SLOT(pbfactorialtoggled(bool))); + pbfactorial = new TQPushButton("x!",mSmallPage, "factorialbutton" ); + connect( pbfactorial, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbfactorialtoggled(bool))); pbfactorial->setToggleButton(TRUE); - pbD = new QPushButton("D",mSmallPage, "Dbutton" ); - connect( pbD, SIGNAL(toggled(bool)), SLOT(pbDtoggled(bool))); + pbD = new TQPushButton("D",mSmallPage, "Dbutton" ); + connect( pbD, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbDtoggled(bool))); pbD->setToggleButton(TRUE); - pblog = new QPushButton("Log",mSmallPage, "logbutton" ); - connect( pblog, SIGNAL(toggled(bool)), SLOT(pblogtoggled(bool))); + pblog = new TQPushButton("Log",mSmallPage, "logbutton" ); + connect( pblog, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pblogtoggled(bool))); pblog->setToggleButton(TRUE); - pbsquare = new QPushButton( "x^2", mSmallPage, "squarebutton" ); - connect( pbsquare, SIGNAL(toggled(bool)), SLOT(pbsquaretoggled(bool))); + pbsquare = new TQPushButton( "x^2", mSmallPage, "squarebutton" ); + connect( pbsquare, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbsquaretoggled(bool))); pbsquare->setToggleButton(TRUE); - pbE = new QPushButton("E",mSmallPage, "Ebutton" ); - connect( pbE, SIGNAL(toggled(bool)), SLOT(pbEtoggled(bool))); + pbE = new TQPushButton("E",mSmallPage, "Ebutton" ); + connect( pbE, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbEtoggled(bool))); pbE->setToggleButton(TRUE); - pbln = new QPushButton( "Ln", mSmallPage, "lnbutton" ); - connect( pbln, SIGNAL(toggled(bool)), SLOT(pblntoggled(bool))); + pbln = new TQPushButton( "Ln", mSmallPage, "lnbutton" ); + connect( pbln, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pblntoggled(bool))); pbln->setToggleButton(TRUE); - pbpower = new QPushButton("x^y",mSmallPage, "powerbutton" ); - connect( pbpower, SIGNAL(toggled(bool)), SLOT(pbpowertoggled(bool))); + pbpower = new TQPushButton("x^y",mSmallPage, "powerbutton" ); + connect( pbpower, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbpowertoggled(bool))); pbpower->setToggleButton(TRUE); - pbF = new QPushButton("F",mSmallPage, "Fbutton" ); - connect( pbF, SIGNAL(toggled(bool)), SLOT(pbFtoggled(bool))); + pbF = new TQPushButton("F",mSmallPage, "Fbutton" ); + connect( pbF, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbFtoggled(bool))); pbF->setToggleButton(TRUE); - pbEE = new QPushButton("EE",mLargePage, "EEbutton" ); + pbEE = new TQPushButton("EE",mLargePage, "EEbutton" ); pbEE->setToggleButton(TRUE); - connect( pbEE, SIGNAL(toggled(bool)), SLOT(EEtoggled(bool))); + connect( pbEE, TQT_SIGNAL(toggled(bool)), TQT_SLOT(EEtoggled(bool))); - pbMR = new QPushButton("MR",mLargePage, "MRbutton" ); - connect( pbMR, SIGNAL(toggled(bool)), SLOT(pbMRtoggled(bool))); + pbMR = new TQPushButton("MR",mLargePage, "MRbutton" ); + connect( pbMR, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbMRtoggled(bool))); pbMR->setToggleButton(TRUE); pbMR->setFont(buttonfont); - pbMplusminus = new QPushButton("M+-",mLargePage, "Mplusminusbutton" ); - connect( pbMplusminus, SIGNAL(toggled(bool)), SLOT(pbMplusminustoggled(bool))); + pbMplusminus = new TQPushButton("M+-",mLargePage, "Mplusminusbutton" ); + connect( pbMplusminus, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbMplusminustoggled(bool))); pbMplusminus->setToggleButton(TRUE); - pbMC = new QPushButton("MC",mLargePage, "MCbutton" ); - connect( pbMC, SIGNAL(toggled(bool)), SLOT(pbMCtoggled(bool))); + pbMC = new TQPushButton("MC",mLargePage, "MCbutton" ); + connect( pbMC, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbMCtoggled(bool))); pbMC->setToggleButton(TRUE); - pbClear = new QPushButton("C",mLargePage, "Clearbutton" ); - connect( pbClear, SIGNAL(toggled(bool)), SLOT(pbCleartoggled(bool))); + pbClear = new TQPushButton("C",mLargePage, "Clearbutton" ); + connect( pbClear, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbCleartoggled(bool))); pbClear->setToggleButton(TRUE); - pbAC = new QPushButton("AC", mLargePage, "ACbutton" ); - connect( pbAC, SIGNAL(toggled(bool)), SLOT(pbACtoggled(bool))); + pbAC = new TQPushButton("AC", mLargePage, "ACbutton" ); + connect( pbAC, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbACtoggled(bool))); pbAC->setToggleButton(TRUE); - pb7 = new QPushButton("7",mLargePage, "7button" ); - connect( pb7, SIGNAL(toggled(bool)), SLOT(pb7toggled(bool))); + pb7 = new TQPushButton("7",mLargePage, "7button" ); + connect( pb7, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pb7toggled(bool))); pb7->setToggleButton(TRUE); - pb8 = new QPushButton("8",mLargePage, "8button" ); - connect( pb8, SIGNAL(toggled(bool)), SLOT(pb8toggled(bool))); + pb8 = new TQPushButton("8",mLargePage, "8button" ); + connect( pb8, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pb8toggled(bool))); pb8->setToggleButton(TRUE); - pb9 = new QPushButton("9",mLargePage,"9button" ); - connect( pb9, SIGNAL(toggled(bool)), SLOT(pb9toggled(bool))); + pb9 = new TQPushButton("9",mLargePage,"9button" ); + connect( pb9, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pb9toggled(bool))); pb9->setToggleButton(TRUE); - pbparenopen = new QPushButton("(",mLargePage, "parenopenbutton" ); - connect( pbparenopen, SIGNAL(toggled(bool)), SLOT(pbparenopentoggled(bool))); + pbparenopen = new TQPushButton("(",mLargePage, "parenopenbutton" ); + connect( pbparenopen, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbparenopentoggled(bool))); pbparenopen->setToggleButton(TRUE); - pbparenclose = new QPushButton(")",mLargePage, "parenclosebutton" ); - connect( pbparenclose, SIGNAL(toggled(bool)), SLOT(pbparenclosetoggled(bool))); + pbparenclose = new TQPushButton(")",mLargePage, "parenclosebutton" ); + connect( pbparenclose, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbparenclosetoggled(bool))); pbparenclose->setToggleButton(TRUE); - pband = new QPushButton("And",mLargePage, "andbutton" ); - connect( pband, SIGNAL(toggled(bool)), SLOT(pbandtoggled(bool))); + pband = new TQPushButton("And",mLargePage, "andbutton" ); + connect( pband, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbandtoggled(bool))); pband->setToggleButton(TRUE); pband->setFont(buttonfont); - pb4 = new QPushButton("4",mLargePage, "4button" ); - connect( pb4, SIGNAL(toggled(bool)), SLOT(pb4toggled(bool))); + pb4 = new TQPushButton("4",mLargePage, "4button" ); + connect( pb4, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pb4toggled(bool))); pb4->setToggleButton(TRUE); - pb5 = new QPushButton("5",mLargePage, "5button" ); - connect( pb5, SIGNAL(toggled(bool)), SLOT(pb5toggled(bool))); + pb5 = new TQPushButton("5",mLargePage, "5button" ); + connect( pb5, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pb5toggled(bool))); pb5->setToggleButton(TRUE); - pb6 = new QPushButton("6",mLargePage, "6button" ); - connect( pb6, SIGNAL(toggled(bool)), SLOT(pb6toggled(bool))); + pb6 = new TQPushButton("6",mLargePage, "6button" ); + connect( pb6, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pb6toggled(bool))); pb6->setToggleButton(TRUE); - pbX = new QPushButton("X",mLargePage, "Multiplybutton" ); - connect( pbX, SIGNAL(toggled(bool)), SLOT(pbXtoggled(bool))); + pbX = new TQPushButton("X",mLargePage, "Multiplybutton" ); + connect( pbX, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbXtoggled(bool))); pbX->setToggleButton(TRUE); - pbdivision = new QPushButton("/",mLargePage, "divisionbutton" ); - connect( pbdivision, SIGNAL(toggled(bool)), SLOT(pbdivisiontoggled(bool))); + pbdivision = new TQPushButton("/",mLargePage, "divisionbutton" ); + connect( pbdivision, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbdivisiontoggled(bool))); pbdivision->setToggleButton(TRUE); - pbor = new QPushButton("Or",mLargePage, "orbutton" ); - connect( pbor, SIGNAL(toggled(bool)), SLOT(pbortoggled(bool))); + pbor = new TQPushButton("Or",mLargePage, "orbutton" ); + connect( pbor, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbortoggled(bool))); pbor->setToggleButton(TRUE); - pb1 = new QPushButton("1",mLargePage, "1button" ); - connect( pb1, SIGNAL(toggled(bool)), SLOT(pb1toggled(bool))); + pb1 = new TQPushButton("1",mLargePage, "1button" ); + connect( pb1, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pb1toggled(bool))); pb1->setToggleButton(TRUE); - pb2 = new QPushButton("2",mLargePage, "2button" ); + pb2 = new TQPushButton("2",mLargePage, "2button" ); - connect( pb2, SIGNAL(toggled(bool)), SLOT(pb2toggled(bool))); + connect( pb2, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pb2toggled(bool))); pb2->setToggleButton(TRUE); - pb3 = new QPushButton("3",mLargePage, "3button" ); - connect( pb3, SIGNAL(toggled(bool)), SLOT(pb3toggled(bool))); + pb3 = new TQPushButton("3",mLargePage, "3button" ); + connect( pb3, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pb3toggled(bool))); pb3->setToggleButton(TRUE); - pbplus = new QPushButton("+",mLargePage, "plusbutton" ); - connect( pbplus, SIGNAL(toggled(bool)), SLOT(pbplustoggled(bool))); + pbplus = new TQPushButton("+",mLargePage, "plusbutton" ); + connect( pbplus, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbplustoggled(bool))); pbplus->setToggleButton(TRUE); - pbminus = new QPushButton("-",mLargePage, "minusbutton" ); - connect( pbminus, SIGNAL(toggled(bool)), SLOT(pbminustoggled(bool))); + pbminus = new TQPushButton("-",mLargePage, "minusbutton" ); + connect( pbminus, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbminustoggled(bool))); pbminus->setToggleButton(TRUE); - pbshift = new QPushButton("Lsh",mLargePage, "shiftbutton" ); - connect( pbshift, SIGNAL(toggled(bool)), SLOT(pbshifttoggled(bool))); + pbshift = new TQPushButton("Lsh",mLargePage, "shiftbutton" ); + connect( pbshift, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbshifttoggled(bool))); pbshift->setToggleButton(TRUE); - pbperiod = new QPushButton(".",mLargePage, "periodbutton" ); - connect( pbperiod, SIGNAL(toggled(bool)), SLOT(pbperiodtoggled(bool))); + pbperiod = new TQPushButton(".",mLargePage, "periodbutton" ); + connect( pbperiod, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbperiodtoggled(bool))); pbperiod->setToggleButton(TRUE); - pb0 = new QPushButton("0",mLargePage, "0button" ); - connect( pb0, SIGNAL(toggled(bool)), SLOT(pb0toggled(bool))); + pb0 = new TQPushButton("0",mLargePage, "0button" ); + connect( pb0, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pb0toggled(bool))); pb0->setToggleButton(TRUE); - pbequal = new QPushButton("=",mLargePage, "equalbutton" ); - connect( pbequal, SIGNAL(toggled(bool)), SLOT(pbequaltoggled(bool))); + pbequal = new TQPushButton("=",mLargePage, "equalbutton" ); + connect( pbequal, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbequaltoggled(bool))); pbequal->setToggleButton(TRUE); - pbpercent = new QPushButton("%",mLargePage, "percentbutton" ); - connect( pbpercent, SIGNAL(toggled(bool)), SLOT(pbpercenttoggled(bool))); + pbpercent = new TQPushButton("%",mLargePage, "percentbutton" ); + connect( pbpercent, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbpercenttoggled(bool))); pbpercent->setToggleButton(TRUE); - pbnegate = new QPushButton("Cmp",mLargePage, "OneComplementbutton" ); - connect( pbnegate, SIGNAL(toggled(bool)), SLOT(pbnegatetoggled(bool))); + pbnegate = new TQPushButton("Cmp",mLargePage, "OneComplementbutton" ); + connect( pbnegate, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbnegatetoggled(bool))); pbnegate->setToggleButton(TRUE); - pbmod = new QPushButton("Mod",mLargePage, "modbutton" ); - connect( pbmod, SIGNAL(toggled(bool)), SLOT(pbmodtoggled(bool))); + pbmod = new TQPushButton("Mod",mLargePage, "modbutton" ); + connect( pbmod, TQT_SIGNAL(toggled(bool)), TQT_SLOT(pbmodtoggled(bool))); pbmod->setToggleButton(TRUE); - QGridLayout *smallBtnLayout = new QGridLayout(mSmallPage, 6, 3, 0, + TQGridLayout *smallBtnLayout = new TQGridLayout(mSmallPage, 6, 3, 0, mInternalSpacing); - QGridLayout *largeBtnLayout = new QGridLayout(mLargePage, 5, 6, 0, + TQGridLayout *largeBtnLayout = new TQGridLayout(mLargePage, 5, 6, 0, mInternalSpacing); - QHBoxLayout *topLayout = new QHBoxLayout(); - QHBoxLayout *radioLayout = new QHBoxLayout(); - QHBoxLayout *btnLayout = new QHBoxLayout(); - QHBoxLayout *statusLayout = new QHBoxLayout(); + TQHBoxLayout *topLayout = new TQHBoxLayout(); + TQHBoxLayout *radioLayout = new TQHBoxLayout(); + TQHBoxLayout *btnLayout = new TQHBoxLayout(); + TQHBoxLayout *statusLayout = new TQHBoxLayout(); // bring them all together - QVBoxLayout *mainLayout = new QVBoxLayout(this, mInternalSpacing, + TQVBoxLayout *mainLayout = new TQVBoxLayout(this, mInternalSpacing, mInternalSpacing ); mainLayout->addLayout(topLayout ); @@ -390,12 +390,12 @@ QtCalculator :: QtCalculator( Calculator *_corba, QWidget *parent, const char *n mainLayout->addLayout(btnLayout); mainLayout->addLayout(statusLayout); - // button layout + // button tqlayout btnLayout->addWidget(mSmallPage,0,AlignTop); btnLayout->addSpacing(mInternalSpacing); btnLayout->addWidget(mLargePage,0,AlignTop); - // small button layout + // small button tqlayout smallBtnLayout->addWidget(pbhyp, 0, 0); smallBtnLayout->addWidget(pbinv, 0, 1); smallBtnLayout->addWidget(pbA, 0, 2); @@ -427,7 +427,7 @@ QtCalculator :: QtCalculator( Calculator *_corba, QWidget *parent, const char *n smallBtnLayout->setRowStretch(4, 0); smallBtnLayout->setRowStretch(5, 0); - // large button layout + // large button tqlayout largeBtnLayout->addWidget(pbEE, 0, 0); largeBtnLayout->addWidget(pbMR, 0, 1); largeBtnLayout->addWidget(pbMplusminus, 0, 2); @@ -472,11 +472,11 @@ QtCalculator :: QtCalculator( Calculator *_corba, QWidget *parent, const char *n topLayout->addWidget(calc_display, 10); - // radiobutton layout + // radiobutton tqlayout radioLayout->addWidget(base_group); radioLayout->addWidget(angle_group); - // status layout + // status tqlayout statusLayout->addWidget(statusINVLabel); statusLayout->addWidget(statusHYPLabel); statusLayout->addWidget(statusERRORLabel, 10); @@ -542,22 +542,22 @@ QtCalculator :: QtCalculator( Calculator *_corba, QWidget *parent, const char *n InitializeCalculator(); } -QtCalculator::~QtCalculator() +TQtCalculator::~TQtCalculator() { delete selection_timer; delete status_timer; } -void QtCalculator::set_display_font() +void TQtCalculator::set_display_font() { calc_display->setFont(kcalcdefaults.font); } -void QtCalculator::updateGeometry() +void TQtCalculator::updateGeometry() { - QObjectList *l; - QSize s; + TQObjectList *l; + TQSize s; int margin; // @@ -568,9 +568,9 @@ void QtCalculator::updateGeometry() // // Button groups (base and angle) // - //QButtonGroup *g; - //g = (QButtonGroup*)(anglebutton[0]->parentWidget()); - //g = (QButtonGroup*)(basebutton[0]->parentWidget()); + //TQButtonGroup *g; + //g = (TQButtonGroup*)(anglebutton[0]->tqparentWidget()); + //g = (TQButtonGroup*)(basebutton[0]->tqparentWidget()); // // Calculator buttons @@ -578,38 +578,38 @@ void QtCalculator::updateGeometry() s.setWidth(mSmallPage->fontMetrics().width("MMM")); s.setHeight(mSmallPage->fontMetrics().lineSpacing()); - l = (QObjectList*)mSmallPage->children(); // silence please + l = (TQObjectList*)mSmallPage->tqchildren(); // silence please for(uint i=0; i < l->count(); i++) { - QObject *o = l->at(i); + TQObject *o = l->at(i); if( o->isWidgetType() ) { - margin = QApplication::style(). - pixelMetric(QStyle::PM_ButtonMargin, ((QWidget *)o))*2; - ((QWidget*)o)->setMinimumSize(s.width()+margin, s.height()+margin); - ((QWidget*)o)->installEventFilter( this ); - ((QWidget*)o)->setAcceptDrops(true); + margin = TQApplication::style(). + tqpixelMetric(TQStyle::PM_ButtonMargin, ((TQWidget *)o))*2; + ((TQWidget*)o)->setMinimumSize(s.width()+margin, s.height()+margin); + ((TQWidget*)o)->installEventFilter( this ); + ((TQWidget*)o)->setAcceptDrops(true); } } - l = (QObjectList*)mLargePage->children(); // silence please + l = (TQObjectList*)mLargePage->tqchildren(); // silence please - int h1 = pbF->minimumSize().height(); + int h1 = pbF->tqminimumSize().height(); int h2 = (int)((((float)h1 + 4.0) / 5.0)); s.setWidth(mLargePage->fontMetrics().width("MMM") + - QApplication::style(). - pixelMetric(QStyle::PM_ButtonMargin, pbF)*2); + TQApplication::style(). + tqpixelMetric(TQStyle::PM_ButtonMargin, pbF)*2); s.setHeight(h1 + h2); for(uint i = 0; i < l->count(); i++) { - QObject *o = l->at(i); + TQObject *o = l->at(i); if(o->isWidgetType()) { - ((QWidget*)o)->setFixedSize(s); - ((QWidget*)o)->installEventFilter(this); - ((QWidget*)o)->setAcceptDrops(true); + ((TQWidget*)o)->setFixedSize(s); + ((TQWidget*)o)->installEventFilter(this); + ((TQWidget*)o)->setAcceptDrops(true); } } @@ -621,15 +621,15 @@ void QtCalculator::updateGeometry() statusINVLabel->setMinimumWidth(s.width()); statusHYPLabel->setMinimumWidth(s.width()); - //setFixedSize(minimumSize()); + //setFixedSize(tqminimumSize()); } -void QtCalculator::exit() +void TQtCalculator::exit() { - // QApplication::exit(); + // TQApplication::exit(); } -void QtCalculator::Hex_Selected() +void TQtCalculator::Hex_Selected() { basebutton[0]->setChecked(TRUE); basebutton[1]->setChecked(FALSE); @@ -639,7 +639,7 @@ void QtCalculator::Hex_Selected() } -void QtCalculator::Dec_Selected() +void TQtCalculator::Dec_Selected() { basebutton[0]->setChecked(FALSE); basebutton[1]->setChecked(TRUE); @@ -649,7 +649,7 @@ void QtCalculator::Dec_Selected() } -void QtCalculator::Oct_Selected() +void TQtCalculator::Oct_Selected() { basebutton[0]->setChecked(FALSE); basebutton[1]->setChecked(FALSE); @@ -660,7 +660,7 @@ void QtCalculator::Oct_Selected() -void QtCalculator::Bin_Selected() +void TQtCalculator::Bin_Selected() { basebutton[0]->setChecked(FALSE); basebutton[1]->setChecked(FALSE); @@ -669,7 +669,7 @@ void QtCalculator::Bin_Selected() SetBin(); } -void QtCalculator::Deg_Selected() +void TQtCalculator::Deg_Selected() { anglebutton[0]->setChecked(TRUE); anglebutton[1]->setChecked(FALSE); @@ -678,7 +678,7 @@ void QtCalculator::Deg_Selected() } -void QtCalculator::Rad_Selected() +void TQtCalculator::Rad_Selected() { anglebutton[0]->setChecked(FALSE); anglebutton[1]->setChecked(TRUE); @@ -688,7 +688,7 @@ void QtCalculator::Rad_Selected() } -void QtCalculator::Gra_Selected() +void TQtCalculator::Gra_Selected() { anglebutton[0]->setChecked(FALSE); anglebutton[1]->setChecked(FALSE); @@ -697,10 +697,10 @@ void QtCalculator::Gra_Selected() } -void QtCalculator::helpclicked(){ +void TQtCalculator::helpclicked(){ } -void QtCalculator::keyPressEvent( QKeyEvent *e ){ +void TQtCalculator::keyPressEvent( TQKeyEvent *e ){ switch (e->key() ){ @@ -936,7 +936,7 @@ void QtCalculator::keyPressEvent( QKeyEvent *e ){ } } -void QtCalculator::keyReleaseEvent( QKeyEvent *e ){ +void TQtCalculator::keyReleaseEvent( TQKeyEvent *e ){ switch (e->key() ){ case Key_Next: @@ -1150,11 +1150,11 @@ void QtCalculator::keyReleaseEvent( QKeyEvent *e ){ clear_buttons(); } -void QtCalculator::clear_buttons(){ +void TQtCalculator::clear_buttons(){ } -void QtCalculator::EEtoggled(bool myboolean){ +void TQtCalculator::EEtoggled(bool myboolean){ if(myboolean) EE(); @@ -1162,327 +1162,327 @@ void QtCalculator::EEtoggled(bool myboolean){ pbEE->setOn(FALSE); } -void QtCalculator::pbinvtoggled(bool myboolean){ +void TQtCalculator::pbinvtoggled(bool myboolean){ if(myboolean) SetInverse(); if(pbinv->isOn() && (!key_pressed)) pbinv->setOn(FALSE); } -void QtCalculator::pbhyptoggled(bool myboolean){ +void TQtCalculator::pbhyptoggled(bool myboolean){ if(myboolean) EnterHyp(); if(pbhyp->isOn() && (!key_pressed)) pbhyp->setOn(FALSE); } -void QtCalculator::pbMRtoggled(bool myboolean){ +void TQtCalculator::pbMRtoggled(bool myboolean){ if(myboolean) MR(); if(pbMR->isOn() && (!key_pressed)) pbMR->setOn(FALSE); } -void QtCalculator::pbAtoggled(bool myboolean){ +void TQtCalculator::pbAtoggled(bool myboolean){ if(myboolean) buttonA(); if(pbA->isOn() && (!key_pressed)) pbA->setOn(FALSE); } -void QtCalculator::pbSintoggled(bool myboolean){ +void TQtCalculator::pbSintoggled(bool myboolean){ if(myboolean) ExecSin(); if(pbSin->isOn() && (!key_pressed)) pbSin->setOn(FALSE); } -void QtCalculator::pbplusminustoggled(bool myboolean){ +void TQtCalculator::pbplusminustoggled(bool myboolean){ if(myboolean) EnterNegate(); if(pbplusminus->isOn() && (!key_pressed)) pbplusminus->setOn(FALSE); } -void QtCalculator::pbMplusminustoggled(bool myboolean){ +void TQtCalculator::pbMplusminustoggled(bool myboolean){ if(myboolean) Mplusminus(); if(pbMplusminus->isOn() && (!key_pressed)) pbMplusminus->setOn(FALSE); } -void QtCalculator::pbBtoggled(bool myboolean){ +void TQtCalculator::pbBtoggled(bool myboolean){ if(myboolean) buttonB(); if(pbB->isOn() && (!key_pressed)) pbB->setOn(FALSE); } -void QtCalculator::pbCostoggled(bool myboolean){ +void TQtCalculator::pbCostoggled(bool myboolean){ if(myboolean) ExecCos(); if(pbCos->isOn() && (!key_pressed)) pbCos->setOn(FALSE); } -void QtCalculator::pbrecitoggled(bool myboolean){ +void TQtCalculator::pbrecitoggled(bool myboolean){ if(myboolean) EnterRecip(); if(pbreci->isOn() && (!key_pressed)) pbreci->setOn(FALSE); } -void QtCalculator::pbCtoggled(bool myboolean){ +void TQtCalculator::pbCtoggled(bool myboolean){ if(myboolean) buttonC(); if(pbC->isOn() && (!key_pressed)) pbC->setOn(FALSE); } -void QtCalculator::pbTantoggled(bool myboolean){ +void TQtCalculator::pbTantoggled(bool myboolean){ if(myboolean) ExecTan(); if(pbTan->isOn() && (!key_pressed)) pbTan->setOn(FALSE); } -void QtCalculator::pbfactorialtoggled(bool myboolean){ +void TQtCalculator::pbfactorialtoggled(bool myboolean){ if(myboolean) EnterFactorial(); if(pbfactorial->isOn() && (!key_pressed)) pbfactorial->setOn(FALSE); } -void QtCalculator::pbDtoggled(bool myboolean){ +void TQtCalculator::pbDtoggled(bool myboolean){ if(myboolean) buttonD(); if(pbD->isOn() && (!key_pressed)) pbD->setOn(FALSE); } -void QtCalculator::pblogtoggled(bool myboolean){ +void TQtCalculator::pblogtoggled(bool myboolean){ if(myboolean) EnterLogr(); if(pblog->isOn() && (!key_pressed)) pblog->setOn(FALSE); } -void QtCalculator::pbsquaretoggled(bool myboolean){ +void TQtCalculator::pbsquaretoggled(bool myboolean){ if(myboolean) EnterSquare(); if(pbsquare->isOn() && (!key_pressed)) pbsquare->setOn(FALSE); } -void QtCalculator::pbEtoggled(bool myboolean){ +void TQtCalculator::pbEtoggled(bool myboolean){ if(myboolean) buttonE(); if(pbE->isOn() && (!key_pressed)) pbE->setOn(FALSE); } -void QtCalculator::pblntoggled(bool myboolean){ +void TQtCalculator::pblntoggled(bool myboolean){ if(myboolean) EnterLogn(); if(pbln->isOn() && (!key_pressed)) pbln->setOn(FALSE); } -void QtCalculator::pbpowertoggled(bool myboolean){ +void TQtCalculator::pbpowertoggled(bool myboolean){ if(myboolean) Power(); if(pbpower->isOn() && (!key_pressed)) pbpower->setOn(FALSE); } -void QtCalculator::pbFtoggled(bool myboolean){ +void TQtCalculator::pbFtoggled(bool myboolean){ if(myboolean) buttonF(); if(pbF->isOn() && (!key_pressed)) pbF->setOn(FALSE); } -void QtCalculator::pbMCtoggled(bool myboolean){ +void TQtCalculator::pbMCtoggled(bool myboolean){ if(myboolean) MC(); if(pbMC->isOn() && (!key_pressed)) pbMC->setOn(FALSE); } -void QtCalculator::pbCleartoggled(bool myboolean){ +void TQtCalculator::pbCleartoggled(bool myboolean){ if(myboolean) Clear(); if(pbClear->isOn() && (!key_pressed)) pbClear->setOn(FALSE); } -void QtCalculator::pbACtoggled(bool myboolean){ +void TQtCalculator::pbACtoggled(bool myboolean){ if(myboolean) ClearAll(); if(pbAC->isOn() && (!key_pressed)) pbAC->setOn(FALSE); } -void QtCalculator::pb7toggled(bool myboolean){ +void TQtCalculator::pb7toggled(bool myboolean){ if(myboolean) button7(); if(pb7->isOn() && (!key_pressed)) pb7->setOn(FALSE); } -void QtCalculator::pb8toggled(bool myboolean){ +void TQtCalculator::pb8toggled(bool myboolean){ if(myboolean) button8(); if(pb8->isOn() && (!key_pressed)) pb8->setOn(FALSE); } -void QtCalculator::pb9toggled(bool myboolean){ +void TQtCalculator::pb9toggled(bool myboolean){ if(myboolean) button9(); if(pb9->isOn() && (!key_pressed)) pb9->setOn(FALSE); } -void QtCalculator::pbparenopentoggled(bool myboolean){ +void TQtCalculator::pbparenopentoggled(bool myboolean){ if(myboolean) EnterOpenParen(); if(pbparenopen->isOn() && (!key_pressed)) pbparenopen->setOn(FALSE); } -void QtCalculator::pbparenclosetoggled(bool myboolean){ +void TQtCalculator::pbparenclosetoggled(bool myboolean){ if(myboolean) EnterCloseParen(); if(pbparenclose->isOn() && (!key_pressed)) pbparenclose->setOn(FALSE); } -void QtCalculator::pbandtoggled(bool myboolean){ +void TQtCalculator::pbandtoggled(bool myboolean){ if(myboolean) And(); if(pband->isOn() && (!key_pressed)) pband->setOn(FALSE); } -void QtCalculator::pb4toggled(bool myboolean){ +void TQtCalculator::pb4toggled(bool myboolean){ if(myboolean) button4(); if(pb4->isOn() && (!key_pressed)) pb4->setOn(FALSE); } -void QtCalculator::pb5toggled(bool myboolean){ +void TQtCalculator::pb5toggled(bool myboolean){ if(myboolean) button5(); if(pb5->isOn() && (!key_pressed)) pb5->setOn(FALSE); } -void QtCalculator::pb6toggled(bool myboolean){ +void TQtCalculator::pb6toggled(bool myboolean){ if(myboolean) button6(); if(pb6->isOn() && (!key_pressed)) pb6->setOn(FALSE); } -void QtCalculator::pbXtoggled(bool myboolean){ +void TQtCalculator::pbXtoggled(bool myboolean){ if(myboolean) Multiply(); if(pbX->isOn() && (!key_pressed)) pbX->setOn(FALSE); } -void QtCalculator::pbdivisiontoggled(bool myboolean){ +void TQtCalculator::pbdivisiontoggled(bool myboolean){ if(myboolean) Divide(); if(pbdivision->isOn() && (!key_pressed)) pbdivision->setOn(FALSE); } -void QtCalculator::pbortoggled(bool myboolean){ +void TQtCalculator::pbortoggled(bool myboolean){ if(myboolean) Or(); if(pbor->isOn() && (!key_pressed)) pbor->setOn(FALSE); } -void QtCalculator::pb1toggled(bool myboolean){ +void TQtCalculator::pb1toggled(bool myboolean){ if(myboolean) button1(); if(pb1->isOn() && (!key_pressed)) pb1->setOn(FALSE); } -void QtCalculator::pb2toggled(bool myboolean){ +void TQtCalculator::pb2toggled(bool myboolean){ if(myboolean) button2(); if(pb2->isOn() && (!key_pressed)) pb2->setOn(FALSE); } -void QtCalculator::pb3toggled(bool myboolean){ +void TQtCalculator::pb3toggled(bool myboolean){ if(myboolean) button3(); if(pb3->isOn() && (!key_pressed)) pb3->setOn(FALSE); } -void QtCalculator::pbplustoggled(bool myboolean){ +void TQtCalculator::pbplustoggled(bool myboolean){ if(myboolean) Plus(); if(pbplus->isOn() && (!key_pressed)) pbplus->setOn(FALSE); } -void QtCalculator::pbminustoggled(bool myboolean){ +void TQtCalculator::pbminustoggled(bool myboolean){ if(myboolean) Minus(); if(pbminus->isOn() && (!key_pressed)) pbminus->setOn(FALSE); } -void QtCalculator::pbshifttoggled(bool myboolean){ +void TQtCalculator::pbshifttoggled(bool myboolean){ if(myboolean) Shift(); if(pbshift->isOn() && (!key_pressed)) pbshift->setOn(FALSE); } -void QtCalculator::pbperiodtoggled(bool myboolean){ +void TQtCalculator::pbperiodtoggled(bool myboolean){ if(myboolean) EnterDecimal(); if(pbperiod->isOn() && (!key_pressed)) pbperiod->setOn(FALSE); } -void QtCalculator::pb0toggled(bool myboolean){ +void TQtCalculator::pb0toggled(bool myboolean){ if(myboolean) button0(); if(pb0->isOn() && (!key_pressed)) pb0->setOn(FALSE); } -void QtCalculator::pbequaltoggled(bool myboolean){ +void TQtCalculator::pbequaltoggled(bool myboolean){ if(myboolean) EnterEqual(); if(pbequal->isOn() && (!key_pressed)) pbequal->setOn(FALSE); } -void QtCalculator::pbpercenttoggled(bool myboolean){ +void TQtCalculator::pbpercenttoggled(bool myboolean){ if(myboolean) EnterPercent(); if(pbpercent->isOn() && (!key_pressed)) pbpercent->setOn(FALSE); } -void QtCalculator::pbnegatetoggled(bool myboolean){ +void TQtCalculator::pbnegatetoggled(bool myboolean){ if(myboolean) EnterNotCmp(); if(pbnegate->isOn() && (!key_pressed)) pbnegate->setOn(FALSE); } -void QtCalculator::pbmodtoggled(bool myboolean) { +void TQtCalculator::pbmodtoggled(bool myboolean) { if(myboolean) Mod(); if(pbmod->isOn() && (!key_pressed)) pbmod->setOn(FALSE); } -void QtCalculator::configclicked(){ +void TQtCalculator::configclicked(){ - QTabDialog * tabdialog; - tabdialog = new QTabDialog(0,"tabdialog",TRUE); + TQTabDialog * tabdialog; + tabdialog = new TQTabDialog(0,"tabdialog",TRUE); tabdialog->setCaption( i18n("KCalc Configuration") ); tabdialog->resize( 360, 390 ); tabdialog->setCancelButton( i18n("&Cancel") ); tabdialog->setOKButton(i18n("&OK")); - QWidget *about = new QWidget(tabdialog,"about"); - QVBoxLayout *lay1 = new QVBoxLayout( about ); + TQWidget *about = new TQWidget(tabdialog,"about"); + TQVBoxLayout *lay1 = new TQVBoxLayout( about ); lay1->setMargin( KDialog::marginHint() ); lay1->setSpacing( KDialog::spacingHint() ); - QGroupBox *box = new QGroupBox(0,Qt::Vertical,about,"box"); - box->layout()->setSpacing(KDialog::spacingHint()); - box->layout()->setMargin(KDialog::marginHint()); - QGridLayout *grid1 = new QGridLayout(box->layout(),2,2); - QLabel *label = new QLabel(box,"label"); - QLabel *label2 = new QLabel(box,"label2"); + TQGroupBox *box = new TQGroupBox(0,Qt::Vertical,about,"box"); + box->tqlayout()->setSpacing(KDialog::spacingHint()); + box->tqlayout()->setMargin(KDialog::marginHint()); + TQGridLayout *grid1 = new TQGridLayout(box->tqlayout(),2,2); + TQLabel *label = new TQLabel(box,"label"); + TQLabel *label2 = new TQLabel(box,"label2"); box->setTitle(i18n("About")); grid1->addWidget(label,0,1); grid1->addMultiCellWidget(label2,2,2,0,1); - QString labelstring = "KCalc "KCALCVERSION"\n"\ + TQString labelstring = "KCalc "KCALCVERSION"\n"\ "Bernd Johannes Wuebben\n"\ "wuebben@math.cornell.edu\n"\ "wuebben@kde.org\n"\ "Copyright (C) 1996-98\n"\ "\n\n"; - QString labelstring2 = + TQString labelstring2 = #ifdef HAVE_LONG_DOUBLE i18n( "Base type: long double\n"); #else @@ -1494,16 +1494,16 @@ void QtCalculator::configclicked(){ "enabled. See the README for details."); #endif - label->setAlignment(AlignLeft|WordBreak|ExpandTabs); + label->tqsetAlignment(AlignLeft|WordBreak|ExpandTabs); label->setText(labelstring); - label2->setAlignment(AlignLeft|WordBreak|ExpandTabs); + label2->tqsetAlignment(AlignLeft|WordBreak|ExpandTabs); label2->setText(labelstring2); // HACK - // QPixmap pm( BarIcon( "kcalclogo" ) ); - QPixmap pm; - QLabel *logo = new QLabel(box); + // TQPixmap pm( BarIcon( "kcalclogo" ) ); + TQPixmap pm; + TQLabel *logo = new TQLabel(box); logo->setPixmap(pm); grid1->addWidget(logo,0,0); lay1->addWidget(box); @@ -1525,7 +1525,7 @@ void QtCalculator::configclicked(){ tabdialog->addTab(about,i18n("About")); - if(tabdialog->exec() == QDialog::Accepted){ + if(tabdialog->exec() == TQDialog::Accepted){ kcalcdefaults.forecolor = newdefstruct.forecolor; @@ -1540,13 +1540,13 @@ void QtCalculator::configclicked(){ set_precision(); set_style(); updateGeometry(); - resize(minimumSize()); + resize(tqminimumSize()); } delete configdlg; } -void QtCalculator::set_style(){ +void TQtCalculator::set_style(){ switch(kcalcdefaults.style){ case 0:{ @@ -1582,10 +1582,10 @@ void QtCalculator::set_style(){ } } -void QtCalculator::readSettings() +void TQtCalculator::readSettings() { - QColor tmpC(189, 255, 180); - QColor blackC(0,0,0); + TQColor tmpC(189, 255, 180); + TQColor blackC(0,0,0); KConfig *config = KGlobal::config(); config->setGroup("CalcPlugin"); @@ -1604,7 +1604,7 @@ void QtCalculator::readSettings() kcalcdefaults.beep = config->readBoolEntry("beep", true); } -void QtCalculator::writeSettings() +void TQtCalculator::writeSettings() { KConfig *config = KGlobal::config(); @@ -1622,13 +1622,13 @@ void QtCalculator::writeSettings() config->sync(); } -void QtCalculator::display_selected(){ +void TQtCalculator::display_selected(){ if(calc_display->Button() == LeftButton){ if(calc_display->isLit()){ - QClipboard *cb = QApplication::clipboard(); + TQClipboard *cb = TQApplication::tqclipboard(); cb->setText(calc_display->text()); selection_timer->start(100); @@ -1643,7 +1643,7 @@ void QtCalculator::display_selected(){ } else{ - QClipboard *cb = QApplication::clipboard(); + TQClipboard *cb = TQApplication::tqclipboard(); CALCAMNT result; result = (CALCAMNT) cb->text().toDouble(); @@ -1655,7 +1655,7 @@ void QtCalculator::display_selected(){ } -void QtCalculator::selection_timed_out(){ +void TQtCalculator::selection_timed_out(){ // printf("selection timed out\n"); selection_timer->stop(); @@ -1666,13 +1666,13 @@ void QtCalculator::selection_timed_out(){ } -void QtCalculator::clear_status_label(){ +void TQtCalculator::clear_status_label(){ statusERRORLabel->setText(""); status_timer->stop(); } -void QtCalculator::setStatusLabel(const QString& string){ +void TQtCalculator::setStatusLabel(const TQString& string){ statusERRORLabel->setText(string); status_timer->start(3000,TRUE); @@ -1680,9 +1680,9 @@ void QtCalculator::setStatusLabel(const QString& string){ } -void QtCalculator::invertColors(){ +void TQtCalculator::invertColors(){ - QColor tmpcolor; + TQColor tmpcolor; if(calc_display->isLit()){ tmpcolor = kcalcdefaults.backcolor; @@ -1699,19 +1699,19 @@ void QtCalculator::invertColors(){ } } -void QtCalculator::closeEvent( QCloseEvent*e ) +void TQtCalculator::closeEvent( TQCloseEvent*e ) { writeSettings(); e->accept(); } -void QtCalculator::set_colors(){ +void TQtCalculator::set_colors(){ - QPalette mypalette = (calc_display->palette()).copy(); + TQPalette mypalette = (calc_display->palette()).copy(); - QColorGroup cgrp = mypalette.active(); - QColorGroup ncgrp(kcalcdefaults.forecolor, + TQColorGroup cgrp = mypalette.active(); + TQColorGroup ncgrp(kcalcdefaults.forecolor, cgrp.background(), cgrp.light(), cgrp.dark(), @@ -1728,12 +1728,12 @@ void QtCalculator::set_colors(){ } -void QtCalculator::set_precision(){ +void TQtCalculator::set_precision(){ UpdateDisplay(); } -void QtCalculator::temp_stack_next(){ +void TQtCalculator::temp_stack_next(){ CALCAMNT *number; @@ -1759,7 +1759,7 @@ void QtCalculator::temp_stack_next(){ } -void QtCalculator::temp_stack_prev(){ +void TQtCalculator::temp_stack_prev(){ CALCAMNT *number; diff --git a/kspread/plugins/calculator/kcalc.h b/kspread/plugins/calculator/kcalc.h index 752ae96e..7e665e6c 100644 --- a/kspread/plugins/calculator/kcalc.h +++ b/kspread/plugins/calculator/kcalc.h @@ -2,7 +2,7 @@ $Id: kcalc.h 466447 2005-10-02 17:54:10Z zander $ KCalc, a scientific calculator for the X window system using the - Qt widget libraries, available at no cost at http://www.troll.no + TQt widget libraries, available at no cost at http://www.troll.no Copyright (C) 1996 Bernd Johannes Wuebben wuebben@math.cornell.edu @@ -24,8 +24,8 @@ */ -#ifndef QTCALC_H -#define QTCALC_H +#ifndef TQTCALC_H +#define TQTCALC_H #include <queue> using std::queue; @@ -34,28 +34,28 @@ using std::queue; #include <stdlib.h> #include <ctype.h> -#include <qlistbox.h> -#include <qclipboard.h> -#include <qptrlist.h> -#include <qaccel.h> -#include <qtabdialog.h> -#include <qwidget.h> -#include <qtimer.h> -#include <qdialog.h> -#include <qpixmap.h> -#include <qapplication.h> -#include <qfont.h> -#include <qlabel.h> -#include <qbuttongroup.h> -#include <qcheckbox.h> -#include <qframe.h> -#include <qgroupbox.h> -#include <qlineedit.h> -#include <qpushbutton.h> -#include <qradiobutton.h> -#include <qtooltip.h> -#include <qstring.h> -#include <qrect.h> +#include <tqlistbox.h> +#include <tqclipboard.h> +#include <tqptrlist.h> +#include <tqaccel.h> +#include <tqtabdialog.h> +#include <tqwidget.h> +#include <tqtimer.h> +#include <tqdialog.h> +#include <tqpixmap.h> +#include <tqapplication.h> +#include <tqfont.h> +#include <tqlabel.h> +#include <tqbuttongroup.h> +#include <tqcheckbox.h> +#include <tqframe.h> +#include <tqgroupbox.h> +#include <tqlineedit.h> +#include <tqpushbutton.h> +#include <tqradiobutton.h> +#include <tqtooltip.h> +#include <tqstring.h> +#include <tqrect.h> #include "dlabel.h" @@ -184,30 +184,31 @@ item_contents *TopTypeStack(item_type rqstd_type); typedef struct _DefStruct{ - QColor forecolor; - QColor backcolor; + TQColor forecolor; + TQColor backcolor; int precision; int fixedprecision; int style; bool fixed; bool beep; - QFont font; + TQFont font; }DefStruct; class Calculator; -class QtCalculator : public QDialog +class TQtCalculator : public TQDialog { Q_OBJECT + TQ_OBJECT public: - QtCalculator( Calculator* _corba, QWidget *parent=0, const char *name=0 ); - ~QtCalculator(); + TQtCalculator( Calculator* _corba, TQWidget *tqparent=0, const char *name=0 ); + ~TQtCalculator(); - void keyPressEvent( QKeyEvent *e ); - void keyReleaseEvent( QKeyEvent *e ); - void closeEvent( QCloseEvent *e ); + void keyPressEvent( TQKeyEvent *e ); + void keyReleaseEvent( TQKeyEvent *e ); + void closeEvent( TQCloseEvent *e ); void readSettings(); void writeSettings(); void set_precision(); @@ -228,7 +229,7 @@ public: void setLabel( const char *_text ); void setValue( double _value ); - void setData( const QRect& _range, const char *_sheet ); + void setData( const TQRect& _range, const char *_sheet ); void useData(); public slots: @@ -240,7 +241,7 @@ public slots: void selection_timed_out(); void clear_buttons(); void clear_status_label(); - void setStatusLabel(const QString&); + void setStatusLabel(const TQString&); void EnterDigit(int data); void EnterDecimal(); void EnterStackFunction(int data); @@ -369,79 +370,79 @@ public: private: void updateGeometry(); - QTimer* selection_timer; - QLabel* statusINVLabel; - QLabel* statusHYPLabel; - QLabel* statusERRORLabel; + TQTimer* selection_timer; + TQLabel* statusINVLabel; + TQLabel* statusHYPLabel; + TQLabel* statusERRORLabel; DLabel* calc_display; - QRadioButton* anglebutton[3]; - QRadioButton* basebutton[4]; - QPushButton* pbhyp; - QPushButton* pbEE; - QPushButton* pbinv; - QPushButton* pbMR; - QPushButton* pbA; - QPushButton* pbSin; - QPushButton* pbplusminus; - QPushButton* pbMplusminus; - QPushButton* pbB; - QPushButton* pbCos; - QPushButton* pbreci; - QPushButton* pbC; - QPushButton* pbTan; - QPushButton* pbfactorial; - QPushButton* pbD; - QPushButton* pblog; - QPushButton* pbsquare; - QPushButton* pbE; - QPushButton* pbln; - QPushButton* pbpower; - QPushButton* pbF; - QPushButton* pbMC; - QPushButton* pbClear; - QPushButton* pbAC; - QPushButton* pb7; - QPushButton* pb8; - QPushButton* pb9; - QPushButton* pbparenopen; - QPushButton* pbparenclose; - QPushButton* pband; - QPushButton* pb4; - QPushButton* pb5; - QPushButton* pb6; - QPushButton* pbX; - QPushButton* pbdivision; - QPushButton* pbor; - QPushButton* pb1; - QPushButton* pb2; - QPushButton* pb3; - QPushButton* pbplus; - QPushButton* pbminus; - QPushButton* pbshift; - QPushButton* pbperiod; - QPushButton* pb0; - QPushButton* pbequal; - QPushButton* pbpercent; - QPushButton* pbnegate; - QPushButton* pbmod; - - QPtrList<QPushButton> mNumButtonList; - QPtrList<QPushButton> mFunctionButtonList; - QPtrList<QPushButton> mHexButtonList; - QPtrList<QPushButton> mMemButtonList; - QPtrList<QPushButton> mOperationButtonList; + TQRadioButton* anglebutton[3]; + TQRadioButton* basebutton[4]; + TQPushButton* pbhyp; + TQPushButton* pbEE; + TQPushButton* pbinv; + TQPushButton* pbMR; + TQPushButton* pbA; + TQPushButton* pbSin; + TQPushButton* pbplusminus; + TQPushButton* pbMplusminus; + TQPushButton* pbB; + TQPushButton* pbCos; + TQPushButton* pbreci; + TQPushButton* pbC; + TQPushButton* pbTan; + TQPushButton* pbfactorial; + TQPushButton* pbD; + TQPushButton* pblog; + TQPushButton* pbsquare; + TQPushButton* pbE; + TQPushButton* pbln; + TQPushButton* pbpower; + TQPushButton* pbF; + TQPushButton* pbMC; + TQPushButton* pbClear; + TQPushButton* pbAC; + TQPushButton* pb7; + TQPushButton* pb8; + TQPushButton* pb9; + TQPushButton* pbparenopen; + TQPushButton* pbparenclose; + TQPushButton* pband; + TQPushButton* pb4; + TQPushButton* pb5; + TQPushButton* pb6; + TQPushButton* pbX; + TQPushButton* pbdivision; + TQPushButton* pbor; + TQPushButton* pb1; + TQPushButton* pb2; + TQPushButton* pb3; + TQPushButton* pbplus; + TQPushButton* pbminus; + TQPushButton* pbshift; + TQPushButton* pbperiod; + TQPushButton* pb0; + TQPushButton* pbequal; + TQPushButton* pbpercent; + TQPushButton* pbnegate; + TQPushButton* pbmod; + + TQPtrList<TQPushButton> mNumButtonList; + TQPtrList<TQPushButton> mFunctionButtonList; + TQPtrList<TQPushButton> mHexButtonList; + TQPtrList<TQPushButton> mMemButtonList; + TQPtrList<TQPushButton> mOperationButtonList; bool key_pressed; KStats stats; - QListBox *paper; - QTimer *status_timer; + TQListBox *paper; + TQTimer *status_timer; - QRect sheet_range; - QString sheet_name; + TQRect sheet_range; + TQString sheet_name; Calculator* corba; - QWidget *mSmallPage; - QWidget *mLargePage; + TQWidget *mSmallPage; + TQWidget *mLargePage; int mInternalSpacing; }; -#endif //QTCLAC_H +#endif //TQTCLAC_H diff --git a/kspread/plugins/calculator/kcalc_core.cpp b/kspread/plugins/calculator/kcalc_core.cpp index 43221b21..e82e56c9 100644 --- a/kspread/plugins/calculator/kcalc_core.cpp +++ b/kspread/plugins/calculator/kcalc_core.cpp @@ -2,7 +2,7 @@ $Id: kcalc_core.cpp 541875 2006-05-17 14:42:51Z zander $ kCalculator, a scientific calculator for the X window system using the - Qt widget libraries, available at no cost at http://www.troll.no + TQt widget libraries, available at no cost at http://www.troll.no The stack engine conatined in this file was take from Martin Bartlett's xfrmcalc @@ -62,7 +62,7 @@ int isinf(double x) { return !finite(x) && x==x; } #endif -extern QPtrList<CALCAMNT> temp_stack; +extern TQPtrList<CALCAMNT> temp_stack; last_input_type last_input; char display_str[DSP_SIZE+1]; @@ -157,7 +157,7 @@ int precedence[14] = { 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 6 }; }; -void QtCalculator::InitializeCalculator(void) { +void TQtCalculator::InitializeCalculator(void) { // // Basic initialization involves initializing the calcultion @@ -196,13 +196,13 @@ void fpe_handler(int fpe_parm) } -void QtCalculator::setData( const QRect& _range, const char *_sheet ) +void TQtCalculator::setData( const TQRect& _range, const char *_sheet ) { sheet_range = _range; sheet_name = _sheet; } -void QtCalculator::setValue( double _value ) +void TQtCalculator::setValue( double _value ) { last_input = DIGIT; DISPLAY_AMOUNT = _value; @@ -213,7 +213,7 @@ void QtCalculator::setValue( double _value ) UpdateDisplay(); } -void QtCalculator::setLabel( const char *_text ) +void TQtCalculator::setLabel( const char *_text ) { last_input = DIGIT; DISPLAY_AMOUNT = 0L; @@ -224,7 +224,7 @@ void QtCalculator::setLabel( const char *_text ) calc_display->setText( _text ); } -void QtCalculator::RefreshCalculator(void) +void TQtCalculator::RefreshCalculator(void) { InitStack(); display_error = 0; @@ -237,12 +237,12 @@ void QtCalculator::RefreshCalculator(void) decimal_point = 0; } -void QtCalculator::EnterDigit(int data) +void TQtCalculator::EnterDigit(int data) { if(eestate){ - QString string; + TQString string; string.setNum(data); strcat(display_str, string.latin1()); DISPLAY_AMOUNT = (CALCAMNT) strtod(display_str,0); @@ -282,66 +282,66 @@ void QtCalculator::EnterDigit(int data) UpdateDisplay(); } -void QtCalculator::button0() +void TQtCalculator::button0() { EnterDigit(0); } -void QtCalculator::button1() +void TQtCalculator::button1() { EnterDigit(1); } -void QtCalculator::button2() +void TQtCalculator::button2() { if (current_base == NB_BINARY) return; EnterDigit(2); } -void QtCalculator::button3() +void TQtCalculator::button3() { if (current_base == NB_BINARY) return; EnterDigit(3); } -void QtCalculator::button4() +void TQtCalculator::button4() { if (current_base == NB_BINARY) return; EnterDigit(4); } -void QtCalculator::button5() +void TQtCalculator::button5() { if (current_base == NB_BINARY) return; EnterDigit(5); } -void QtCalculator::button6() +void TQtCalculator::button6() { if (current_base == NB_BINARY) return; EnterDigit(6); } -void QtCalculator::button7() +void TQtCalculator::button7() { if (current_base == NB_BINARY) return; EnterDigit(7); } -void QtCalculator::button8() +void TQtCalculator::button8() { if ((current_base == NB_BINARY) || (current_base == NB_OCTAL)) return; EnterDigit(8); } -void QtCalculator::button9() +void TQtCalculator::button9() { if ((current_base == NB_BINARY) || (current_base == NB_OCTAL)) return; @@ -349,7 +349,7 @@ void QtCalculator::button9() } -void QtCalculator::buttonA() +void TQtCalculator::buttonA() { if ((current_base == NB_BINARY) || (current_base == NB_OCTAL) || (current_base == NB_DECIMAL)) @@ -358,7 +358,7 @@ void QtCalculator::buttonA() } -void QtCalculator::buttonB() +void TQtCalculator::buttonB() { if ((current_base == NB_BINARY) || (current_base == NB_OCTAL) || (current_base == NB_DECIMAL)) @@ -367,7 +367,7 @@ void QtCalculator::buttonB() } -void QtCalculator::buttonC() +void TQtCalculator::buttonC() { if ((current_base == NB_BINARY) || (current_base == NB_OCTAL) || (current_base == NB_DECIMAL)) @@ -376,7 +376,7 @@ void QtCalculator::buttonC() } -void QtCalculator::buttonD() +void TQtCalculator::buttonD() { if ((current_base == NB_BINARY) || (current_base == NB_OCTAL) || (current_base == NB_DECIMAL)) @@ -385,7 +385,7 @@ void QtCalculator::buttonD() } -void QtCalculator::buttonE() +void TQtCalculator::buttonE() { if ((current_base == NB_BINARY) || (current_base == NB_OCTAL) || (current_base == NB_DECIMAL)) @@ -393,7 +393,7 @@ void QtCalculator::buttonE() EnterDigit(14); } -void QtCalculator::buttonF() +void TQtCalculator::buttonF() { if ((current_base == NB_BINARY) || (current_base == NB_OCTAL) || (current_base == NB_DECIMAL)) @@ -403,7 +403,7 @@ void QtCalculator::buttonF() -void QtCalculator::EnterDecimal() +void TQtCalculator::EnterDecimal() { if(eestate){ @@ -440,7 +440,7 @@ void QtCalculator::EnterDecimal() } -void QtCalculator::Or() +void TQtCalculator::Or() { eestate = false; if (inverse){ @@ -453,7 +453,7 @@ void QtCalculator::Or() last_input = OPERATION; } -void QtCalculator::And() +void TQtCalculator::And() { eestate = false; last_input = OPERATION; @@ -461,7 +461,7 @@ void QtCalculator::And() } -void QtCalculator::Shift() +void TQtCalculator::Shift() { eestate = false; last_input = OPERATION; @@ -475,14 +475,14 @@ void QtCalculator::Shift() } -void QtCalculator::Plus() +void TQtCalculator::Plus() { eestate = false; last_input = OPERATION; EnterStackFunction(6); } -void QtCalculator::Minus() +void TQtCalculator::Minus() { eestate = false; last_input = OPERATION; @@ -490,21 +490,21 @@ void QtCalculator::Minus() } -void QtCalculator::Multiply() +void TQtCalculator::Multiply() { eestate = false; last_input = OPERATION; EnterStackFunction(8); } -void QtCalculator::Divide() +void TQtCalculator::Divide() { eestate = false; last_input = OPERATION; EnterStackFunction(9); } -void QtCalculator::Mod() +void TQtCalculator::Mod() { eestate = false; last_input = OPERATION; @@ -517,7 +517,7 @@ void QtCalculator::Mod() } } -void QtCalculator::Power() +void TQtCalculator::Power() { eestate = false; last_input = OPERATION; @@ -533,7 +533,7 @@ void QtCalculator::Power() -void QtCalculator::EnterStackFunction(int data) +void TQtCalculator::EnterStackFunction(int data) { item_contents new_item; int new_precedence; @@ -568,14 +568,14 @@ void QtCalculator::EnterStackFunction(int data) PushStack(&new_item); } -void QtCalculator::EnterNegate() +void TQtCalculator::EnterNegate() { if(eestate){ - QString string; + TQString string; string = display_str; int pos; - pos = string.findRev('e',-1,false); + pos = string.tqfindRev('e',-1,false); if(pos == -1) return; @@ -602,7 +602,7 @@ void QtCalculator::EnterNegate() last_input = DIGIT; } -void QtCalculator::EnterOpenParen() +void TQtCalculator::EnterOpenParen() { eestate = false; last_input = OPERATION; @@ -611,7 +611,7 @@ void QtCalculator::EnterOpenParen() } -void QtCalculator::EnterCloseParen() +void TQtCalculator::EnterCloseParen() { eestate = false; last_input = OPERATION; @@ -624,7 +624,7 @@ void QtCalculator::EnterCloseParen() } -void QtCalculator::EnterRecip() +void TQtCalculator::EnterRecip() { eestate = false; last_input = OPERATION; @@ -633,7 +633,7 @@ void QtCalculator::EnterRecip() UpdateDisplay(); } -void QtCalculator::EnterInt() +void TQtCalculator::EnterInt() { eestate = false; CALCAMNT work_amount1 = 0.0, work_amount2 = 0.0; @@ -653,7 +653,7 @@ void QtCalculator::EnterInt() } -void QtCalculator::EnterFactorial() +void TQtCalculator::EnterFactorial() { eestate = false; CALCAMNT work_amount1, work_amount2; @@ -682,7 +682,7 @@ void QtCalculator::EnterFactorial() } -void QtCalculator::EnterSquare() +void TQtCalculator::EnterSquare() { eestate = false; if (!inverse){ @@ -699,7 +699,7 @@ void QtCalculator::EnterSquare() } -void QtCalculator::EnterNotCmp() +void TQtCalculator::EnterNotCmp() { eestate = false; CALCAMNT boh_work_d; @@ -718,7 +718,7 @@ void QtCalculator::EnterNotCmp() } -void QtCalculator::EnterHyp() +void TQtCalculator::EnterHyp() { switch(kcalcdefaults.style){ @@ -762,7 +762,7 @@ void QtCalculator::EnterHyp() } -void QtCalculator::ExecSin(){ +void TQtCalculator::ExecSin(){ switch(kcalcdefaults.style){ @@ -792,7 +792,7 @@ void QtCalculator::ExecSin(){ } -void QtCalculator::ComputeSum() +void TQtCalculator::ComputeSum() { inverse = false; eestate = false; @@ -805,7 +805,7 @@ void QtCalculator::ComputeSum() UpdateDisplay(); } -void QtCalculator::ComputeMul() +void TQtCalculator::ComputeMul() { inverse = false; eestate = false; @@ -818,7 +818,7 @@ void QtCalculator::ComputeMul() UpdateDisplay(); } -void QtCalculator::ComputeMin() +void TQtCalculator::ComputeMin() { inverse = false; eestate = false; @@ -831,7 +831,7 @@ void QtCalculator::ComputeMin() UpdateDisplay(); } -void QtCalculator::ComputeMax() +void TQtCalculator::ComputeMax() { inverse = false; eestate = false; @@ -844,7 +844,7 @@ void QtCalculator::ComputeMax() UpdateDisplay(); } -void QtCalculator::ComputeMean(){ +void TQtCalculator::ComputeMean(){ if(!inverse){ eestate = false; @@ -870,7 +870,7 @@ void QtCalculator::ComputeMean(){ } -void QtCalculator::ComputeSin() +void TQtCalculator::ComputeSin() { CALCAMNT work_amount; eestate = false; @@ -936,7 +936,7 @@ void QtCalculator::ComputeSin() } -void QtCalculator::ExecCos(){ +void TQtCalculator::ExecCos(){ switch(kcalcdefaults.style){ @@ -966,7 +966,7 @@ void QtCalculator::ExecCos(){ } -void QtCalculator::ComputeStd(){ +void TQtCalculator::ComputeStd(){ if(!inverse){ // std (n-1) inverse = false; @@ -1000,7 +1000,7 @@ void QtCalculator::ComputeStd(){ } -void QtCalculator::ComputeCos() +void TQtCalculator::ComputeCos() { CALCAMNT work_amount; eestate = false; @@ -1069,7 +1069,7 @@ void QtCalculator::ComputeCos() } -void QtCalculator::ExecTan(){ +void TQtCalculator::ExecTan(){ switch(kcalcdefaults.style){ @@ -1093,7 +1093,7 @@ void QtCalculator::ExecTan(){ } -void QtCalculator::ComputeMedean(){ +void TQtCalculator::ComputeMedean(){ if(!inverse){ // std (n-1) inverse = false; @@ -1125,7 +1125,7 @@ void QtCalculator::ComputeMedean(){ } -void QtCalculator::ComputeTan() +void TQtCalculator::ComputeTan() { CALCAMNT work_amount; eestate = false; @@ -1196,7 +1196,7 @@ void QtCalculator::ComputeTan() } -void QtCalculator::EnterPercent() +void TQtCalculator::EnterPercent() { eestate = false; last_input = OPERATION; @@ -1206,7 +1206,7 @@ void QtCalculator::EnterPercent() } -void QtCalculator::EnterLogr() +void TQtCalculator::EnterLogr() { switch(kcalcdefaults.style){ @@ -1267,7 +1267,7 @@ void QtCalculator::EnterLogr() } } -void QtCalculator::EnterLogn() +void TQtCalculator::EnterLogn() { switch(kcalcdefaults.style){ @@ -1321,7 +1321,7 @@ void QtCalculator::EnterLogn() } -void QtCalculator::base_selected(int number){ +void TQtCalculator::base_selected(int number){ switch(number){ case 0: @@ -1342,7 +1342,7 @@ void QtCalculator::base_selected(int number){ } -void QtCalculator::angle_selected(int number){ +void TQtCalculator::angle_selected(int number){ switch(number){ case 0: @@ -1359,7 +1359,7 @@ void QtCalculator::angle_selected(int number){ } } -void QtCalculator::SetInverse(){ +void TQtCalculator::SetInverse(){ inverse = ! inverse; if (inverse){ @@ -1371,20 +1371,20 @@ void QtCalculator::SetInverse(){ } -void QtCalculator::SetDeg() { +void TQtCalculator::SetDeg() { angle_mode = ANG_DEGREE; } -void QtCalculator::SetGra() { +void TQtCalculator::SetGra() { angle_mode = ANG_GRADIENT; } -void QtCalculator::SetRad() { +void TQtCalculator::SetRad() { angle_mode = ANG_RADIAN; } -void QtCalculator::SetHex() { +void TQtCalculator::SetHex() { /* * Set Hex Mode */ @@ -1397,7 +1397,7 @@ void QtCalculator::SetHex() { UpdateDisplay(); } -void QtCalculator::SetOct() { +void TQtCalculator::SetOct() { /* * Set Oct Mode */ @@ -1410,7 +1410,7 @@ void QtCalculator::SetOct() { UpdateDisplay(); } -void QtCalculator::SetBin() { +void TQtCalculator::SetBin() { /* * Set Bin Mode */ @@ -1423,7 +1423,7 @@ void QtCalculator::SetBin() { UpdateDisplay(); } -void QtCalculator::SetDec() +void TQtCalculator::SetDec() { /* * Set Dec Mode @@ -1438,7 +1438,7 @@ void QtCalculator::SetDec() } -void QtCalculator::EE() +void TQtCalculator::EE() { if(inverse){ DISPLAY_AMOUNT = pi; @@ -1458,7 +1458,7 @@ void QtCalculator::EE() } -void QtCalculator::MR() +void TQtCalculator::MR() { eestate = false; last_input = OPERATION; @@ -1468,7 +1468,7 @@ void QtCalculator::MR() } -void QtCalculator::Mplusminus() +void TQtCalculator::Mplusminus() { eestate = false; @@ -1481,14 +1481,14 @@ void QtCalculator::Mplusminus() } } -void QtCalculator::MC() +void TQtCalculator::MC() { memory_num = 0; refresh_display = 1; } -void QtCalculator::EnterEqual() +void TQtCalculator::EnterEqual() { eestate = false; last_input = OPERATION; @@ -1522,7 +1522,7 @@ void QtCalculator::EnterEqual() } -void QtCalculator::Clear(){ +void TQtCalculator::Clear(){ eestate = false; @@ -1552,7 +1552,7 @@ void QtCalculator::Clear(){ } -void QtCalculator::ClearAll() +void TQtCalculator::ClearAll() { eestate = false; @@ -1565,7 +1565,7 @@ void QtCalculator::ClearAll() -void QtCalculator::UpdateDisplay() +void TQtCalculator::UpdateDisplay() { // this needs to be rewritten based on whether we are currently @@ -1720,11 +1720,11 @@ int cvb(char *out_str, long amount, int max_digits) lead_one = 1, lead_one_count = 0, work_size = sizeof(amount) * CHAR_BIT; - unsigned long bit_mask = (1 << ((sizeof(amount) * CHAR_BIT) - 1)); + unsigned long bit_tqmask = (1 << ((sizeof(amount) * CHAR_BIT) - 1)); - while (bit_mask) { + while (bit_tqmask) { - if (amount & bit_mask) { + if (amount & bit_tqmask) { if (lead_one) lead_one_count++; lead_zero = 0; @@ -1734,7 +1734,7 @@ int cvb(char *out_str, long amount, int max_digits) if (!lead_zero) work_str[work_char++] = '0'; } - bit_mask >>= 1; + bit_tqmask >>= 1; } if (!work_char) work_str[work_char++] = '0'; diff --git a/kspread/plugins/calculator/kcalctype.h b/kspread/plugins/calculator/kcalctype.h index b051f107..b4c0b4ff 100644 --- a/kspread/plugins/calculator/kcalctype.h +++ b/kspread/plugins/calculator/kcalctype.h @@ -2,7 +2,7 @@ $Id: kcalctype.h 466447 2005-10-02 17:54:10Z zander $ KCalc, a scientific calculator for the X window system using the - Qt widget libraries, available at no cost at http://www.troll.no + TQt widget libraries, available at no cost at http://www.troll.no Copyright (C) 1996 Bernd Johannes Wuebben wuebben@math.cornell.edu diff --git a/kspread/plugins/calculator/main.cpp b/kspread/plugins/calculator/main.cpp index 35887547..c6efb99f 100644 --- a/kspread/plugins/calculator/main.cpp +++ b/kspread/plugins/calculator/main.cpp @@ -43,8 +43,8 @@ K_EXPORT_COMPONENT_FACTORY( libkspreadcalc, CalcFactory ) KInstance* CalcFactory::s_global = 0; -CalcFactory::CalcFactory( QObject* parent, const char* name ) - : KLibFactory( parent, name ) +CalcFactory::CalcFactory( TQObject* tqparent, const char* name ) + : KLibFactory( tqparent, name ) { s_global = new KInstance( "kspreadcalc" ); } @@ -54,15 +54,15 @@ CalcFactory::~CalcFactory() delete s_global; } -QObject* CalcFactory::createObject( QObject* parent, const char* name, const char* /*classname*/, const QStringList & ) +TQObject* CalcFactory::createObject( TQObject* tqparent, const char* name, const char* /*classname*/, const TQStringList & ) { - if ( !parent->inherits("KSpread::View") ) + if ( !tqparent->inherits("KSpread::View") ) { - kdError() << "CalcFactory: KSpread::View expected. Parent is " << parent->className() << endl; + kdError() << "CalcFactory: KSpread::View expected. Parent is " << tqparent->className() << endl; return 0; } - QObject *obj = new Calculator( (View*)parent, name ); + TQObject *obj = new Calculator( (View*)tqparent, name ); return obj; } @@ -77,17 +77,17 @@ KInstance* CalcFactory::global() * ***************************************************/ -Calculator::Calculator( View* parent, const char* name ) - : KParts::Plugin( parent, name ) +Calculator::Calculator( View* tqparent, const char* name ) + : KParts::Plugin( tqparent, name ) { m_calc = 0; - m_view = parent; + m_view = tqparent; KGlobal::locale()->insertCatalogue("kspreadcalc_calc"); - parent->installEventFilter( this ); + tqparent->installEventFilter( this ); (void)new KAction( i18n("Calculator"), SmallIcon("kcalc", CalcFactory::global()), - 0, this, SLOT( showCalculator() ), actionCollection(), "kspreadcalc"); + 0, this, TQT_SLOT( showCalculator() ), actionCollection(), "kspreadcalc"); } void Calculator::showCalculator() @@ -99,7 +99,7 @@ void Calculator::showCalculator() return; } - m_calc = new QtCalculator( this, (View*)parent() ); + m_calc = new TQtCalculator( this, (View*)tqparent() ); m_calc->setFixedSize( 9 + 100 + 9 + 233 + 9, 239); m_calc->show(); m_calc->raise(); @@ -109,7 +109,7 @@ Calculator::~Calculator() { } -bool Calculator::eventFilter( QObject*, QEvent* ev ) +bool Calculator::eventFilter( TQObject*, TQEvent* ev ) { if ( !m_calc ) return FALSE; @@ -145,7 +145,7 @@ bool Calculator::eventFilter( QObject*, QEvent* ev ) // Multiple cells selected ? m_calc->setData( event->rect(), event->sheet().latin1() ); - QString str = util_rangeName( sheet, event->rect() ); + TQString str = util_rangeName( sheet, event->rect() ); m_calc->setLabel( str.latin1() ); return FALSE; @@ -156,7 +156,7 @@ bool Calculator::eventFilter( QObject*, QEvent* ev ) /*************************************************** * - * QtCalculator + * TQtCalculator * ***************************************************/ @@ -164,7 +164,7 @@ bool Calculator::eventFilter( QObject*, QEvent* ev ) * This is a hook that makes the calculator to * ask KSpread for the values of the selected cells. */ -void QtCalculator::useData() +void TQtCalculator::useData() { stats.clearAll(); @@ -193,7 +193,7 @@ void QtCalculator::useData() delete []v; - sheet_name = QString::null; + sheet_name = TQString(); } #include "main.moc" diff --git a/kspread/plugins/calculator/main.h b/kspread/plugins/calculator/main.h index 08e9b5c9..dc5eb3a5 100644 --- a/kspread/plugins/calculator/main.h +++ b/kspread/plugins/calculator/main.h @@ -20,16 +20,16 @@ #ifndef __my_app_h__ #define __my_app_h__ -#include <qptrlist.h> -#include <qstring.h> -#include <qobject.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqobject.h> #include <klibloader.h> #include <kparts/plugin.h> #include <koffice_export.h> -class QtCalculator; +class TQtCalculator; class KInstance; namespace KSpread @@ -40,12 +40,13 @@ class View; class CalcFactory : public KLibFactory { Q_OBJECT + TQ_OBJECT public: - CalcFactory( QObject* parent = 0, const char* name = 0 ); + CalcFactory( TQObject* tqparent = 0, const char* name = 0 ); ~CalcFactory(); - virtual QObject* createObject( QObject* parent = 0, const char* name = 0, - const char* classname = "QObject", const QStringList &args = QStringList() ); + virtual TQObject* createObject( TQObject* tqparent = 0, const char* name = 0, + const char* classname = TQOBJECT_OBJECT_NAME_STRING, const TQStringList &args = TQStringList() ); static KInstance* global(); @@ -56,8 +57,9 @@ private: class KSPREAD_EXPORT Calculator : public KParts::Plugin { Q_OBJECT + TQ_OBJECT public: - Calculator( View* parent, const char* name = 0 ); + Calculator( View* tqparent, const char* name = 0 ); ~Calculator(); View* view() { return m_view; } @@ -66,10 +68,10 @@ protected slots: void showCalculator(); protected: - bool eventFilter( QObject*, QEvent* ); + bool eventFilter( TQObject*, TQEvent* ); private: - QtCalculator* m_calc; + TQtCalculator* m_calc; View* m_view; }; diff --git a/kspread/plugins/calculator/stats.cpp b/kspread/plugins/calculator/stats.cpp index 14ce24b9..5413701b 100644 --- a/kspread/plugins/calculator/stats.cpp +++ b/kspread/plugins/calculator/stats.cpp @@ -2,7 +2,7 @@ $Id: stats.cpp 466447 2005-10-02 17:54:10Z zander $ KCalc, a scientific calculator for the X window system using the - Qt widget libraries, available at no cost at http://www.troll.no + TQt widget libraries, available at no cost at http://www.troll.no Copyright (C) 1996 Bernd Johannes Wuebben wuebben@math.cornell.edu diff --git a/kspread/plugins/calculator/stats.h b/kspread/plugins/calculator/stats.h index 1f325a20..3c20881f 100644 --- a/kspread/plugins/calculator/stats.h +++ b/kspread/plugins/calculator/stats.h @@ -2,7 +2,7 @@ $Id: stats.h 466447 2005-10-02 17:54:10Z zander $ KCalc, a scientific calculator for the X window system using the - Qt widget libraries, available at no cost at http://www.troll.no + TQt widget libraries, available at no cost at http://www.troll.no Copyright (C) 1996 Bernd Johannes Wuebben wuebben@math.cornell.edu @@ -27,7 +27,7 @@ #ifndef KSTATS_H #define KSTATS_H -#include <qptrlist.h> +#include <tqptrlist.h> #include <math.h> #include "kcalctype.h" @@ -59,17 +59,17 @@ public: private: - QPtrList<CALCAMNT> data; + TQPtrList<CALCAMNT> data; bool error_flag; }; -class MyList : public QPtrList<CALCAMNT> +class MyList : public TQPtrList<CALCAMNT> { public: - MyList() : QPtrList<CALCAMNT>() {}; + MyList() : TQPtrList<CALCAMNT>() {}; protected: int compareItems(Item item1,Item item2); diff --git a/kspread/plugins/insertcalendar/kspread_insertcalendardialog.cc b/kspread/plugins/insertcalendar/kspread_insertcalendardialog.cc index 541783b8..4a465eed 100644 --- a/kspread/plugins/insertcalendar/kspread_insertcalendardialog.cc +++ b/kspread/plugins/insertcalendar/kspread_insertcalendardialog.cc @@ -28,31 +28,31 @@ #include <kdatewidget.h> #include <kdebug.h> -#include <qpushbutton.h> +#include <tqpushbutton.h> namespace KSpread { -InsertCalendarDialog::InsertCalendarDialog(QWidget* parent, const char* name) -: InsertCalendarDialogBase(parent,name) +InsertCalendarDialog::InsertCalendarDialog(TQWidget* tqparent, const char* name) +: InsertCalendarDialogBase(tqparent,name) { this->m_datePicker = NULL; //we start with a default calendar for the current month; - QDate first_day_in_month = QDate::currentDate(); + TQDate first_day_in_month = TQDate::tqcurrentDate(); first_day_in_month.setYMD(first_day_in_month.year(),first_day_in_month.month(),1); - QDate last_day_in_month(first_day_in_month.year(),first_day_in_month.month(),first_day_in_month.daysInMonth()); + TQDate last_day_in_month(first_day_in_month.year(),first_day_in_month.month(),first_day_in_month.daysInMonth()); this->m_startDateWidget->setDate(first_day_in_month); this->m_endDateWidget->setDate(last_day_in_month); - connect(this->m_selectStartDateButton,SIGNAL(clicked()),this,SLOT(showStartDatePicker())); - connect(this->m_selectEndDateButton,SIGNAL(clicked()),this,SLOT(showEndDatePicker())); + connect(this->m_selectStartDateButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(showStartDatePicker())); + connect(this->m_selectEndDateButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(showEndDatePicker())); - connect(this->m_insertButton,SIGNAL(clicked()),this,SLOT(accept())); - connect(this->m_cancelButton,SIGNAL(clicked()),this,SLOT(reject())); + connect(this->m_insertButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(accept())); + connect(this->m_cancelButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(reject())); } InsertCalendarDialog::~InsertCalendarDialog() @@ -73,7 +73,7 @@ bool InsertCalendarDialog::buildDatePickerFrame() if (!m_datePicker) return false; - connect(m_datePicker,SIGNAL(destroyed()),this,SLOT(datePickerDeleted())); + connect(m_datePicker,TQT_SIGNAL(destroyed()),this,TQT_SLOT(datePickerDeleted())); m_datePicker->setCloseButton(true); m_datePicker->move(this->x()+this->width(),this->y()); @@ -93,7 +93,7 @@ void InsertCalendarDialog::accept() if (m_datePicker) m_datePicker->deleteLater(); kdDebug() << "insert calendar dialog accepted (insert button clicked)" << endl; - done(QDialog::Accepted); + done(TQDialog::Accepted); emit insertCalendar(startDate(),endDate()); } @@ -102,15 +102,15 @@ void InsertCalendarDialog::reject() if (m_datePicker) m_datePicker->deleteLater(); kdDebug() << "insert calendar dialog rejected (cancel button clicked)" << endl; - done(QDialog::Rejected); + done(TQDialog::Rejected); } void InsertCalendarDialog::showStartDatePicker() { if (buildDatePickerFrame()) { - connect(m_datePicker,SIGNAL(dateSelected(QDate)),this,SLOT(setStartDate(QDate))); - connect(m_datePicker,SIGNAL(dateEntered(QDate)),this,SLOT(setStartDate(QDate))); + connect(m_datePicker,TQT_SIGNAL(dateSelected(TQDate)),this,TQT_SLOT(setStartDate(TQDate))); + connect(m_datePicker,TQT_SIGNAL(dateEntered(TQDate)),this,TQT_SLOT(setStartDate(TQDate))); m_datePicker->setDate(startDate()); } } @@ -119,28 +119,28 @@ void InsertCalendarDialog::showEndDatePicker() { if (buildDatePickerFrame()) { - connect(m_datePicker,SIGNAL(dateSelected(QDate)),this,SLOT(setEndDate(QDate))); - connect(m_datePicker,SIGNAL(dateEntered(QDate)),this,SLOT(setEndDate(QDate))); + connect(m_datePicker,TQT_SIGNAL(dateSelected(TQDate)),this,TQT_SLOT(setEndDate(TQDate))); + connect(m_datePicker,TQT_SIGNAL(dateEntered(TQDate)),this,TQT_SLOT(setEndDate(TQDate))); m_datePicker->setDate(endDate()); } } -void InsertCalendarDialog::setStartDate(QDate date) +void InsertCalendarDialog::setStartDate(TQDate date) { this->m_startDateWidget->setDate(date); } -void InsertCalendarDialog::setEndDate(QDate date) +void InsertCalendarDialog::setEndDate(TQDate date) { this->m_endDateWidget->setDate(date); } -QDate InsertCalendarDialog::startDate() const +TQDate InsertCalendarDialog::startDate() const { return this->m_startDateWidget->date(); } -QDate InsertCalendarDialog::endDate() const +TQDate InsertCalendarDialog::endDate() const { return this->m_endDateWidget->date(); } diff --git a/kspread/plugins/insertcalendar/kspread_insertcalendardialog.h b/kspread/plugins/insertcalendar/kspread_insertcalendardialog.h index f52c2e93..f68ab4c6 100644 --- a/kspread/plugins/insertcalendar/kspread_insertcalendardialog.h +++ b/kspread/plugins/insertcalendar/kspread_insertcalendardialog.h @@ -28,7 +28,7 @@ #include <kspread_insertcalendardialogbase.h> #include <koffice_export.h> -#include <qdatetime.h> +#include <tqdatetime.h> class KDatePicker; @@ -38,6 +38,7 @@ namespace KSpread class KSPREAD_EXPORT InsertCalendarDialog : public InsertCalendarDialogBase { Q_OBJECT + TQ_OBJECT private: @@ -55,7 +56,7 @@ class KSPREAD_EXPORT InsertCalendarDialog : public InsertCalendarDialogBase * The dates in the dialog initialize to a complete calendar for the * current month. */ - InsertCalendarDialog(QWidget* parent = 0, const char* name = 0); + InsertCalendarDialog(TQWidget* tqparent = 0, const char* name = 0); /** * Virtual destructor. @@ -85,25 +86,25 @@ class KSPREAD_EXPORT InsertCalendarDialog : public InsertCalendarDialogBase void datePickerDeleted(); /** - * This slot is reimplemented from QDialog and + * This slot is reimplemented from TQDialog and * is connected to the insert button. * It also emits a insertCalendar signal. * * The dialog is closed (not deleted) when * this slot is called. * - * @see insertCalendar, reject, QDialog::done + * @see insertCalendar, reject, TQDialog::done */ virtual void accept(); /** - * This slot is reimplemented from QDialog and + * This slot is reimplemented from TQDialog and * is connected to the cancel button. * * The dialog is closed (not deleted) when * this slot is called. * - * @see accept, QDialog::done + * @see accept, TQDialog::done */ virtual void reject(); @@ -125,13 +126,13 @@ class KSPREAD_EXPORT InsertCalendarDialog : public InsertCalendarDialogBase * Slot for setting the start date in the KDateWidget. * Normally this slot is activated by a KDatePicker widget. */ - void setStartDate(QDate); + void setStartDate(TQDate); /** * Slot for setting the end date in the KDateWidget. * Normally this slot is activated by a KDatePicker widget. */ - void setEndDate(QDate); + void setEndDate(TQDate); public: @@ -140,12 +141,12 @@ class KSPREAD_EXPORT InsertCalendarDialog : public InsertCalendarDialogBase /** * @returns the selected start date. */ - QDate startDate() const; + TQDate startDate() const; /** * @returns the selected end date. */ - QDate endDate() const; + TQDate endDate() const; signals: @@ -157,7 +158,7 @@ class KSPREAD_EXPORT InsertCalendarDialog : public InsertCalendarDialogBase * insert calendar plugin to actually insert * the calendar with the selected dates. */ - void insertCalendar(const QDate &from, const QDate &to); + void insertCalendar(const TQDate &from, const TQDate &to); }; } diff --git a/kspread/plugins/insertcalendar/kspread_insertcalendardialogbase.ui b/kspread/plugins/insertcalendar/kspread_insertcalendardialogbase.ui index 9315c38c..b2c82866 100644 --- a/kspread/plugins/insertcalendar/kspread_insertcalendardialogbase.ui +++ b/kspread/plugins/insertcalendar/kspread_insertcalendardialogbase.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.2" stdsetdef="1"> <class>KSpread::InsertCalendarDialogBase</class> -<widget class="QDialog"> +<widget class="TQDialog"> <property name="name"> <cstring>KSpread::InsertCalendarDialogBase</cstring> </property> @@ -26,7 +26,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QGroupBox" row="0" column="0" rowspan="1" colspan="2"> + <widget class="TQGroupBox" row="0" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>m_startDateGroupBox</cstring> </property> @@ -56,7 +56,7 @@ </sizepolicy> </property> </widget> - <widget class="QPushButton" row="0" column="1"> + <widget class="TQPushButton" row="0" column="1"> <property name="name"> <cstring>m_selectStartDateButton</cstring> </property> @@ -77,7 +77,7 @@ </widget> </grid> </widget> - <widget class="QGroupBox" row="1" column="0" rowspan="1" colspan="2"> + <widget class="TQGroupBox" row="1" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>m_endDateGroupBox</cstring> </property> @@ -113,7 +113,7 @@ </sizepolicy> </property> </widget> - <widget class="QPushButton" row="0" column="1"> + <widget class="TQPushButton" row="0" column="1"> <property name="name"> <cstring>m_selectEndDateButton</cstring> </property> @@ -144,14 +144,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>400</width> <height>19</height> </size> </property> </spacer> - <widget class="QPushButton" row="3" column="0"> + <widget class="TQPushButton" row="3" column="0"> <property name="name"> <cstring>m_insertButton</cstring> </property> @@ -175,7 +175,7 @@ <comment>What's this for the insert button of the insert calendar plugin</comment> </property> </widget> - <widget class="QPushButton" row="3" column="1"> + <widget class="TQPushButton" row="3" column="1"> <property name="name"> <cstring>m_cancelButton</cstring> </property> @@ -199,7 +199,7 @@ </widget> </grid> </widget> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kdatewidget.h</includehint> <includehint>kdatewidget.h</includehint> diff --git a/kspread/plugins/insertcalendar/kspread_plugininsertcalendar.cc b/kspread/plugins/insertcalendar/kspread_plugininsertcalendar.cc index 56388af8..558f59cb 100644 --- a/kspread/plugins/insertcalendar/kspread_plugininsertcalendar.cc +++ b/kspread/plugins/insertcalendar/kspread_plugininsertcalendar.cc @@ -39,8 +39,8 @@ #include <kofficeversion.h> #include <kmessagebox.h> -#include <qpoint.h> -#include <qrect.h> +#include <tqpoint.h> +#include <tqrect.h> namespace KSpread { @@ -50,15 +50,15 @@ typedef KGenericFactory<PluginInsertCalendar> InsertCalendarFactory; K_EXPORT_COMPONENT_FACTORY( libkspreadinsertcalendar, InsertCalendarFactory("kspreadinsertcalendar")) -PluginInsertCalendar::PluginInsertCalendar( QObject *parent, const char *name, const QStringList& /*args*/ ) -: Plugin(parent,name) +PluginInsertCalendar::PluginInsertCalendar( TQObject *tqparent, const char *name, const TQStringList& /*args*/ ) +: Plugin(tqparent,name) { this->m_kspreadView = NULL; - if (parent) + if (tqparent) { - if (parent->inherits("KSpread::View")) + if (tqparent->inherits("KSpread::View")) { - this->m_kspreadView = (View*)parent; + this->m_kspreadView = (View*)tqparent; } else { @@ -67,14 +67,14 @@ PluginInsertCalendar::PluginInsertCalendar( QObject *parent, const char *name, c } else { - kdWarning() << "Plugin created without a parent!!!" << endl; + kdWarning() << "Plugin created without a tqparent!!!" << endl; } this->m_dialog = NULL; (void)new KAction( i18n("Insert Calendar..."), KShortcut::null(), - this, SLOT( slotShowDialog() ), actionCollection(), "kspreadinsertcalendar"); + this, TQT_SLOT( slotShowDialog() ), actionCollection(), "kspreadinsertcalendar"); } PluginInsertCalendar::~PluginInsertCalendar() @@ -107,8 +107,8 @@ void PluginInsertCalendar::slotShowDialog() Q_ASSERT(m_dialog); - connect(m_dialog,SIGNAL(insertCalendar(const QDate&, const QDate&)), - this,SLOT(slotInsertCalendar(const QDate&, const QDate&))); + connect(m_dialog,TQT_SIGNAL(insertCalendar(const TQDate&, const TQDate&)), + this,TQT_SLOT(slotInsertCalendar(const TQDate&, const TQDate&))); } //@todo if anyone knows a better way to get a background window to foreground, please change this... @@ -117,7 +117,7 @@ void PluginInsertCalendar::slotShowDialog() } -void PluginInsertCalendar::slotInsertCalendar(const QDate &start, const QDate &end) +void PluginInsertCalendar::slotInsertCalendar(const TQDate &start, const TQDate &end) { //@todo implement kdDebug() << "slotInsert... still to be implemented" << endl; @@ -158,7 +158,7 @@ void PluginInsertCalendar::slotInsertCalendar(const QDate &start, const QDate &e Q_ASSERT(selection_info); - QPoint selection = selection_info->selection().topLeft(); + TQPoint selection = selection_info->selection().topLeft(); Sheet* sheet = m_kspreadView->activeSheet(); @@ -175,12 +175,12 @@ void PluginInsertCalendar::slotInsertCalendar(const QDate &start, const QDate &e //@todo improve calendar size prediction! int sizeY = 4 + (int)(0.5*(float)(start.daysTo(end))); - if (!sheet->areaIsEmpty(QRect(selection,QSize(sizeX,sizeY)))) + if (!sheet->areaIsEmpty(TQRect(selection,TQSize(sizeX,sizeY)))) { if (KMessageBox::No == KMessageBox::warningYesNo(NULL,i18n("The area where the calendar is inserted is NOT empty, are you sure you want to continue, overwriting existing data? If you choose No the area that would be required for the desired calendar will be selected so you can see what data would be overwritten."),i18n("Warning"))) { //select the area so the user knows what's in the way - selection_info->initialize(QRect(selection.x(),selection.y(),sizeX,sizeY));//,sheet); + selection_info->initialize(TQRect(selection.x(),selection.y(),sizeX,sizeY));//,sheet); return; } } @@ -194,16 +194,16 @@ void PluginInsertCalendar::slotInsertCalendar(const QDate &start, const QDate &e int row = selection.y(); int col = selection.x(); int colstart = col; //this is where we get back after each week - sheet->setText(row,colstart,i18n("Calendar from %1 to %2").arg(start.toString()).arg(end.toString())); + sheet->setText(row,colstart,i18n("Calendar from %1 to %2").tqarg(start.toString()).tqarg(end.toString())); - QDate current(start); -// QDate previous(current); + TQDate current(start); +// TQDate previous(current); bool yearheader = true; bool monthheader = true; bool weekheader = true; //this loop creates the actual calendar - //@todo formatting of cells - each day occupies QRect(row,col,row,col+1) + //@todo formatting of cells - each day occupies TQRect(row,col,row,col+1) while (current <= end) { @@ -229,7 +229,7 @@ void PluginInsertCalendar::slotInsertCalendar(const QDate &start, const QDate &e if (yearheader) { - kdDebug() << "inserting year " + QString::number(current.year()) << endl; + kdDebug() << "inserting year " + TQString::number(current.year()) << endl; sheet->setText(row,colstart+6,cs->yearString(current,false)); row+=2; @@ -237,7 +237,7 @@ void PluginInsertCalendar::slotInsertCalendar(const QDate &start, const QDate &e } if (monthheader) { - kdDebug() << "inserting month " + QString::number(current.month()) << endl; + kdDebug() << "inserting month " + TQString::number(current.month()) << endl; sheet->setText(row,colstart+6,cs->monthName(current,false)); row+=2; //we always have the week number in the first column @@ -251,7 +251,7 @@ void PluginInsertCalendar::slotInsertCalendar(const QDate &start, const QDate &e } if (weekheader) { - sheet->setText(row,colstart,QString::number(cs->weekNumber(current))); + sheet->setText(row,colstart,TQString::number(cs->weekNumber(current))); col++; weekheader=false; @@ -262,10 +262,10 @@ void PluginInsertCalendar::slotInsertCalendar(const QDate &start, const QDate &e } } - sheet->setText(row,col,QString::number(cs->day(current))); + sheet->setText(row,col,TQString::number(cs->day(current))); //go to the next date //@todo isn't there a better way, like current++ or something?? - QDate next = current.addDays(1); + TQDate next = current.addDays(1); current.setYMD(next.year(),next.month(),next.day()); col+=2; diff --git a/kspread/plugins/insertcalendar/kspread_plugininsertcalendar.h b/kspread/plugins/insertcalendar/kspread_plugininsertcalendar.h index 9eb6060d..be93fea5 100644 --- a/kspread/plugins/insertcalendar/kspread_plugininsertcalendar.h +++ b/kspread/plugins/insertcalendar/kspread_plugininsertcalendar.h @@ -29,7 +29,7 @@ #include <koffice_export.h> -#include <qdatetime.h> +#include <tqdatetime.h> class KAboutData; @@ -52,11 +52,12 @@ class InsertCalendarDialog; class KSPREAD_EXPORT PluginInsertCalendar : public KParts::Plugin { Q_OBJECT + TQ_OBJECT protected: /** - * This is the parent part of the plugin. It is used + * This is the tqparent part of the plugin. It is used * to access the spreadsheet and actually insert the * calendar. * @@ -77,7 +78,7 @@ class KSPREAD_EXPORT PluginInsertCalendar : public KParts::Plugin /** * Constructor. This constructor is usable with KGenericFactory. */ - PluginInsertCalendar( QObject *parent, const char *name, const QStringList& args ); + PluginInsertCalendar( TQObject *tqparent, const char *name, const TQStringList& args ); /** * Virtual destructor. @@ -105,7 +106,7 @@ class KSPREAD_EXPORT PluginInsertCalendar : public KParts::Plugin * from the insert calendar dialog and builds an calendar in the * spreadsheet accordingly. */ - void slotInsertCalendar(const QDate &start, const QDate &end); + void slotInsertCalendar(const TQDate &start, const TQDate &end); }; } diff --git a/kspread/plugins/scripting/kspreadcore/krs_cell.cpp b/kspread/plugins/scripting/kspreadcore/krs_cell.cpp index cabf0c50..46ee1389 100644 --- a/kspread/plugins/scripting/kspreadcore/krs_cell.cpp +++ b/kspread/plugins/scripting/kspreadcore/krs_cell.cpp @@ -59,30 +59,30 @@ Cell::Cell(KSpread::Cell* cell, KSpread::Sheet* sheet, uint col, uint row) Cell::~Cell() { } -const QString Cell::getClassName() const { +const TQString Cell::getClassName() const { return "Kross::KSpreadCore::KSpreadCell"; } -QVariant Cell::toVariant(const KSpread::Value& value) const +TQVariant Cell::toVariant(const KSpread::Value& value) const { //Should we use following value-format enums here? //fmt_None, fmt_Boolean, fmt_Number, fmt_Percent, fmt_Money, fmt_DateTime, fmt_Date, fmt_Time, fmt_String switch(value.type()) { case KSpread::Value::Empty: - return QVariant(); + return TQVariant(); case KSpread::Value::Boolean: - return QVariant( value.asBoolean() ); + return TQVariant( value.asBoolean() ); case KSpread::Value::Integer: - return static_cast<Q_LLONG>(value.asInteger()); + return static_cast<TQ_LLONG>(value.asInteger()); case KSpread::Value::Float: return (float)value.asFloat(); case KSpread::Value::String: return value.asString(); case KSpread::Value::Array: { - QValueList<QVariant> colarray; + TQValueList<TQVariant> colarray; for(uint j = 0; j < value.rows(); j++) { - QValueList<QVariant> rowarray; + TQValueList<TQVariant> rowarray; for( uint i = 0; i < value.columns(); i++) { KSpread::Value v = value.element(i,j); rowarray.append( toVariant(v) ); @@ -93,28 +93,28 @@ QVariant Cell::toVariant(const KSpread::Value& value) const } break; case KSpread::Value::CellRange: //FIXME: not yet used - return QVariant(); + return TQVariant(); case KSpread::Value::Error: - return QVariant(); + return TQVariant(); } - return QVariant(); + return TQVariant(); } -QVariant Cell::value() const { +TQVariant Cell::value() const { return toVariant( m_cell->value() ); } -bool Cell::setValue(const QVariant& value) { +bool Cell::setValue(const TQVariant& value) { KSpread::Value v = m_cell->value(); switch(value.type()) { - case QVariant::Bool: v.setValue( value.toBool() ); break; - case QVariant::ULongLong: v.setValue( (long)value.toLongLong() ); break; - case QVariant::Int: v.setValue( value.toInt() ); break; - case QVariant::Double: v.setValue( value.toDouble() ); break; - case QVariant::String: v.setValue( value.toString() ); break; - case QVariant::Date: v.setValue( value.toDate() ); break; - case QVariant::Time: v.setValue( value.toTime() ); break; - case QVariant::DateTime: v.setValue( value.toDateTime() ); break; + case TQVariant::Bool: v.setValue( value.toBool() ); break; + case TQVariant::ULongLong: v.setValue( (long)value.toLongLong() ); break; + case TQVariant::Int: v.setValue( value.toInt() ); break; + case TQVariant::Double: v.setValue( value.toDouble() ); break; + case TQVariant::String: v.setValue( value.toString() ); break; + case TQVariant::Date: v.setValue( value.toDate() ); break; + case TQVariant::Time: v.setValue( value.toTime() ); break; + case TQVariant::DateTime: v.setValue( value.toDateTime() ); break; default: return false; } return true; @@ -146,38 +146,38 @@ void Cell::setNextCell(Cell* c) { return m_cell->setNextCell(c->m_cell); } -const QString Cell::name() const { +const TQString Cell::name() const { return m_cell->name(); } -const QString Cell::fullName() const { +const TQString Cell::fullName() const { return m_cell->fullName(); } -const QString Cell::comment() const { +const TQString Cell::comment() const { return m_cell->format()->comment(m_col, m_row); } -void Cell::setComment(const QString& c) { +void Cell::setComment(const TQString& c) { return m_cell->format()->setComment(c); } -const QString Cell::getFormatString() const { +const TQString Cell::getFormatString() const { return m_cell->format()->getFormatString(m_col, m_row); } -void Cell::setFormatString(const QString& format) { +void Cell::setFormatString(const TQString& format) { m_cell->format()->setFormatString(format); } -const QString Cell::text() const { +const TQString Cell::text() const { return m_cell->text(); } -bool Cell::setText(const QString& text) { +bool Cell::setText(const TQString& text) { KSpread::ProtectedCheck prot; prot.setSheet (m_sheet); - prot.add (QPoint (m_col, m_row)); + prot.add (TQPoint (m_col, m_row)); if (prot.check()) return false; @@ -185,26 +185,26 @@ bool Cell::setText(const QString& text) { dm->setSheet (m_sheet); dm->setValue (text); dm->setParsing (true); - dm->add (QPoint (m_col, m_row)); + dm->add (TQPoint (m_col, m_row)); dm->execute (); return true; } -const QString Cell::textColor() { +const TQString Cell::textColor() { return m_cell->format()->textColor(m_col, m_row).name(); } -void Cell::setTextColor(const QString& textcolor) { - m_cell->format()->setTextColor( QColor(textcolor) ); +void Cell::setTextColor(const TQString& textcolor) { + m_cell->format()->setTextColor( TQColor(textcolor) ); } -const QString Cell::backgroundColor() { +const TQString Cell::backgroundColor() { return m_cell->format()->bgColor(m_col, m_row).name(); } -void Cell::setBackgroundColor(const QString& backgroundcolor) { - m_cell->format()->setBgColor( QColor(backgroundcolor) ); +void Cell::setBackgroundColor(const TQString& backgroundcolor) { + m_cell->format()->setBgColor( TQColor(backgroundcolor) ); } } diff --git a/kspread/plugins/scripting/kspreadcore/krs_cell.h b/kspread/plugins/scripting/kspreadcore/krs_cell.h index 5f3f221d..c69b831d 100644 --- a/kspread/plugins/scripting/kspreadcore/krs_cell.h +++ b/kspread/plugins/scripting/kspreadcore/krs_cell.h @@ -26,8 +26,8 @@ #include <api/class.h> -#include <qstring.h> -#include <qcolor.h> +#include <tqstring.h> +#include <tqcolor.h> namespace Kross { namespace KSpreadCore { @@ -52,17 +52,17 @@ class Cell : public Kross::Api::Class<Cell> public: Cell(KSpread::Cell* cell, KSpread::Sheet* sheet, uint col, uint row); virtual ~Cell(); - virtual const QString getClassName() const; + virtual const TQString getClassName() const; private: /** * Return the value of the cell. */ - QVariant value() const; + TQVariant value() const; /** * Set the value the cell has. */ - bool setValue(const QVariant& value); + bool setValue(const TQVariant& value); /** * Return the column number. @@ -94,21 +94,21 @@ class Cell : public Kross::Api::Class<Cell> * Returns the name of the cell. For example, the cell in first column * and first row is "A1". */ - const QString name() const; + const TQString name() const; /** * Returns the full name of the cell, i.e. including the worksheet name. * Example: "Sheet1!A1" */ - const QString fullName() const; + const TQString fullName() const; /** * Returns the comment for the cell. */ - const QString comment() const; + const TQString comment() const; /** * Set the comment for the cell. */ - void setComment(const QString& c); + void setComment(const TQString& c); #if 0 bool isFormula() const; @@ -118,50 +118,50 @@ class Cell : public Kross::Api::Class<Cell> /** * Returns the format of the cell, e.g. #.##0.00, dd/mmm/yyyy,... */ - const QString getFormatString() const; + const TQString getFormatString() const; /** * Sets the format of the cell, e.g. #.##0.00, dd/mmm/yyyy,... */ - void setFormatString(const QString& format); + void setFormatString(const TQString& format); /** * Return the text of the cell (the formula if there is one, * the value otherwise). This could be a value (e.g. "14.03") * or a formula (e.g. "=SUM(A1:A10)") */ - const QString text() const; + const TQString text() const; /** * Set the text of the cell. the text * will be handled as string */ - bool setText(const QString& text); + bool setText(const TQString& text); /** * Return the textcolor as RGB-value in the format "#RRGGBB". */ - const QString textColor(); + const TQString textColor(); /** * Set the textcolor to the RGB-value in the format "#RRGGBB" * where each of R, G, and B is a single hex digit. */ - void setTextColor(const QString& textcolor); + void setTextColor(const TQString& textcolor); /** * Return the backgroundcolor as RGB-value in the format "#RRGGBB". */ - const QString backgroundColor(); + const TQString backgroundColor(); /** * Set the backgroundcolor to the RGB-value in the format "#RRGGBB" * where each of R, G, and B is a single hex digit. */ - void setBackgroundColor(const QString& backgroundcolor); + void setBackgroundColor(const TQString& backgroundcolor); private: KSpread::Cell* m_cell; KSpread::Sheet* m_sheet; uint m_col, m_row; - QVariant toVariant(const KSpread::Value& value) const; + TQVariant toVariant(const KSpread::Value& value) const; }; } } diff --git a/kspread/plugins/scripting/kspreadcore/krs_doc.cpp b/kspread/plugins/scripting/kspreadcore/krs_doc.cpp index 37c87efd..0372d83f 100644 --- a/kspread/plugins/scripting/kspreadcore/krs_doc.cpp +++ b/kspread/plugins/scripting/kspreadcore/krs_doc.cpp @@ -49,7 +49,7 @@ Doc::~Doc() { } -const QString Doc::getClassName() const { +const TQString Doc::getClassName() const { return "Kross::KSpreadCore::Doc"; } @@ -58,25 +58,25 @@ Sheet* Doc::currentSheet() return new Sheet(m_doc->displaySheet(), m_doc); } -Sheet* Doc::sheetByName(const QString& name) +Sheet* Doc::sheetByName(const TQString& name) { - QPtrListIterator<KSpread::Sheet> it (m_doc->map()->sheetList()); + TQPtrListIterator<KSpread::Sheet> it (m_doc->map()->sheetList()); for( ; it.current(); ++it ) if(it.current()->sheetName() == name) return new Sheet(it.current(), m_doc); return 0; } -QStringList Doc::sheetNames() +TQStringList Doc::sheetNames() { - QStringList names; - QPtrListIterator<KSpread::Sheet> it (m_doc->map()->sheetList()); + TQStringList names; + TQPtrListIterator<KSpread::Sheet> it (m_doc->map()->sheetList()); for( ; it.current(); ++it ) names.append( it.current()->sheetName() ); return names; } -bool Doc::addSheet(const QString& sheetname) +bool Doc::addSheet(const TQString& sheetname) { KSpread::Sheet* sheet = m_doc->map()->createSheet(); if(sheet) { @@ -90,7 +90,7 @@ bool Doc::addSheet(const QString& sheetname) return false; } -bool Doc::removeSheet(const QString& sheetname) +bool Doc::removeSheet(const TQString& sheetname) { KSpread::Sheet* sheet = m_doc->map()->findSheet(sheetname); if(sheet) { @@ -100,33 +100,33 @@ bool Doc::removeSheet(const QString& sheetname) return false; } -bool Doc::loadNativeXML(const QString& xml) { - QDomDocument doc; +bool Doc::loadNativeXML(const TQString& xml) { + TQDomDocument doc; if(! doc.setContent(xml, true)) return false; return m_doc->loadXML(0, doc); } -QString Doc::saveNativeXML() { +TQString Doc::saveNativeXML() { return m_doc->saveXML().toString(2); } -bool Doc::openUrl(const QString& url) +bool Doc::openUrl(const TQString& url) { return m_doc->openURL(url); } -bool Doc::saveUrl(const QString& url) +bool Doc::saveUrl(const TQString& url) { return m_doc->saveAs(url); } -bool Doc::import(const QString& url) +bool Doc::import(const TQString& url) { return m_doc->import(url); } -bool Doc::exp0rt(const QString& url) +bool Doc::exp0rt(const TQString& url) { return m_doc->exp0rt(url); } diff --git a/kspread/plugins/scripting/kspreadcore/krs_doc.h b/kspread/plugins/scripting/kspreadcore/krs_doc.h index 28c69845..dd3df4d6 100644 --- a/kspread/plugins/scripting/kspreadcore/krs_doc.h +++ b/kspread/plugins/scripting/kspreadcore/krs_doc.h @@ -24,9 +24,9 @@ #include <api/class.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qdom.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqdom.h> namespace Kross { namespace KSpreadCore { @@ -45,7 +45,7 @@ class Doc : public Kross::Api::Class<Doc> public: explicit Doc(KSpread::Doc* doc); virtual ~Doc(); - virtual const QString getClassName() const; + virtual const TQString getClassName() const; private: /** @@ -69,7 +69,7 @@ class Doc : public Kross::Api::Class<Doc> * sheet = doc.sheetByName("foosheet") * @endcode */ - Sheet* sheetByName(const QString& name); + Sheet* sheetByName(const TQString& name); /** * This function returns an array with the sheet names @@ -81,36 +81,36 @@ class Doc : public Kross::Api::Class<Doc> * sheet = doc.sheetByName( sheetnames[0] ) * @endcode */ - QStringList sheetNames(); + TQStringList sheetNames(); /** * Add a new sheet named @p sheetname to the document. */ - bool addSheet(const QString& sheetname); + bool addSheet(const TQString& sheetname); /** * Remove the sheet named @p sheetname from the document. */ - bool removeSheet(const QString& sheetname); + bool removeSheet(const TQString& sheetname); /** * Loads the native XML document. */ - bool loadNativeXML(const QString& xml); + bool loadNativeXML(const TQString& xml); /** * Save and return the to a native document saved XML. */ - QString saveNativeXML(); + TQString saveNativeXML(); #if 0 - bool loadOpenDocXML(const QString& xml); - QString saveOpenDocXML(); + bool loadOpenDocXML(const TQString& xml); + TQString saveOpenDocXML(); #endif - bool openUrl(const QString& url); - bool saveUrl(const QString& url); - bool import(const QString& url); - bool exp0rt(const QString& url); + bool openUrl(const TQString& url); + bool saveUrl(const TQString& url); + bool import(const TQString& url); + bool exp0rt(const TQString& url); private: KSpread::Doc* m_doc; diff --git a/kspread/plugins/scripting/kspreadcore/krs_sheet.cpp b/kspread/plugins/scripting/kspreadcore/krs_sheet.cpp index 694037ed..790c2131 100644 --- a/kspread/plugins/scripting/kspreadcore/krs_sheet.cpp +++ b/kspread/plugins/scripting/kspreadcore/krs_sheet.cpp @@ -50,16 +50,16 @@ Sheet::Sheet(KSpread::Sheet* sheet, KSpread::Doc *doc) : Kross::Api::Class<Sheet Sheet::~Sheet() { } -const QString Sheet::getClassName() const { +const TQString Sheet::getClassName() const { return "Kross::KSpreadCore::Sheet"; } -const QString Sheet::name() const +const TQString Sheet::name() const { return m_sheet->sheetName(); } -void Sheet::setName(const QString& name) +void Sheet::setName(const TQString& name) { m_sheet->setSheetName(name); } @@ -78,8 +78,8 @@ Cell* Sheet::firstCell() const { } Cell* Sheet::cell(uint col, uint row) { - uint c = QMAX(uint(1), col); - uint r = QMAX(uint(1), row); + uint c = TQMAX(uint(1), col); + uint r = TQMAX(uint(1), row); return new Cell(m_sheet->cellAt(c,r),m_sheet,c,r); } @@ -92,11 +92,11 @@ bool Sheet::insertColumn(uint col) { } void Sheet::removeRow(uint row) { - m_sheet->removeRow( QMAX(uint(1), row) ); + m_sheet->removeRow( TQMAX(uint(1), row) ); } void Sheet::removeColumn(uint col) { - m_sheet->removeColumn( QMAX(uint(1), col) ); + m_sheet->removeColumn( TQMAX(uint(1), col) ); } } diff --git a/kspread/plugins/scripting/kspreadcore/krs_sheet.h b/kspread/plugins/scripting/kspreadcore/krs_sheet.h index a96e758e..bd83b6a8 100644 --- a/kspread/plugins/scripting/kspreadcore/krs_sheet.h +++ b/kspread/plugins/scripting/kspreadcore/krs_sheet.h @@ -52,17 +52,17 @@ class Sheet : public Kross::Api::Class<Sheet> public: Sheet(KSpread::Sheet* sheet, KSpread::Doc* doc = 0); virtual ~Sheet(); - virtual const QString getClassName() const; + virtual const TQString getClassName() const; private: /** * Return the name of the sheet. */ - const QString name() const; + const TQString name() const; /** * Set the name of the sheet. */ - void setName(const QString& name); + void setName(const TQString& name); /** * Return the currently maximum defined number of columns. diff --git a/kspread/plugins/scripting/kspreadcore/kspreadcoremodule.cpp b/kspread/plugins/scripting/kspreadcore/kspreadcoremodule.cpp index acfd0b2b..108516dc 100644 --- a/kspread/plugins/scripting/kspreadcore/kspreadcoremodule.cpp +++ b/kspread/plugins/scripting/kspreadcore/kspreadcoremodule.cpp @@ -45,9 +45,9 @@ using namespace Kross::KSpreadCore; KSpreadCoreModule::KSpreadCoreModule(Kross::Api::Manager* manager) : Kross::Api::Module("kspreadcore") , m_manager(manager) { - QMap<QString, Object::Ptr> children = manager->getChildren(); - kdDebug() << " there are " << children.size() << endl; - for(QMap<QString, Object::Ptr>::const_iterator it = children.begin(); it != children.end(); it++) + TQMap<TQString, Object::Ptr> tqchildren = manager->getChildren(); + kdDebug() << " there are " << tqchildren.size() << endl; + for(TQMap<TQString, Object::Ptr>::const_iterator it = tqchildren.begin(); it != tqchildren.end(); it++) { kdDebug() << it.key() << " " << it.data() << endl; } @@ -76,7 +76,7 @@ KSpreadCoreModule::~KSpreadCoreModule() } -const QString KSpreadCoreModule::getClassName() const +const TQString KSpreadCoreModule::getClassName() const { return "Kross::KSpreadCore::KSpreadCoreModule"; } diff --git a/kspread/plugins/scripting/kspreadcore/kspreadcoremodule.h b/kspread/plugins/scripting/kspreadcore/kspreadcoremodule.h index ffc998cc..03bde5fc 100644 --- a/kspread/plugins/scripting/kspreadcore/kspreadcoremodule.h +++ b/kspread/plugins/scripting/kspreadcore/kspreadcoremodule.h @@ -20,8 +20,8 @@ #ifndef KSPREAD_KROSS_KSPREADCOREMODULE_H #define KSPREAD_KROSS_KSPREADCOREMODULE_H -#include <qstring.h> -#include <qvariant.h> +#include <tqstring.h> +#include <tqvariant.h> #define KROSS_MAIN_EXPORT KDE_EXPORT @@ -51,8 +51,8 @@ namespace Kross { namespace KSpreadCore { public: KSpreadCoreModule(Kross::Api::Manager* manager); virtual ~KSpreadCoreModule(); - virtual const QString getClassName() const; - //virtual Kross::Api::Object::Ptr call(const QString& name, Kross::Api::List::Ptr arguments); + virtual const TQString getClassName() const; + //virtual Kross::Api::Object::Ptr call(const TQString& name, Kross::Api::List::Ptr arguments); private: #if 0 diff --git a/kspread/plugins/scripting/scripting.cc b/kspread/plugins/scripting/scripting.cc index 96cd1baf..e4299e26 100644 --- a/kspread/plugins/scripting/scripting.cc +++ b/kspread/plugins/scripting/scripting.cc @@ -20,7 +20,7 @@ */ #include "scripting.h" -#include <qapplication.h> +#include <tqapplication.h> #include <kdebug.h> #include <kgenericfactory.h> @@ -37,37 +37,37 @@ typedef KGenericFactory<Scripting> KSpreadScriptingFactory; K_EXPORT_COMPONENT_FACTORY( kspreadscripting, KSpreadScriptingFactory( "kspreadscripting" ) ) -Scripting::Scripting(QObject *parent, const char *name, const QStringList &) - : KParts::Plugin(parent, name) +Scripting::Scripting(TQObject *tqparent, const char *name, const TQStringList &) + : KParts::Plugin(tqparent, name) { setInstance(KSpreadScriptingFactory::instance()); kdDebug() << "Scripting plugin. Class: " - << metaObject()->className() + << tqmetaObject()->className() << ", Parent: " - << parent->metaObject()->className() + << tqparent->tqmetaObject()->className() << "\n"; - if ( parent->inherits("KSpread::View") ) + if ( tqparent->inherits("KSpread::View") ) { setInstance(Scripting::instance()); - m_view = (KSpread::View*) parent; + m_view = (KSpread::View*) tqparent; m_scriptguiclient = new Kross::Api::ScriptGUIClient( m_view, m_view ); // m_scriptguiclient ->setXMLFile(locate("data","kspreadplugins/scripting.rc"), true); kdDebug() << "Setup actions for scripting !" << endl; setXMLFile(locate("data","kspread/kpartplugins/scripting.rc"), true); - new KAction(i18n("Execute Script File..."), 0, 0, m_scriptguiclient, SLOT(executeScriptFile()), actionCollection(), "executescriptfile"); - new KAction(i18n("Script Manager..."), 0, 0, m_scriptguiclient, SLOT(showScriptManager()), actionCollection(), "configurescripts"); + new KAction(i18n("Execute Script File..."), 0, 0, m_scriptguiclient, TQT_SLOT(executeScriptFile()), actionCollection(), "executescriptfile"); + new KAction(i18n("Script Manager..."), 0, 0, m_scriptguiclient, TQT_SLOT(showScriptManager()), actionCollection(), "configurescripts"); KAction* scriptmenuaction = m_scriptguiclient->action("installedscripts"); actionCollection()->insert(scriptmenuaction); - connect(m_scriptguiclient, SIGNAL(executionFinished( const Kross::Api::ScriptAction* )), this, SLOT(executionFinished(const Kross::Api::ScriptAction*))); + connect(m_scriptguiclient, TQT_SIGNAL(executionFinished( const Kross::Api::ScriptAction* )), this, TQT_SLOT(executionFinished(const Kross::Api::ScriptAction*))); - Kross::Api::Manager::scriptManager()->addQObject(m_view->doc(), "KSpreadDocument"); - Kross::Api::Manager::scriptManager()->addQObject(m_view, "KSpreadView"); + Kross::Api::Manager::scriptManager()->addTQObject(m_view->doc(), "KSpreadDocument"); + Kross::Api::Manager::scriptManager()->addTQObject(TQT_TQOBJECT(m_view), "KSpreadView"); } } @@ -78,7 +78,7 @@ Scripting::~Scripting() void Scripting::executionFinished(const Kross::Api::ScriptAction*) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } #include "scripting.moc" diff --git a/kspread/plugins/scripting/scripting.h b/kspread/plugins/scripting/scripting.h index 1d08bd9f..b8bd3a55 100644 --- a/kspread/plugins/scripting/scripting.h +++ b/kspread/plugins/scripting/scripting.h @@ -35,8 +35,9 @@ namespace Kross { class Scripting : public KParts::Plugin { Q_OBJECT + TQ_OBJECT public: - Scripting(QObject *parent, const char *name, const QStringList &); + Scripting(TQObject *tqparent, const char *name, const TQStringList &); virtual ~Scripting(); private slots: void executionFinished(const Kross::Api::ScriptAction*); diff --git a/kspread/plugins/scripting/scripts/exporthtml/ExportHtml.py b/kspread/plugins/scripting/scripts/exporthtml/ExportHtml.py index 2e2dfc31..d4ab99ed 100755 --- a/kspread/plugins/scripting/scripts/exporthtml/ExportHtml.py +++ b/kspread/plugins/scripting/scripts/exporthtml/ExportHtml.py @@ -21,20 +21,20 @@ except (ImportError): raise "Failed to import the required PyQt python module." class Dialog(qt.QDialog): - def __init__(self, scriptpath, parent): + def __init__(self, scriptpath, tqparent): self.scriptpath = scriptpath import krosskspreadcore self.doc = krosskspreadcore.get("KSpreadDocument") import qt - qt.QDialog.__init__(self, parent, "Dialog", 1, qt.Qt.WDestructiveClose) + qt.QDialog.__init__(self, tqparent, "Dialog", 1, qt.Qt.WDestructiveClose) self.setCaption("Export to HTML File") - layout = qt.QVBoxLayout(self) + tqlayout = qt.QVBoxLayout(self) box = qt.QVBox(self) box.setMargin(10) box.setSpacing(10) - layout.addWidget(box) + tqlayout.addWidget(box) sheetbox = qt.QHBox(box) sheetbox.setSpacing(6) @@ -173,7 +173,7 @@ if __name__ == "__main__": qtapp = qt.QApplication(sys.argv) else: scriptpath = os.path.dirname(__name__) - qtapp = qt.qApp + qtapp = qt.tqApp dialog = Dialog(scriptpath, qtapp.mainWidget()) dialog.exec_loop() diff --git a/kspread/plugins/scripting/scripts/scripteditor/ScriptEditor.py b/kspread/plugins/scripting/scripts/scripteditor/ScriptEditor.py index f015a5f1..cedc82cc 100755 --- a/kspread/plugins/scripting/scripts/scripteditor/ScriptEditor.py +++ b/kspread/plugins/scripting/scripts/scripteditor/ScriptEditor.py @@ -22,10 +22,10 @@ except (ImportError): # Samples. class Widget(qt.QHBox): - def __init__(self, parentwidget, label = None): - self.parentwidget = parentwidget + def __init__(self, tqparentwidget, label = None): + self.tqparentwidget = tqparentwidget import qt - qt.QHBox.__init__(self, parentwidget) + qt.QHBox.__init__(self, tqparentwidget) self.setMargin(4) self.setSpacing(4) if label != None: qt.QLabel(label, self) @@ -33,10 +33,10 @@ class Widget(qt.QHBox): return None class ListWidget(Widget): - def __init__(self, parentwidget, label): + def __init__(self, tqparentwidget, label): import qt global Widget - Widget.__init__(self, parentwidget, label) + Widget.__init__(self, tqparentwidget, label) self.combo = qt.QComboBox(self) self.combo.setEditable(True) self.setStretchFactor(self.combo,1) @@ -44,22 +44,22 @@ class ListWidget(Widget): return self.combo.currentText() class EditWidget(Widget): - def __init__(self, parentwidget, label): + def __init__(self, tqparentwidget, label): import qt global Widget - Widget.__init__(self, parentwidget, label) + Widget.__init__(self, tqparentwidget, label) self.edit = qt.QLineEdit(self) self.setStretchFactor(self.edit,1) def value(self): return self.edit.text() class FileWidget(Widget): - def __init__(self, parentwidget, label, filtermask, openfiledialog = True): - self.filtermask = filtermask + def __init__(self, tqparentwidget, label, filtertqmask, openfiledialog = True): + self.filtertqmask = filtertqmask self.openfiledialog = openfiledialog import qt global Widget - Widget.__init__(self, parentwidget, label) + Widget.__init__(self, tqparentwidget, label) self.edit = qt.QLineEdit(self) self.setStretchFactor(self.edit,1) btn = qt.QPushButton("...",self) @@ -68,9 +68,9 @@ class FileWidget(Widget): import qt text = str( self.edit.text() ) if self.openfiledialog: - filename = str( qt.QFileDialog.getOpenFileName(text, self.filtermask, self.parentwidget) ) + filename = str( qt.QFileDialog.getOpenFileName(text, self.filtertqmask, self.tqparentwidget) ) else: - filename = qt.QFileDialog.getSaveFileName(text, self.filtermask, self.parentwidget) + filename = qt.QFileDialog.getSaveFileName(text, self.filtertqmask, self.tqparentwidget) if filename != "": self.edit.setText( filename ) def value(self): return self.edit.text() @@ -81,33 +81,33 @@ class Samples: # KexiDB class KexiDB: - def __init__(self, parentwidget): - self.parentwidget = parentwidget + def __init__(self, tqparentwidget): + self.tqparentwidget = tqparentwidget class _ProjectWidget(FileWidget): - def __init__(self, parentwidget): + def __init__(self, tqparentwidget): global FileWidget - FileWidget.__init__(self, parentwidget, "Project File:", "*.kexi *.kexis *.kexic;;*") + FileWidget.__init__(self, tqparentwidget, "Project File:", "*.kexi *.kexis *.kexic;;*") class _DriverWidget(ListWidget): - def __init__(self, parentwidget): + def __init__(self, tqparentwidget): global ListWidget - ListWidget.__init__(self, parentwidget, "Driver:") + ListWidget.__init__(self, tqparentwidget, "Driver:") import krosskexidb for driver in krosskexidb.DriverManager().driverNames(): self.combo.insertItem(driver) class _TableWidget(ListWidget): - def __init__(self, parentwidget): + def __init__(self, tqparentwidget): global ListWidget - ListWidget.__init__(self, parentwidget, "Table:") + ListWidget.__init__(self, tqparentwidget, "Table:") class PrintDriverDetails: """ Print a the list of available KexiDB drivers and print details about one of them. """ name = "Details about a driver" - def __init__(self, parent): + def __init__(self, tqparent): self.widgets = { - "DriverName" : Samples.KexiDB._DriverWidget( parent.parentwidget ), + "DriverName" : Samples.KexiDB._DriverWidget( tqparent.tqparentwidget ), } def getCode(self): return ( @@ -125,9 +125,9 @@ class Samples: class ConnectWithFile: """ Connect with a KexiDB database by using a Kexi Connection Project File. """ name = "Connect with file" - def __init__(self, parent): + def __init__(self, tqparent): self.widgets = { - "ProjectFile" : Samples.KexiDB._ProjectWidget( parent.parentwidget ), + "ProjectFile" : Samples.KexiDB._ProjectWidget( tqparent.tqparentwidget ), } def getCode(self): return ( @@ -164,10 +164,10 @@ class Samples: class IterateThroughTable: """ Iterate through a table within a connected KexiDB database. """ name = "Iterate through table" - def __init__(self, parent): + def __init__(self, tqparent): self.widgets = { - "ProjectFile" : Samples.KexiDB._ProjectWidget( parent.parentwidget ), - "TableName" : Samples.KexiDB._TableWidget( parent.parentwidget ), + "ProjectFile" : Samples.KexiDB._ProjectWidget( tqparent.tqparentwidget ), + "TableName" : Samples.KexiDB._TableWidget( tqparent.tqparentwidget ), } def getCode(self): return ( @@ -216,13 +216,13 @@ class Samples: # KSpread class KSpread: - def __init__(self, parentwidget): - self.parentwidget = parentwidget + def __init__(self, tqparentwidget): + self.tqparentwidget = tqparentwidget class _SheetWidget(ListWidget): - def __init__(self, parentwidget, label = "Sheet:"): + def __init__(self, tqparentwidget, label = "Sheet:"): global ListWidget - ListWidget.__init__(self, parentwidget, label) + ListWidget.__init__(self, tqparentwidget, label) try: import krosskspreadcore @@ -235,9 +235,9 @@ class Samples: print trace class _CellsWidget(ListWidget): - def __init__(self, parentwidget): + def __init__(self, tqparentwidget): global ListWidget - ListWidget.__init__(self, parentwidget, "Cells (col1:row1 - col2:row2):") + ListWidget.__init__(self, tqparentwidget, "Cells (col1:row1 - col2:row2):") self.combo.insertItem( "1:1 - %s:%s" % (5,10) ) self.combo.insertItem( "1:1 - %s:%s" % (256,256) ) self.combo.insertItem( "1:1 - %s:%s" % (32767,32767) ) @@ -245,15 +245,15 @@ class Samples: return [ [ int(i) for i in item.split(':') ] for item in str( ListWidget.value(self) ).split('-') ] class _ValueWidget(EditWidget): - def __init__(self, parentwidget): + def __init__(self, tqparentwidget): global EditWidget - EditWidget.__init__(self, parentwidget, "Value:") + EditWidget.__init__(self, tqparentwidget, "Value:") self.edit.setText("Some text") class _ColorWidget(EditWidget): - def __init__(self, parentwidget,label,color): + def __init__(self, tqparentwidget,label,color): global EditWidget - EditWidget.__init__(self, parentwidget, "%s (RGB):" % label) + EditWidget.__init__(self, tqparentwidget, "%s (RGB):" % label) self.edit.setText(color) def value(self): return "#%s" % EditWidget.value(self) @@ -261,12 +261,12 @@ class Samples: class SetTextOfCells: """ Set the text of the defined cells. """ name = "Set text of cells" - def __init__(self, parent): + def __init__(self, tqparent): pass self.widgets = { - "SheetName" : Samples.KSpread._SheetWidget( parent.parentwidget ), - "Cells" : Samples.KSpread._CellsWidget( parent.parentwidget ), - "Value" : Samples.KSpread._ValueWidget( parent.parentwidget ), + "SheetName" : Samples.KSpread._SheetWidget( tqparent.tqparentwidget ), + "Cells" : Samples.KSpread._CellsWidget( tqparent.tqparentwidget ), + "Value" : Samples.KSpread._ValueWidget( tqparent.tqparentwidget ), } def getCode(self): return ( @@ -292,13 +292,13 @@ class Samples: class SetColorsOfCells: """ Set the colors of the defined cells. """ name = "Set colors of cells" - def __init__(self, parent): + def __init__(self, tqparent): pass self.widgets = { - "SheetName" : Samples.KSpread._SheetWidget( parent.parentwidget), - "Cells" : Samples.KSpread._CellsWidget( parent.parentwidget ), - "TextColor" : Samples.KSpread._ColorWidget( parent.parentwidget, "Textcolor", "ff0000" ), - "BackgroundColor" : Samples.KSpread._ColorWidget( parent.parentwidget, "Backgroundcolor", "c0c0c0" ), + "SheetName" : Samples.KSpread._SheetWidget( tqparent.tqparentwidget), + "Cells" : Samples.KSpread._CellsWidget( tqparent.tqparentwidget ), + "TextColor" : Samples.KSpread._ColorWidget( tqparent.tqparentwidget, "Textcolor", "ff0000" ), + "BackgroundColor" : Samples.KSpread._ColorWidget( tqparent.tqparentwidget, "Backgroundcolor", "c0c0c0" ), } def getCode(self): return ( @@ -324,10 +324,10 @@ class Samples: class IterateThroughCellsWithContent: """ Iterate over all cells in a sheet that have content (aka that are not empty). """ name = "Iterate through cells" - def __init__(self, parent): + def __init__(self, tqparent): pass self.widgets = { - "SheetName" : Samples.KSpread._SheetWidget( parent.parentwidget ), + "SheetName" : Samples.KSpread._SheetWidget( tqparent.tqparentwidget ), } def getCode(self): return ( @@ -352,9 +352,9 @@ class Samples: class PrintSheetDetails: """ Print details about the current sheet. """ name = "Details about a sheet" - def __init__(self, parent): + def __init__(self, tqparent): self.widgets = { - "SheetName" : Samples.KSpread._SheetWidget( parent.parentwidget ), + "SheetName" : Samples.KSpread._SheetWidget( tqparent.tqparentwidget ), } def getCode(self): return ( @@ -376,10 +376,10 @@ class Samples: class LoadDocFromNativeXML: """ Load the document from a native XML file. """ name = "Load document from native XML File" - def __init__(self, parent): + def __init__(self, tqparent): global FileWidget self.widgets = { - "FileName" : FileWidget( parent.parentwidget, "XML File:", "*.xml;;*" ), + "FileName" : FileWidget( tqparent.tqparentwidget, "XML File:", "*.xml;;*" ), } def getCode(self): return ( @@ -413,10 +413,10 @@ class Samples: class SaveDocToNativeXML: """ Save the document to a native XML file. """ name = "Save document to native XML File" - def __init__(self, parent): + def __init__(self, tqparent): global FileWidget self.widgets = { - "FileName" : FileWidget( parent.parentwidget, "XML File:", "*.xml;;*", False ), + "FileName" : FileWidget( tqparent.tqparentwidget, "XML File:", "*.xml;;*", False ), } def getCode(self): return ( @@ -451,10 +451,10 @@ class Samples: class CopySheets: """ Copy the text-content from one sheet to another. """ name = "Copy sheets" - def __init__(self, parent): + def __init__(self, tqparent): self.widgets = { - "SourceSheet" : Samples.KSpread._SheetWidget( parent.parentwidget, "Source sheet:" ), - "TargetSheet" : Samples.KSpread._SheetWidget( parent.parentwidget, "Target sheet:" ), + "SourceSheet" : Samples.KSpread._SheetWidget( tqparent.tqparentwidget, "Source sheet:" ), + "TargetSheet" : Samples.KSpread._SheetWidget( tqparent.tqparentwidget, "Target sheet:" ), } def getCode(self): return ( @@ -480,10 +480,10 @@ class Samples: class LoadSheetFromCSV: """ Load the content of a CSV file into a KSpread sheet. """ name = "Load data from CSV file into sheet" - def __init__(self, parent): + def __init__(self, tqparent): self.widgets = { - "Sheet" : Samples.KSpread._SheetWidget( parent.parentwidget ), - "FileName" : FileWidget( parent.parentwidget, "CSV File:", "*.csv;;*", True ), + "Sheet" : Samples.KSpread._SheetWidget( tqparent.tqparentwidget ), + "FileName" : FileWidget( tqparent.tqparentwidget, "CSV File:", "*.csv;;*", True ), } def getCode(self): return ( @@ -519,10 +519,10 @@ class Samples: class SaveSheetToCSV: """ Save the content of a KSpread sheet into a CSV file. """ name = "Save data from a sheet into a CSV file" - def __init__(self, parent): + def __init__(self, tqparent): self.widgets = { - "Sheet" : Samples.KSpread._SheetWidget( parent.parentwidget ), - "FileName" : FileWidget( parent.parentwidget, "CSV File:", "*.csv;;*", False ), + "Sheet" : Samples.KSpread._SheetWidget( tqparent.tqparentwidget ), + "FileName" : FileWidget( tqparent.tqparentwidget, "CSV File:", "*.csv;;*", False ), } def getCode(self): return ( @@ -557,16 +557,16 @@ class Samples: # PyQt class PyQt: - def __init__(self, parentwidget): - self.parentwidget = parentwidget + def __init__(self, tqparentwidget): + self.tqparentwidget = tqparentwidget class OpenFileDialog: """ Show the usage of the openfile dialog with QFileDialog. """ name = "Open File Dialog" - def __init__(self, parent): + def __init__(self, tqparent): pass self.widgets = { - "FileName" : FileWidget( parent.parentwidget, "Open File:", "*.txt *.html;;*" ), + "FileName" : FileWidget( tqparent.tqparentwidget, "Open File:", "*.txt *.html;;*" ), } def getCode(self): return ( @@ -578,10 +578,10 @@ class Samples: class SaveFileDialog: """ Show the usage of the savefile dialog with QFileDialog. """ name = "Save File Dialog" - def __init__(self, parent): + def __init__(self, tqparent): pass self.widgets = { - "FileName" : FileWidget( parent.parentwidget, "Save File:", "*.txt *.html;;*", False ), + "FileName" : FileWidget( tqparent.tqparentwidget, "Save File:", "*.txt *.html;;*", False ), } def getCode(self): return ( @@ -593,7 +593,7 @@ class Samples: class CustomDialog: """ Show a custom dialog that inherits a QDialog. """ name = "Custom Dialog" - def __init__(self, parent): + def __init__(self, tqparent): pass self.widgets = { } @@ -602,9 +602,9 @@ class Samples: 'import qt', '', 'class MyDialog(qt.QDialog):', - ' def __init__(self, parent):', + ' def __init__(self, tqparent):', ' import qt', - ' qt.QDialog.__init__(self, parent, "MyDialog", 1, qt.Qt.WDestructiveClose)', + ' qt.QDialog.__init__(self, tqparent, "MyDialog", 1, qt.Qt.WDestructiveClose)', ' self.setCaption("My Dialog")', ' btn = qt.QPushButton("Click me",self)', ' qt.QObject.connect(btn, qt.SIGNAL("clicked()"), self.buttonClicked)', @@ -619,11 +619,11 @@ class Samples: class InputDialog: """ Show how to use a QInputDialog. """ name = "Input Dialog" - def __init__(self, parent): + def __init__(self, tqparent): global EditWidget self.widgets = { - "Caption" : EditWidget( parent.parentwidget, "Caption" ), - "Message" : EditWidget( parent.parentwidget, "Message" ), + "Caption" : EditWidget( tqparent.tqparentwidget, "Caption" ), + "Message" : EditWidget( tqparent.tqparentwidget, "Message" ), } def getCode(self): return ( @@ -640,13 +640,13 @@ class Samples: # DCOP class DCOP: - def __init__(self, parentwidget): - self.parentwidget = parentwidget + def __init__(self, tqparentwidget): + self.tqparentwidget = tqparentwidget class PrintClipboard: """ Print the content from the clipper via DCOP. """ name = "Clipboard content" - def __init__(self, parent): + def __init__(self, tqparent): self.widgets = { } def getCode(self): @@ -657,13 +657,13 @@ class Samples: 'd = dcopext.DCOPApp(apps[0], dcopclient)', 'result,typename,data = d.appclient.call(apps[0],"klipper","getClipboardContents()","")', 'ds = qt.QDataStream(data, qt.IO_ReadOnly)', - 'print "Clipboard content:\\n%s" % kdecore.dcop_next(ds, "QString")', + 'print "Clipboard content:\\n%s" % kdecore.dcop_next(ds, TQSTRING_OBJECT_NAME_STRING)', ) class AmarokCollectionInfos: """ Fetch some collection informations from the amarok collection via DCOP. """ name = "amarok collection infos" - def __init__(self, parent): + def __init__(self, tqparent): self.widgets = { } def getCode(self): @@ -688,7 +688,7 @@ class Samples: class KopeteContacts: """ Print the names of all contacts Kopete knows via DCOP. """ name = "Kopete contacts" - def __init__(self, parent): + def __init__(self, tqparent): self.widgets = { } def getCode(self): @@ -704,14 +704,14 @@ class Samples: 'if not state: raise "Failed to call the kopete contacts-function"', '', 'ds = qt.QDataStream(rdata.data(), qt.IO_ReadOnly)', - 'sl = kdecore.dcop_next (ds, "QStringList")', + 'sl = kdecore.dcop_next (ds, TQSTRINGLIST_OBJECT_NAME_STRING)', 'print "contacts=%s" % [ str(s) for s in sl ]', ) class KWordSelectedText: """ Get the selected text from a KWord instance via DCOP. """ name = "KWord selected text" - def __init__(self, parent): + def __init__(self, tqparent): self.widgets = { } def getCode(self): @@ -752,22 +752,22 @@ class Samples: '', '# Get the selected text.', '(state,rtype,rdata) = d.appclient.call(appname, frameset.obj(), "selectedText()", "")', - 'print "Selected Text: %s" % dataToList( rdata,["QString"] )[0]', + 'print "Selected Text: %s" % dataToList( rdata,[TQSTRING_OBJECT_NAME_STRING] )[0]', ) #################################################################################### # Dialog implementations. class SampleDialog(qt.QDialog): - def __init__(self, parent, sampleclazz, samplechildclazz): + def __init__(self, tqparent, sampleclazz, samplechildclazz): import qt - qt.QDialog.__init__(self, parent, "SampleDialog", 1) + qt.QDialog.__init__(self, tqparent, "SampleDialog", 1) - layout = qt.QVBoxLayout(self) + tqlayout = qt.QVBoxLayout(self) box = qt.QVBox(self) box.setMargin(4) box.setSpacing(10) - layout.addWidget(box) + tqlayout.addWidget(box) self.scrollview = qt.QScrollView(box) self.scrollview.setResizePolicy(qt.QScrollView.AutoOne) @@ -813,11 +813,11 @@ class SampleDialog(qt.QDialog): widget = self.samplechild.widgets[widgetname] value = widget.value() if value != None: - code = code.replace("{%s}" % widgetname, str(value)) + code = code.tqreplace("{%s}" % widgetname, str(value)) return code class MainDialog(qt.QDialog): - def __init__(self, scriptpath, parent): + def __init__(self, scriptpath, tqparent): self.scriptpath = scriptpath if not hasattr(__main__,"scripteditorfilename"): __main__.scripteditorfilename = self.getFileName("myscript.py") @@ -826,14 +826,14 @@ class MainDialog(qt.QDialog): self.doc = krosskspreadcore.get("KSpreadDocument") import os, qt - qt.QDialog.__init__(self, parent, "MainDialog", 1, qt.Qt.WDestructiveClose) + qt.QDialog.__init__(self, tqparent, "MainDialog", 1, qt.Qt.WDestructiveClose) self.setCaption("Script Editor") - layout = qt.QVBoxLayout(self) + tqlayout = qt.QVBoxLayout(self) box = qt.QVBox(self) box.setMargin(4) box.setSpacing(10) - layout.addWidget(box) + tqlayout.addWidget(box) menu = qt.QMenuBar(box) @@ -1083,7 +1083,7 @@ if __name__ == "__main__": qtapp = qt.QApplication(sys.argv) else: scriptpath = os.path.dirname(__name__) - qtapp = qt.qApp + qtapp = qt.tqApp dialog = MainDialog(scriptpath, qtapp.mainWidget()) dialog.exec_loop() |